adjust brightness of an image with respect to another image.

5 ビュー (過去 30 日間)
Elad
Elad 2012 年 6 月 14 日
編集済み: px1313 2017 年 5 月 2 日
Is there some automatic function for that, something like imregister only to equalize the brightness between two images ? Thanks.

回答 (3 件)

Walter Roberson
Walter Roberson 2012 年 6 月 15 日
The below might not look like it makes the brightnesses of the images the same, but mathematically it does the job, provided that you do not get saturation.
b1 = mean2(rgb2gray(Image1));
b2 = mean2(rgb2gray(Image2));
NewImage2 = Image2 + (b1-b2);
  1 件のコメント
Elad
Elad 2012 年 6 月 17 日
Thanks, unfortunatly that does not work well in my case. perhaps I need some local equalization between the images, the algorithm by Mark Grundland and Neil A. Dodgson that Image Analyst suggested might work.

サインインしてコメントする。


Image Analyst
Image Analyst 2012 年 6 月 17 日
For the ultimate in histogram matching of grayscale images, see my histogram matching/shaping routine. http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862 You can't do better since it will provide as exact a match as is theoretically possible. (It's only slightly inexact when the image sizes are different, for obvious reasons. Ask if you don't know why.)
For a color image, I think the algorithm by Mark Grundland and Neil A. Dodgson is possibly the best algorithm out there: http://www.eyemaginary.com/Portfolio/ColorHistogramWarp.html
  4 件のコメント
Thang  Le
Thang Le 2016 年 2 月 25 日
Sorry for digging up an old post. I've looked at the custom-shaped histogram package and I'm not sure how to equalize the brightness and contrast across multiple images. I have 160 images with different levels of brightness and contrast and I would like to create a set of new 160 images from these with the same level of brightness and contrast. Image Analyst, could you help?
Image Analyst
Image Analyst 2016 年 2 月 26 日
Try using imhistmatch() in a loop.

サインインしてコメントする。


px1313
px1313 2017 年 5 月 2 日
編集済み: px1313 2017 年 5 月 2 日
I would like to ask you if imhistmatch() have worked for your 160 images with different levels of brightness and contrast. I have same problem to solve.

Community Treasure Hunt

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

Start Hunting!

Translated by