Brightness of two images
1 次查看(过去 30 天)
显示 更早的评论
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
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
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
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...):
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, []);
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!