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
...... " "

답변 (2개)

nasim alam
nasim alam 2011년 3월 10일

0 개 추천

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)

카테고리

도움말 센터File Exchange에서 Images에 대해 자세히 알아보기

제품

질문:

2011년 3월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by