what will be the output of the following code for JPEG image compression

"if ndims(x)~=2 | ~isreal(x) | ~isnumeric(x) | ~isa(x, 'uint8') error ('The input must be a unit8 image.'); end ...... " is this statement is true for uint8image? i want to know the this statement is true or not and is this go to the next level of the coding as given below:- " ............ if nargin<2 quality=1; %default value of quality end
...... " "

Réponses (2)

nasim alam
nasim alam le 10 Mar 2011
error :- ??? Error using ==> Untitled The input must be a unit8 image.
This is effectively the same question as your earlier one
The "if" test will be true if the uint8 array is 3 or more dimensions, or is complex. When the test is true, an error is generated.
For example,
x = uint8(complex(1,2));
would trigger the error.
If you are seeing the error being generated, then your x array is probably 3 dimensional, such as would be the case for an RGB image. That routine cannot be used to compress RGB images. It can, though, be used to compress gray-scale images, rgb2gray(x)

Catégories

En savoir plus sur Images dans Centre d'aide et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by