image processing displaying color of the particular plane in the histogram

1 Ansicht (letzte 30 Tage)
Hi,
Is it possible to display histogram of color in a color image from a particular plane? like when we use imhist we get shades of grey bar below the histogram could we do that in color ?

Antworten (1)

Image Analyst
Image Analyst am 14 Jul. 2020
No, that's not a feature. In fact there is no RGB histogram function. You can extract each color channel into a monochrome image and then call imhist() and get the gray scale wedge underneath the histogram, but it will be in grayscale because it has no idea where (what color channel) the monochrome image array came from.
  4 Kommentare
Image Analyst
Image Analyst am 18 Jul. 2020
Bearbeitet: Image Analyst am 18 Jul. 2020
So if you have a general cluster of points, like a random cloud, then the centroid of the cluster is the mean of the x, y, and x. So assuming you have a color image,
[redChannel, greenChannel, blueChannel] = imsplit(rgbImage);
midR = mean2(redChannel)
midG = mean2(greenChannel)
midB = mean2(blueChannel)
So those are the values. Note that since they're the mean, and are probably non-integer values, there may be no pixel in your image that has the mean value (even if the mean were integer).
But now we come to where we need to understand exactly what "looking at the mid grey level from the color pixels in the three axis separately" means. Does it mean that you want to zoom in on your plot to the middle, like this:
xlim([midR - 5, midR + 5]);
ylim([midG - 5, midG + 5]);
zlim([midB - 5, midB + 5]);
I really have no idea unless you explain that phrase much more accurately, or put up a picture of what you hope to obtain.

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by