필터 지우기
필터 지우기

Brightness of two images

조회 수: 4 (최근 30일)
Efstathios Kontolatis
Efstathios Kontolatis 2016년 10월 10일
댓글: Image Analyst 2016년 10월 10일
I have two images. The one which is correct is brighter at the center of the image and darker at the limits. The other one is the opposite. I want to change the brightness in a way that the second image would be brighter at the center and darker at the limits. Is there a way to do so?
Thanks
  댓글 수: 1
Image Analyst
Image Analyst 2016년 10월 10일
I'm adding the images that were posted later (in a comment to Massimo) so they'll be at the top of this discussion:

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

답변 (2개)

Massimo Zanetti
Massimo Zanetti 2016년 10월 10일
편집: Massimo Zanetti 2016년 10월 10일
If the second image (call it A) has values between [0,1], just consider B=1-A; This one has opposite brightness. If A is 8-bit, consider B=255-A, etc for other image depths.
  댓글 수: 14
Massimo Zanetti
Massimo Zanetti 2016년 10월 10일
편집: Massimo Zanetti 2016년 10월 10일
Stretching doesn't mean resizing image. Image stretching is technique to increase contrast (visibility) in image (very roughly speaking...):
Efstathios Kontolatis
Efstathios Kontolatis 2016년 10월 10일
That's the image I take with imadjust(A2,stretchlim(A2),[]). Still not what I want to do

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


Image Analyst
Image Analyst 2016년 10월 10일
Yes. You can multiply it by some function, like a Gaussian or quadratic or something. Use meshgrid() to create X and Y arrays,
[rows, columns, numberOfColorChannels] = size(originalImage);
[X, Y] = meshgrid(1:columns, 1:rows);
then calculate z = f(X, Y) according to some function, then
brightImage = originalImage .* z;
imshow(brightImage, []);
  댓글 수: 2
Efstathios Kontolatis
Efstathios Kontolatis 2016년 10월 10일
Thanks. Is there a way to find brightness distribution of the first image and then apply it to the second image(I want to do it for a series of images so I cannot check it one by one)?
Image Analyst
Image Analyst 2016년 10월 10일
Try imadjust() or imhistmatch().

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

Community Treasure Hunt

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

Start Hunting!

Translated by