Question

is there any difference between grey scale image and binary image?

Was it helpful?

Solution

Yes, the one is grayscale, e.g. gray scales from 0.255, the binary imange is binary, that means black(0) or white(1).

EDIT: Convert grayscale to binary. Directly converting color images (like RGB) to binary is not that easy, because you have to handle every color channel within the image seperatly.

Converting to binary is done using a ceratin threshold. E.g. you can say, all pixels with gray > 125 will become white, the others black. There are several thresholding algorithm out there, but maybe the most common is Otsu. You can find it here Thresholding by Otsu

OTHER TIPS

Yes, but I'm not sure what this has to do with C++ or programming. A binary image could be an image where pixels are only either red or blue.

Binary Image: http://en.wikipedia.org/wiki/Binary_image

Grayscale Image: http://en.wikipedia.org/wiki/Grayscale

A binary image has only two values for each pixel, 0 and 1 corresponding to black and white (or vice versa). A gray scale image has a certain number (probably 8) bits of information per pixel, hence, 256 possible grey values.

Of course, a grey scale image has a binary representation, but the smallest size of information is not a bit, so we don't call it a binary image.

edit Assuming you want to convert in Matlab, use im2bw. If you're not using Matlab, the idea of binarization is explained on that page as well. It's not difficult to port, it boils down to comparing every pixel to a threshold value.

Black and White image contains only two levels.

Gray image represent by black and white shades or combination of levels for e.g. 8 bit gray image means total 2^8 levels form black to white 0 = black and 255 is White.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top