Histeq in old version worked with RGB

조회 수: 6 (최근 30일)
Jürgen
Jürgen 2012년 5월 13일
편집: Image Analyst 2019년 3월 4일
Hi,
I am reusing some old code from a research project we did years ago, I used 'ImageEq=histeq(ImageOrg, counts)'
Now I noticed that histeq does not accepted RGB while it was no problem in the older version, so Did older version of Matlab accept RGB-images for the function histeq? and if yes, how did that work because it should act than on one of the three matrices ( R, G or B)?
thank for your help , regards J
  댓글 수: 1
bdcxns
bdcxns 2019년 3월 4일
편집: Image Analyst 2019년 3월 4일
Your question has been here for several years, but I am curious about this, since there is no information on how Matlab implement the histeq on color images (in 2017a as I am using), until I tried out different possible ways.
It is actually reshape(histeq(rgbimage(:)),size(rgbimage)). For rgbimage being a colour image in rgb.

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

채택된 답변

Image Analyst
Image Analyst 2012년 5월 13일
If it did it, it either did it on each color channel independently, which would give color artifacts, or it converted to hsv and did it on the v channel, which would not give artifacts. However, in general, histogram equalization rarely gives nice looking images because of the non-linear mapping of the gray levels which makes the images look unnatural. Why do you think you want to use it, say, as opposed to a normal, linear contrast stretch?

추가 답변 (2개)

Jürgen
Jürgen 2012년 5월 13일
well it gave good results in the image we processed (image were completely dark due too low light condition, after histeq I was able to extract the white objects, so I think a linear mapping is not ideal, I am interested in making the dark values lighter,
  댓글 수: 1
Image Analyst
Image Analyst 2012년 5월 13일
Histogram equalization is not needed at all to do extraction. It only brightens things up, but you can still threshold and extract the white objects just fine with the original image, it's just that the threshold is at a different level but the end result is identical. Unless you need it for some reason for visual purposes (or curiosity) you're just spending more time than necessary doing something that is not at all needed.

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


Jürgen
Jürgen 2012년 5월 14일
Ok, that's true, thanks for your interesting input, but I need to compare the results of the results of algorithm with visual interpretation: The objects in the image are multi exposed and I need to connect the different exposures of the same object, to check if the algorithm did it right I need to see the object, and then the histogram equalization is useful no?
  댓글 수: 2
Image Analyst
Image Analyst 2012년 5월 14일
It could work, but like I said it usually doesn't produce images as natural looking as if you had just done a linear contrast stretch, like you'd get with imadjust(). By the way, you should have put this as a "Comment on this Answer" rather than an original "Answer" to your question.
Jürgen
Jürgen 2012년 5월 14일
ok thanks, indeed this time I used comment

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

Community Treasure Hunt

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

Start Hunting!

Translated by