Grayscale image to binary image
2 views (last 30 days)
Show older comments
I want to read grayscale image amd change it to one row binary bits without loss quality then return it back again to grayscale image.
0 Comments
Answers (2)
Walter Roberson
on 17 Nov 2013
binary_vector = reshape(dec2bin(YourGrayscaleImage, 8).' - '0', [], 1);
2 Comments
Image Analyst
on 17 Nov 2013
See my bitslice demo, attached below in blue.
2 Comments
Image Analyst
on 18 Nov 2013
- How are you defining resolution? Your image will have a certain number of rows and columns, and each gray scale pixel will have an 8 or 16 bit value. Now, which of those are you calling resolution? And higher than what ?
- What vector? You have 2D images. A vector is a 1D array, or a list of (x,y) coordinates. What you have is a 2D image, so what is the vector you want to get? All the pixels values strung together in a 1D array like yourImage(:)?
See Also
Categories
Find more on Convert Image Type 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!