how can i find max intensity from cell image

1 次查看(过去 30 天)
i have divided my image into several cells by mat2cell function
if size(R)==[512,512];
else
R =imresize(R,[512,512]);
end
div = [128,128,128,128]; % block s
if true
% code
endize would be 128*128 and division of
%images would be 4*4 blocks
Br = mat2cell(R,div,div); % Division of Reference image into Blocks.
Br_r = size(Br,1);
Br_c = size(Br,2);
for i =1: Br_r*Br_c;
subplot(Br_r,Br_c,i);
figure(1),imshow(Br{i});
end
but now i wana read the each cell and find if there is any pixel of intensity 255 i dont know how to access the pixels i have applied impixel function but it gives ERROR help me please

回答(1 个)

Image Analyst
Image Analyst 2014-5-16
编辑:Image Analyst 2014-5-18
if max(max(Br{i})) == 255
% then do whatever you want to do
end
  2 个评论
Filza Ashraf
Filza Ashraf 2014-5-18
sir, this code is not working it is not detecting the 255 intensity pixels
Image Analyst
Image Analyst 2014-5-18
That's not exactly what you asked. You asked something slightly different and that was that if ANY pixel in the tile was 255 to do something. If you want to get a map (binary image) of where the image is 255 or not, then do this on the original image:
pixels255 = R == 255;

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by