Euclidian Norm and Brightness between 2 images

I really appreciate your help and I would be soo grateful if you help me with this?, I have two questions...
How to calculate these two equations if I have two images(RGB)as an input,
1- Euclidian Norm between 2 images, the equation is shown below:
[this measure is used to find the set of the closest palette color in Euclidian norm]
d= sqrt ( (R1-R2)^2 + (G1-G2)^2 + (B1-B2)^2 );
2- Brightness between 2 images, the equation is shown below:
[Brightness information, which measures the brightness of the cover image and the Stego image and compute the difference between the brightness of the cover image and the brightness of the Stego image, this is done by measuring the length of the RGB vector for both cover and Stego images. The calculation is done according to the following
formula:]
L= sqrt (R^2 + G^2 + B^) ;

1 commentaire

hi i want to ask something related to the above question.
i want to calculate difference matrix between two rgb images by applying the euclidean distance formula on them,and the difference matrix should also be an image.is it possible?
Actually i have to use that matrix for further operation to generate reference background image of my frame sequence.please help me with this.i am truely in need.thanks

Connectez-vous pour commenter.

 Réponse acceptée

Junaid
Junaid le 6 Fév 2012
then I guess for L you can do following.
R1 = R1(:); R2 = R2(:);
G1 = G1(:); G2 = G2(:);
B1 = B1(:); B2 = B2(:);
L1 = sqrt(sum(double((R1.^2 + G1.^2 + B1.^2)))) ;
L2 = sqrt(sum(double((R2.^2 + G2.^2 + B2.^2)))) ;

7 commentaires

Hamsah
Hamsah le 7 Fév 2012
Déplacé(e) : DGM le 20 Fév 2023
Perfect, Thank you so much...
Junaid
Junaid le 7 Fév 2012
Déplacé(e) : DGM le 20 Fév 2023
if it is exactly what you wanted then please accept the answer so that other might know about it :-)
Hamsah
Hamsah le 7 Fév 2012
Déplacé(e) : DGM le 20 Fév 2023
sure accepted
Junaid
Junaid le 7 Fév 2012
Déplacé(e) : DGM le 20 Fév 2023
:-) Thanks.. usually the answer which fulfill the question is accepted ;).
Hamsah
Hamsah le 7 Fév 2012
Déplacé(e) : DGM le 20 Fév 2023
Sorry i didn't know this is my first time...
Junaid
Junaid le 7 Fév 2012
Déplacé(e) : DGM le 20 Fév 2023
that is all right :-)
Takeoff Groups
Takeoff Groups le 21 Mar 2018
Déplacé(e) : DGM le 20 Fév 2023
superb

Connectez-vous pour commenter.

Plus de réponses (2)

Junaid
Junaid le 6 Fév 2012
Modifié(e) : Jan le 18 Mai 2018
You question is not quite clear, if you take the Euclidean norm between two images, then the formula you have written would return a matrix. I guess you want to get euclidean norm between two images as one scalar number right ? If so then based on your formula I have written code in steps.
Let A, and B be the two RGB images with same dimensions.
R1 = A(:,:,1); R2 = B(:,:,1);
G1 = A(:,:,2); G2 = B(:,:,2);
B1 = A(:,:,3); B2 = B(:,:,3);
s = (R1-R2).^2+(G1-G2).^2+(B1-B2).^2;
s = s(:);
d= sqrt(sum(s)); % this is euclidean norm
As your formula for Brightness can be computed as follow
L = sqrt(double((R1.^2 + G1.^2 + B1.^2))) ;
Here L is the Brightness of image 1 by your formula, it is Matrix. I m not very clear about your formula.
[EDITED, typo fixed: G1/2 and B1/2 inserted]

1 commentaire

Hamsah
Hamsah le 6 Fév 2012
Thankx alot for the first equation. but for the brightness equation i also want a scalar number, sorry for not being clear because im new on these equations.

Connectez-vous pour commenter.

Walter Roberson
Walter Roberson le 5 Fév 2012

0 votes

Hint: X.^2 instead of X^2

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by