Merge two images without light effect

1 vue (au cours des 30 derniers jours)
Aravin
Aravin le 25 Avr 2016
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 commentaires
Walter Roberson
Walter Roberson le 25 Avr 2016
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 le 25 Avr 2016
Thank you Walter. Half of the image should be concatenated. I forgot to divide by 2.

Connectez-vous pour commenter.

Réponses (1)

Image Analyst
Image Analyst le 25 Avr 2016
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