How can I create a binary image, where the blue pixels are white and everything else is black?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
ESIDOR PASHAJ
am 28 Jan. 2018
Kommentiert: ESIDOR PASHAJ
am 29 Jan. 2018
I have an image where there is a light-blue book in the background. I need to create a binary image where I select only the blue pixels of the image as white and everything else as black so I can 'isolate' the book.
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 28 Jan. 2018
Bearbeitet: Image Analyst
am 28 Jan. 2018
Use the Color thresholder on the Apps tab of the tool ribbon. Then export the function to an m-file. Or you might try this
redChannel = rgbImage(:, :, 1);
binaryImage = redChannel < 128; % Adjust value as needed.
% Extract largest blob only
binaryImage = bwareafilt(binaryImage, 1);
This assumes the rest of your image is some uniform non-blue color. If the "foreground" and the rest of your "background" (not including the book in the background) is cluttered with all kinds of various objects, then it could be very challenging. In that case, attach your image to your original post up top.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!