Problem comparing Pixel value of RGB 'single' Image

조회 수: 1 (최근 30일)
Adnan Hanif
Adnan Hanif 2017년 2월 18일
There is a problem comparing the RGB pixel value e.g (300,300,:) of an RGB 'single' image with any fixed scalar value. Here is the example for trying out yourself using demo image:
ii = imread('fabric.png');
ss = im2single(ii);
mm = ss(300,300,:);
nn = mm(:)
nn(2) == 0.2235
Here it return 0 (false).
On the other hand:
nn = [0.3098; 0.2235; 0.2706]
nn(2) == 0.2235
It return 1 (true), as expected.
Kindly shed some light on this issue. I am using MATLAB R2014b. Thanks

답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by