Programmatically create histograms like Color Thresholder

조회 수: 5 (최근 30일)
Jason Butler
Jason Butler 2022년 11월 16일
편집: DGM 2025년 5월 10일
How can I programaticlly in Matlab code create image histograms that look like the ones in Color Thresholder? I don't want to launch Color Thresholder from the Matlab prompt. I want to generate my own histograms that looks like the ones in Color Thresholder. Ideally I would like to create this identical histogram in a script without having to manually open Color Thresholder, load my image, and then switch to YCbCr.

답변 (2개)

Image Analyst
Image Analyst 2022년 11월 16일
See attached demo. Adapt as needed. You can use bar() instead of plot() to make histograms like those.
  댓글 수: 2
Jiang Karen
Jiang Karen 2025년 5월 9일
How can I get that gradient fill? I hope you can answer. Thank you.
Image Analyst
Image Analyst 2025년 5월 9일
I don't know off the top of my head if that is possible. I'd have to research it, which you can do just as well as me.

댓글을 달려면 로그인하십시오.


DGM
DGM 2025년 5월 10일
편집: DGM 2025년 5월 10일
In this answer I give a couple ways to create colorcoded histograms for multichannel images the long way. In the comments, I describe a third party tool that will simplify the task of figure setup and colormap generation for most colorspaces you might be trying to use.
One of the comments also covers the difference between the way I generated axis-aligned colormaps for YCbCr, compared to the way that the Color Threshold app represents them. So if you really want to replicate that specific set of fill colors, you can.

카테고리

Help CenterFile Exchange에서 Histograms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by