image processing displaying color of the particular plane in the histogram
2 次查看(过去 30 天)
显示 更早的评论
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 ?
0 个评论
回答(1 个)
Image Analyst
2020-7-14
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 个评论
Image Analyst
2020-7-18
编辑:Image Analyst
2020-7-18
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!