Comparing 2 images intensities

8 vues (au cours des 30 derniers jours)
Ramo
Ramo le 6 Fév 2014
Modifié(e) : Ramo le 13 Fév 2014
down votefavorite
I have two images 1 and 2. I want to get the v (intensity) value of the hsv images; then I want the v (intensity) value of the first image equal to v (intesity) value of the second image?
I used this code to get the v;
v = image1(:, :, 3);
u = image2(:, :, 3);
How do I make both u and v the same value?
Thanks

Réponses (2)

Jeff E
Jeff E le 6 Fév 2014
The code below will take the hue and saturation values from image1, and the value from image2, and merge them into one new image. Said another way, you are replacing the V signal from image1 with the V signal from image2.
new_image1 = cat(3, image1(:,:,1) , image1(:,:,2), image2(:,:,3));
Your last question "How do I make both u and v the same value?" doesn't make sense, to me.
  1 commentaire
Ramo
Ramo le 8 Fév 2014
Its because i had two images of the same scene that are taken at different times, therefore the two images will have different intensities. So now i want to equalise their intesities so they look the same.

Connectez-vous pour commenter.


Image Analyst
Image Analyst le 8 Fév 2014
Try something like this:
hsv1 = rgb2hsv(rgbImage1); % Convert to hsv color space.
hsv2 = rgb2hsv(rgbImage2); % Convert to hsv color space.
hsvOut = hsv1; % Initialize output array.
hsvOut(:,:,3) = hsv2(:,:,3); % Replace intensity of 1 with 2
rgbOut = rgb2hsv(hsvOut); % convert back to rgb color space.
  7 commentaires
Image Analyst
Image Analyst le 13 Fév 2014
So are we done here? If so, please mark my answer as Accepted. Thanks.
Ramo
Ramo le 13 Fév 2014
Modifié(e) : Ramo le 13 Fév 2014
Your code didn't work though. however i voted you!

Connectez-vous pour commenter.

Catégories

En savoir plus sur Convert Image Type dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by