how to set the pixel values to 1 and o's based on some threshold values
3 views (last 30 days)
Show older comments
senthil vadivu
on 20 Nov 2016
Commented: senthil vadivu
on 21 Nov 2016
Eg. if redpixel>th and redpixel>green and greenpixel>blue then mark all the pixel values as 1 otherwise to 0
0 Comments
Accepted Answer
Guillaume
on 20 Nov 2016
binaryimage = rgbimage(:, :, 1) > threshold ... red pixels greater than threshold
& ... AND
rgbimage(:, :, 1) > rgbimage(:, :, 2) ... red greater than green
& ... AND
rgbimge(:, :, 2) > rgbimage(:, :, 3); ... green greater than blue
Or in one line:
binaryimage = rgbimage(:, :, 1) > threshold & rgbimage(:, :, 1) > rgbimage(:, :, 2) & rgbimge(:, :, 2) > rgbimage(:, :, 3);
More Answers (0)
See Also
Categories
Find more on Image Processing Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!