jpeg image compression

조회 수: 10 (최근 30일)
nasim alam
nasim alam 2011년 3월 9일
what is the coding for jpeg image compression using 2-D DCT transform.
what is the meaning of this sentence :- " if ndims(x)~=2 | ~isreal(x) | ~isnumeric(x) | ~isa(x, 'uint8') error ('The input must be a unit8 image.'); end "

답변 (2개)

Sarah Wait Zaranek
Sarah Wait Zaranek 2011년 3월 9일
This is a logical statement, let's break it down - english on left, MATLAB on right.
if the number of dimensions of x is not equal to 2 (ndims(x)~=2)
or (|)
is not real (~isreal(x))
or (|)
is not numeric (~isnumeric(x))
or (|)
is not an unsigned 8 bit integer ( ~isa(x, 'uint8') )
then throw the error
"The input must be a ....." (error('message here')

Walter Roberson
Walter Roberson 2011년 3월 9일
ndims is the number of dimensions of the array. Arrays 3 dimensions (RGB) or larger are rejected.
isreal() tests whether the data contains imaginary components; the code rejects if it does.
isnumeric() tests for cell arrays, strings, logicals symbolic numbers and objects; the code rejects the data if it contains anything but numbers.
is(x,'uint8') tests to see whether the data is unsigned 8 bit numbers; the code rejects the data if it is not.
  댓글 수: 2
Sarah Wait Zaranek
Sarah Wait Zaranek 2011년 3월 9일
Walter,
I think we duplicated each others answers here. Probably both submitted at the same. Do you want to merge them?
Cheers,
Sarah
Walter Roberson
Walter Roberson 2011년 3월 9일
I'm not sure it's worth the time spent editing, as I do not expect that many people will end up referring to the question unless drawn in by the inexact title.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Large Files and Big Data에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by