Does anybody know of a way to extract all 'red' values [255 0 0] from an image to make a binary image where 1's indicate the locations of red pixels?
I have done this with a loop, but I'm sure there is a much quicker way to do it...
Here's my loop, in case it clears up the objective:
for m = 1:size(img,1)
for n = 1:size(img,2)
if img(m,n,1) == 255 && img(m,n,2) == 0 && img(m,n,3) == 0
HaloRegion_Map(m,n) = 1;
end
end
end
Thanks for your help
0 Comments
Sign in to comment.