Azzera filtri
Azzera filtri

Why only selecting Green channel of color image for binarize ?

7 visualizzazioni (ultimi 30 giorni)
hi, can anyone give the reason selecting the green channel from the color image for binarize that image, why not red and blue channels.

Risposte (3)

Walter Roberson
Walter Roberson il 24 Feb 2017
The human eye is most sensitive to green, so using green is an inexpensive replacement for doing an rgb to intensity conversion.
(To be more accurate, the blue cones are much more sensitive to light. But there are a lot fewer blue cones and most of them are outside of region of sharp focus, so the overall contribution to the brain is comparable to the other two types.)
  2 Commenti
SATISH KUMAR
SATISH KUMAR il 25 Feb 2017
thanks for the answer Walter Roberson, i am working on camera based document image analysis there i need this binarzation of color image. so, i found it is giving good result when i used the green channel for binary. ok thank a lot for the giving the reason.
Walter Roberson
Walter Roberson il 25 Feb 2017
Depending on how the document is illuminated and upon the kind of paper and upon the inks, there might be other reasons why a particular color channel is a good idea.

Accedi per commentare.


Image Analyst
Image Analyst il 25 Feb 2017
The green channel usually has the most light in it, with typical light sources like sunlight. There are also twice as many green pixels in digital cameras as red or blue pixels - just look at any Bayer color array. These two facts mean that often/usually the green channel will have less noise than the red or blue channel.
There are several considerations that go into how you convert a color image into a gray scale image. You could use rgb2gray(), or take one particular color channel, or take a weighted sum of channels using something like pca() or kmeans() - demos attached. Like Walter said, it really depends on what your image is and what you're trying to extract.

LAXMI PRIYANKA
LAXMI PRIYANKA il 15 Apr 2020
iam trying to apply clahe to the extracted green channel of my image
i get the following errors
i have also attached the coding
cold anyone help me in this regard
Error using adapthisteq
Expected input number 1, I, to be two-dimensional.
Error in adapthisteq>parseInputs (line 416)
validateattributes(I, {'uint8', 'uint16', 'double', 'int16', 'single'}, ...
Error in adapthisteq (line 154)
[I, selectedRange, fullRange, numTiles, dimTile, clipLimit, numBins, ...
  2 Commenti
Walter Roberson
Walter Roberson il 15 Apr 2020
adapthisteq can only be applied to grayscale images.
Your code gets a file name from the user, and imred() and imresize() to 512, then sends im2uint8() of that to adapthisteq. That assumes that the image in the file is already grayscale. That is true for some kinds of files, but not all. In particular, it is rare for .jpg to be grayscale even if they look grayscale.
Note: your line
[xRes,yRes]=size(input_img);
is broken if input_img might be RGB.
Image Analyst
Image Analyst il 15 Apr 2020
Never use just two outputs for images, or else you can run into the problem like you did. Always include a third return argument just in case it's RGB:
[rows, columns, numberOfColorChannels] = size(input_img);
Also note that you had xRes in the rows place. Well, x is for columns, not rows. So if you wanted to stick with that terminilogy you'd need to do it this way:
[yRes, xRes, numberOfColorChannels] = size(input_img);

Accedi per commentare.

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by