how to read the pixels of image and convert it to binary representation?

1 visualizzazione (ultimi 30 giorni)
hello., i need ur guidance to read the pixel values of rgb image and convert those to binary representation.,
thanks in advance

Risposta accettata

Image Analyst
Image Analyst il 27 Mar 2014
You can threshold
binaryImageRed = rgbImage(:,:,1) > someThresholdValueR;
binaryImageGreen = rgbImage(:,:,2) > someThresholdValueG;
binaryImageBlue = rgbImage(:,:,3) > someThresholdValueB;
What are you thinking would be foreground and what is background? I can't tell because you forgot to attach your image.
  3 Commenti
Image Analyst
Image Analyst il 27 Mar 2014
You should use imshow() instead of disp(). imshow() displays the image while disp spews every pixel value in decimal to the command window (not what you want).
Also, I don't know what the binstring stuff is for. I'd get rid of it.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Convert Image Type in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by