Merge two images without light effect

1 次查看(过去 30 天)
Dear all,
Let say I take two pictures without moving the camera with the difference of few sec. Image 1 is denoted as img1, and Image 2 is denoted as img2. Now I want to concatenate the first half of image with the second half of the image.
img2 (:,1: size(img2,2)/2,:) = img1(:, 1: size(img1,2)/2,:);
There is no problem in exection. However, these two images have light effect though take with the time difference of few seconds. What image processing task should be taken to neutralize the light effect.
  2 个评论
Walter Roberson
Walter Roberson 2016-4-25
Your line
img2 (:,1: size(img2,2),:) = img1(:, 1: size(img1,2),:);
does not concatenate. 1: size(img,2) is the same as 1:end when used in the second dimension of img2, and that in turn is the same as just using : . So you have the equivalent of
img2(:,:,:) = img1(:,:,:);
If you want to concatenate use
[img1, img2]
Aravin
Aravin 2016-4-25
Thank you Walter. Half of the image should be concatenated. I forgot to divide by 2.

请先登录,再进行评论。

回答(1 个)

Image Analyst
Image Analyst 2016-4-25
If the image brightness at the same part of the image changed as you moved the camera, either due to the lighting changing during that time, or due to shading in the camera (primarily due to the lens), then the overlap region, which you averaged together during the compositing process, may show brightness differences or noticeable edges where it goes from two images to 1 image. So you will have to have a mask to somehow adjust the intensity of one of the images, and you may need to adjust it spatially, like "feather" the intensity so you do not have noticeable edges or sharp intensity discontinuities.

Community Treasure Hunt

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

Start Hunting!

Translated by