I would like to reduce the pixel value of image for each range rgb channel to [0 1], but at the end i get an endless loop
Show older comments
my code is :
I=imread('peppers.png');
im_red = I(:,:,1);
im_green = I(:,:,2);
im_blue = I(:,:,3);
red = double(im_red)/255;
mid_red = (max(red)-min(red))/2;
[redrow redcol]=size(red);
for i=1:redrow
for j=1:redcol
if red(i,j) > mid_red
red(i,j)=1
else red(i,j)=0
end
end
end
Please help me solve the problem
Answers (1)
Categories
Find more on Images in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!