Read an RGB image into the workspace. View the size of the image.
I = imread('peppers.png');
size(I)
ans = 1×3
384 512 3
Create an imref2d spatial referencing object with the same dimensions as the image. The object does not retain information about the third dimension of the image array.
TF — Flag indicating size compatibility logical scalar
Flag indicating size compatibility, returned as a logical scalar.
TF is True if the size of the
image A is consistent with the referencing object
R. When R is:
An imref2d
spatial referencing object, TF returns true
when R.ImageSize == [size(A,1)
size(A,2)].
Note
The dimensionality of A does not need
to match the dimensionality of an imref2d
spatial referencing object. For example, an RGB image can be
consistent with an imref2d object. In
this case, sizesMatch ignores the third
image dimension.
An imref3d
spatial referencing object, TF returns true
when R.ImageSize == size(A).
A must be a 3-D array.
Data Types: logical
Introduced in R2013a
예제 열기
귀하의 시스템에 이 예제의 수정된 버전이 있습니다. 이 버전을 대신 여시겠습니까?
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.