For example the two images, one having rose flower and other having lotus flower are having less similarity than the two images both having rose flowers.
It depends of what you mean with similarity between the images. According to your question: if you have two images in which both images have the same object, e.g., a flower, then the similarity measure should be high otherwise should be low. That is more related to content analysis and classification. In that case, it is better to check some feature extraction techniques such as SIFT or HoG together with classifications methods. Also, you can see works like:
L. Wang, Y. Zhang and J. Feng, "On the Euclidean Distance of Images", IEEE Transactions on Pattern Analysis and Machine Intelligence, 2005, http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=1453520&tag=1
Hope this will be helpful.
You can do so by implementing the imagesimilarityfinder algorithm and various other algorithms. A link to simple algorithm is given below:
http://www.lac.inpe.br/JIPCookbook/6050-howto-compareimages.jsp
Moreover, you can use Matlab for doing so...
I have played around with SSIM, available as part of the SHINE toolbox in Matlab. It can be configured to measure image similarity. Based on
Wang (2004) Image quality assessment: From error visibility to structural similarity
Depends on your use case. Are the images generic, or are they taken under similar lighting conditions and perspectives ? Once I made very good results by custom combing a color distribution algorithm (e.g. by computing a histogram metric) and a shape comparison algorithm ( Haussdorff - Distance, c.f. http://www.cs.cornell.edu/~dph/papers/HKR-TPAMI-93.pdf), but this really depends on your usecase as rotation, different lightning condition, the color space used etc. might spoil this approach
I think it will help you
http://link.springer.com/chapter/10.1007%2F978-1-4471-2458-0_2
You can try with the structural SSIM index (https://ece.uwaterloo.ca/~z70wang/research/ssim/)
A good approach in measuring the similarity between two images is to consider the following steps:
1. select a local region-of-interest in each image (try using imcrop from Matlab to do this). For example, let A, B denoted ROIs in a pair of images.
2. identify the pixel features you want to compare (e.g., try red, blue, green and gradient orientation). Let $\Phi$ be a set of probe functions used to represent pixel features and let $\Phi(x) = (\phi_1(x), ..., \phi_n(x))$ denote a feature vector with n feature values.
3. set up a similarity distance formula:
\begin{align*}
D(A,B) &= inf\{d(\Phi(a),\Phi(b)): a\in A, b\in B\}, \mbox{where}\\
d(\Phi(a),\Phi(b)) = \mathop{\sum}\limits_{i=1}^n |\phi_i(a) - \phi_I(b)|.
\end{align*}
The distance $d(\Phi(a),\Phi(b)) $ is Manhattan (cityblock) distance between a pair of feature vectors. The distance $D(A,B)$ is the Cech distance between the sets of pixels in the two ROIs that you have selected in Step 1.
The "inf" stands for greatest lower bound, which you would implement as "min". In general, "min" is not the same as "inf" but "min" is good enough for your estimate of the similarilty between images. Cheers.
If you have no idea of the structure of your images, you have a priori no feature to extract, you can compute the shape similarity between two images through the Distribution Function Method in 2 dimensions (DFM-2D). It has been applied to images of heart cells of newborn rats in different phases of contraction, and on Time-Frequency Representations (considered as images) of 1D-signals. The theory is explained in the PhD thesis of Barbara Oficjalska (http://tel.archives-ouvertes.fr/tel-00665506) but it is in French. A recalling is in : OFICJALSKA B., RIX H., CHEVALIER E., FAYN J., VARENNE A., Measuring shape variations of ECG waves through Time-Frequency Representations, EUSIPCO’94, Edinburgh, Scotland, U.K., pp. 70-73. http://hal.archives-ouvertes.fr/hal-00545986
I don't know if i understand your question, but if you can match two images (normally measure similarities are used for this) i suggest for you try use SIFT ou SURF. Look this tutorial and the lecture.
http://note.sonots.com/SciSoftware/SIFT.html
http://www.cs.bc.edu/~hjiang/cs390/fit_sift.pdf
It depends of what you mean with similarity between the images. According to your question: if you have two images in which both images have the same object, e.g., a flower, then the similarity measure should be high otherwise should be low. That is more related to content analysis and classification. In that case, it is better to check some feature extraction techniques such as SIFT or HoG together with classifications methods. Also, you can see works like:
L. Wang, Y. Zhang and J. Feng, "On the Euclidean Distance of Images", IEEE Transactions on Pattern Analysis and Machine Intelligence, 2005, http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=1453520&tag=1
Hope this will be helpful.
Why don't you try PHOG (Pyramid Histogram of Oriented Gradients)? You can find the Matlab implementation of it on the net. From my experience this will give you really good an accurate results. In fact over the years we have used PHOG to introduce a Self-Similarity metric to show how self-similar an image is..
Many believe that a good choice of features will define similarity. However, such features cannot anticipate unseen patterns unless the problem is artificial or thoroughly understood. A metric is also necessary, but again there are plenty of images where A is similar to B and B is similar to C, but A is nothing like C which contradicts the triangle inequality implying that such structures cannot be represented in feature space. Methods that avoid the intuitive selection of features and the restrictions of feature spaces are to be favoured.
I have used: aprox 70 quantitative relationship between images pixels evaluated (e.g. balk/white, black /all, grey1/white etc. ) obtaining clusters.
-Golden ratio similarities in one or 1000 images ,musical consonants (e.g. diaton/1/2, diapason2/3, diatesaron , Fibonacci 's numbers etc.
Polygons.
Hi,
I have found GIST to be a good starting place.
http://people.csail.mit.edu/torralba/code/spatialenvelope/
Cheers
edit: Although i don't think it will help distinguish between two type of flowers. For that, this researchers work maybe of interest: http://www.robots.ox.ac.uk/~men/
From a basic viewpoint, two images cannot be directly compared because the structural units of an image (pixels) does not contain sufficient information about its content (unlike words where the arrangements of alphabets do denote the meaning of the word). Hence the general approach is to represent image content in terms of mathematical features (n-dimensional vectors), and then use classifiers (euclidean distance, neural networks etc.) to compare these features in order to get a measure regarding their similarities.
Hi there,
Depending on your application some measures can work better than others. I recommend you to use information-based measures such as entropy or mutual information. Those work so good if you are working with image alignment.
cheers,
I suggest using Kolmogorov complexity. Is compressed lossless two images and comparing the size of the compressed files.
It requires that both images have the same size (number of pixels and colors). The complexity deKolmogorov not calculable, it is an approximation.
See the theory. Cilibrasi, Paul Vitányi http://www.complearn.org/
I'm not such an expert in color/gray image comparison, but Bovik (and that's what we could refer to as an expert) said that "the full reference still-image problem is essentially solved" (using SSIM). [Bovik11, Lissner13]. His conference talk should be online.
[Lissner13] Image difference Prediction: from grayscale to color
[Bovik11] New dimensions in visual quality, presented at EIC
For me the similarity is a mathematical problem. I compare the sounds of speech. But the technique is suitable for the image and all that can be represented in digital form.
The object must be comparable. We must eliminate the differences that we do not want to see action to improve the score. Eg size or color.
I do not know [Bovik11, Lissner13] but only theorists Kolmogorov, Paul Vitányi, Cilibrasi and JP Delahaye.
Cordially
I agree with you all. Mainly I specifically aligned with Benhur Ortiz Jaramillo.
Conceptually, the image similarity can be performed at 4 different levels: the level of pixels, edge level, the level of shapes and content level. I think for the recognition flowers would be better to use the approach at the level of shapes. Surely it would be better on the level of content but would be very expensive computationally.
I think it can be useful to characterize the image into three levels of abstraction:
- primitive features (e.g. colour or shape)
- logical features (e.g. the identity of objects shown) and
- abstract attributes (e.g. the significance of what is depicted in image).
You can also go this way - compute the primitive features characterizing the image content or attributes, such as colour, texture and shape and use it to identify the most closely or similar.
Though image semantic features as in your case would have been better (type of object present in the image) are harder to extract, I will suggest using the right technique. Check this paper ... http://cvcl.mit.edu/sunseminar/rogowitz-scenesemantic.pdf
use peak signal to ratio(PSNR), if you can get the result is infinity then it shows 100% similarity
This depends entirely on how smart you want the algorithm to be.
For instance, here are some issues:
cropped images vs. an uncropped image
images with a text added vs. another without
mirrored images
The easiest and simplest algorithm I've seen for this is just to do the following steps to each image:
scale to something small, like 64x64 or 32x32, disregard aspect ratio, use a combining scaling algorithm instead of nearest pixel
scale the color ranges so that the darkest is black and lightest is white
rotate and flip the image so that the lighest color is top left, and then top-right is next darker, bottom-left is next darker (as far as possible of course)
Edit A combining scaling algorithm is one that when scaling 10 pixels down to one will do it using a function that takes the color of all those 10 pixels and combines them into one. Can be done with algorithms like averaging, mean-value, or more complex ones like bicubic splines.
Then calculate the mean distance pixel-by-pixel between the two images.
To look up a possible match in a database, store the pixel colors as individual columns in the database, index a bunch of them (but not all, unless you use a very small image), and do a query that uses a range for each pixel value, ie. every image where the pixel in the small image is between -5 and +5 of the image you want to look up.
This is easy to implement, and fairly fast to run, but of course won't handle most advanced differences. For that you need much more advanced algorithms.
good luck
I think the correct answer to this question requires understanding one of the "fundamental tricks of intelligence." In substance it is necessary to make explicit all the internal information present within the image, that is to say all the structural features. It is something like the explicitation of all features and all patterns present. Once this is done, you need to select those structural features that are legitimate cognitive subjects: they are the ones that our cerebral cortex flag as "outuput" in each minicolumn dedicated to the recognition of a single "features" in the part of the cortex devoted to vision.
So in essence it is an inherently complex problem.
Please refer to my paper "A New Image Quality Measure" at:
http://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=06567730
Cheers
for the semantic analysis at the beginning of the best solution is to convert images to the same color space, preferably into a YUV, then use clustering method to particular areas of the image, and then compare the entropy of the areas belonging to the cluster. Very good results are obtained by using Kohonen network for clustering image.
You can, after region segmentation, use the jaccard or dice coefficients with prior knowledge about the compared objects
You could try to segment the images and perform shape similarity
on the representative boundaries. You could use the curvature scale space representations for similarity between the curves. The CSS representation is a multiscale organization of the natural,
invariant features of a curve, while being robust with respect to scale, position and orientation changes, as
well as noise and local deformations of shape.
One way is to use Remote Sensing: Supervised and non-supervised classification. Of course, the classification will succeed depending of the resolution quality of both images.
For more information please read:
https://www.cfa.harvard.edu/~xliu/presentations/SRS1_project_report.PDF
What is the objective; at which level you need similarity. Respond first to this question, then obtain your desired representational level, and finally apply any similarity measure; why not also combine them with certain weights.
I think your question includes a lot of the solution. Color: If you as asked to make the distance between two rose images less than between a rose image and another lotus image, then you here depend more on the color of the object of interest.
You have the choice to complete global color of each image and compute the distance between these single values. However, I do not think that this will help, because usually the area of the background is much larger than the object of interest.
So you need to compute some sort of color "spatial" distribution. For example dividing the image into sub-blocks.
Or you may use some segmentation step first to extract the region of interest (ROI). Later apply color-based distance function.
Check:
A Robust Content-Based Image Retrieval System Using Multiple Features Representations
https://www.researchgate.net/publication/216691591_A_Robust_Content-Based_Image_Retrieval_System_Using_Multiple_Features_Representations?ev=prf_pub
Conference Paper A Robust Content-Based Image Retrieval System Using Multiple...
You can use CBIR (Content-Based Image Retrieval) strategies. It consists of feature extractors (algorithms to extract and quantify color, shape, forms, etc.) and similarity functions that measure the distance between two vector of features. A typical example of similarity function is the Euclidean distance.
Cheers
Do not use any algorithm, program or method. First of all you have to define similarity i.e. measure of similarity. Each recognition task has to have defined distance measure before you do anything. Read something about classification theory at first.
This is a difficult question: feature extraction is one solution the other is to use image correlation. Correlation works for signal processing, But the simplest approach is to make an approximation to the first coefficient of correlation
i.e AxB/AxA
where A is the original image and B is the test image.
The closer the answer is to 1 the better the correlation.
Its not perfect, but gives a guide.
I would suggest this publication:
Mohamed A. Tahoun, Khaled A. Nagaty, Taha I. El-Arief, Mohammed A-Megeed, “A Robust Content-based Image Retrieval System Using Multiple Features Representations”, IEEE International Conference on Networking, Sensing and Control(ICNS'05), March 19-22, 2005, Arizona, USA.
http://ieeexplore.ieee.org/xpl/articleDetails.jsp?tp=&arnumber=1461172
This question does not fall into the area of image similarity or image quality . The images you referred to are two dissimilar images as you descibed them, hence finding similarity or image quality is a non-issue. Similarity is calculated between similar image with very little change (possible temperament, compression, or noise). In your case , dissimilarity will be huge.
SSIM is one of the similarity measurement.
https://ece.uwaterloo.ca/~z70wang/research/ssim/
Structural Similarity Index (SSIM) for measuring image quality
http://uk.mathworks.com/help/images/ref/ssim.html
Please refer to my publication list. There are two paper on image quality measures. You will find the answer there.
Prof. Saif alZahir
Parul Saxena: it really depends on how much you know a priori about the pictures and what features are algorithmically identifiable in a fast/accurate enough manner for your application. I would suggest that if you only have a limited amount of computational resources and a limited amount of a priori knowledge of the images' features you use some simple comparison metrics such as normalized compressed distance (a pragmatic derivative from the kolmogorov complexity's USM) and something like Euler characteristics, perimeter length, areas of features, etc. My research group has used the above techniques on a very large variety of applications where images of one kind or another needed to be compared. This was done to very good effect with very little computational expense and without difficult algorithms. Some examples are here:
An Evolutionary Methodology for the Automated Design of Cellular Automaton-based Complex Systems. http://red.cs.nott.ac.uk/~gxk/papers/gztjca2007.pdf
Exploring programmable self-assembly in non-DNA based molecular computing. http://link.springer.com/article/10.1007/s11047-013-9397-2#page-1
A genotype-phenotype-fitness assessment protocol for evolutionary self-assembly Wang tiles design. http://link.springer.com/article/10.1007/s12293-012-0092-0#page-1
Automated probe microscopy via evolutionary optimization at the atomic scale. http://scitation.aip.org/content/aip/journal/apl/98/25/10.1063/1.3600662
Complexity Measurement Based on Information Theory and Kolmogorov Complexity. http://www.mitpressjournals.org/doi/abs/10.1162/ARTL_a_00157#.VcxWa0WAeF4
ProCKSI: a decision support system for Protein (Structure) Comparison, Knowledge, Similarity and Information. http://www.biomedcentral.com/1471-2105/8/416/
A Genetic Algorithm Approach to Probing the Evolution of Self-Organized Nanostructured Systems. http://pubs.acs.org/doi/abs/10.1021/nl070773m
Measuring the similarity of protein structures by means of the universal similarity metric. http://bioinformatics.oxfordjournals.org/content/20/7/1015.short
I hope this helps.
Nat
Two images of the same rose may look quite different. If you have a perfect image recognition tool then both images will map (will be reduced) to the same value, 'rose', with the zero 'similarity difference'.
Structural Similarity Index (SSIM) for measuring image quality
SSIM(x,y)=[l(x,y)]α⋅[c(x,y)]β⋅[s(x,y)]γ
where
l(x,y)=2μxμy+C1μ2x+μ2y+C1,c(x,y)=2σxσy+C2σ2x+σ2y+C2,s(x,y)=σxy+C3σxσy+C3
Following up on David Cardenas' suggestion to use mutual information as a criteria for determining the degree of similarity...here is one sample article (some parts of the document is missing)
Also a paper on the application of image enhancement prior to matching, where the supplied image of low quality is to be authenticated with the same image of higher quality and the use of a Cuckoo search algorithm
https://users.cs.duke.edu/~tomasi/papers/russakoff/russakoffEccv04.pdf
http://ieeexplore.ieee.org/xpl/login.jsp?tp=&arnumber=7060930&url=http%3A%2F%2Fieeexplore.ieee.org%2Fxpls%2Fabs_all.jsp%3Farnumber%3D7060930
So far, many very good answers to this question have been given.
There is a bit more to consider. For example, a recent structured descriptor approach using graph cutting methods in the search for image similarities is given in
https://tel.archives-ouvertes.fr/tel-01154565/document
Multiscale analysis of image similarities is given in
http://www.labri.fr/perso/bugeau/JBAMI14/slides/C_Ballester.pdf
More to the point, an in-depth approach to measuring the spatial correspondence between images is introduced in
http://people.csail.mit.edu/polina/papers/Yeo_PhD_Thesis.pdf
See Section 2.1, starting on page 25, on image registration.
An interesting multi-scale lmage similarity measurei is gvein in
gpi.upf.edu/system/files/biblio-files/92683-mms.pdf
Please have a look at our Image Quality papers posted on my account with research gate. We have introduced: A New Gage for Measuring Image Quality. In this paper we show how to calculate mutual information.
Enjoy
Pattern recognition these days relies on a selection of feature measurements that are thought to perform the necessary distinctions. In addition a body of labelled data is necessary to train the parameters within the classifier. This approach works perfectly if the features are complete and the training data is totally representative. Unfortunately in real probelms this is never the case. Unseen data nearly always contains recognisable patterns that do not contain the chosen features and are not reflected in the training data. To overcome this we are beginning to take an approach that does not use selected features or training data. In the first instance it is applied to a face recognition problem with a 100% result: https://www.ee.ucl.ac.uk/~fstentif/SPIE%202014.pdf
Psychology and physiology give us some insight into the way in which humans derive information from images. We give a brief introduction to some of these theories in a general setting and consider the application to automatic procedures. Distance measures are discussed, with examples, to illustrate some of the difficulties.
I used the template matching of OpenCV in the current study, but I am not sure that is the best for your study. Then, MSE or SSIM are also useful for the similarity.
you may use the Jaccard similarity method :
https://ch.mathworks.com/help/images/ref/jaccard.html
You can compare pixel by pixel of two images. However this is not the statistical method. Several methods are used to compare two images. Very common methods are:
1) PSNR values provides a close idea of about the images.
2) You can apply SSIM of QIUI to compare to two images.
3) Histogram comparison is another methods to find similarities among the images
4) LBP, LTP, LDP, LTrP and GLTrP are famous in classification/comparing image.
You can also use Chi-Square test in finding similarities between two images. It depends on your techniques.
PSNR is a misleading metric as it is based on the average .. Go with Copula method.
You can compare pixel by pixel of two images. However this is not the statistical method. Several methods are used to compare two images. Very common methods are:
1) PSNR values provides a close idea of about the images.
2) You can apply SSIM of QIUI to compare to two images.
3) Histogram comparison is another methods to find similarities among the images
4) LBP, LTP, LDP, LTrP and GLTrP are famous in classification/comparing image.
You can also use Chi-Square test in finding similarities between two images. It depends on your techniques.
One approach would be to create integral images for each image and then compare regions based on average intensities/colours etc .. You could use chi-sq testing on a pixel by pixel basis (or on the integral versions for less resolution). Or if you are feeling more adventurous, build a number of classifiers for such things as edges, arcs, and blobs and iterate over both images and compare how many features match. Processing time, power usage etc etc will all be a major deciding factor on which approach you go with.
Another really old school technique would be to normalise not images then XOR them.. the bits that remain will be those that change. Useful technique if employed properly for rapid feature extraction prior to processing with ML/Haar algorithms etc etc.
You could use a pre-trained convolutional neural network like one of those https://pytorch.org/docs/stable/torchvision/models.html and remove the part of the network which is responsible for classification. Hence, the output will be a vector, i.e. a vector describing the input image. The vectors from two images can then be compared using cosine similarity, for example.
In generally two types of measurements are used widely for comparing, matching, recognizing etc. They are :
There are many algorithms like feature detection, texture descriptor, region analysis, corner detection for measuring the above two properties. These algorithms are rotation, reflection invariant so that anyone can measure perfectly. You can try this techniques if you want to measure similarity without any data .
In order to measure the similarity between two images, either the distance metrics or distance measures can be used according to your requirements and the nature of the image data. The distance metrics yield cent per cent perfect results (if there exists same image only) because it measures the similarity point-to-point; in this method the are many possibilities of wrong comparison even if there exists little bit dissimilarity between two images. So that it is better to use similarity measures (statistical distribution-based), it returns the exact same image and similar images. There are some more other methods; one of the ways is to extract features using feature extraction method and then the metric could be used which yields better results.
You can see our work:
1. Modeling of biologically motivated self-learning equivalent-convolutional recurrent-multilayer neural structures (BLM_SL_EC_RMNS) for image fragments clustering and recognition
2. Моделювання методів розпізнавання та класифікації фрагментів кольорових зображень земель сільськогосподарського призначення при їх дистанційному моніторингу
A recent work is very exciting about comparing images like a human instead of the weak traditional statistical methods:
The Unreasonable Effectiveness of Deep Networks as a Perceptual Metric
https://richzhang.github.io/PerceptualSimilarity/
A short, interesting 2-minute video on youtube about this paper:
https://www.youtube.com/watch?v=DglrYx9F3UU
The following links may be useful for you. Refer these :
https://pdfs.semanticscholar.org/23dd/88b909182a8a69848e5476c3d76e014fb97d.pdf
http://web.mit.edu/sinhalab/Papers/sinha_russell2011.pdf
That is depending on your work, some times, some similarty measures can work better than others such as correlation, SSIM, UQI, mutual information, RMSE, and so on
Similarity between two images can be measured using following techniques:
1. Euclidean distance or Cosine similarity measure - gives minimum distance for best match
2. Image subtraction - result is almost zero for perfect match
3. Correlation study - correlation result is '1' for best match
You can take a pre-trained CNN from the ImageNet and remove all or the last few fully-connected layers. For comparing 2 images, do a forward pass on this modified CNN and compare their output layers using a metric like euclidean distance or cosine similarity.
Dear Parul
I suggest you to find suitable statistical features.
Please review this article:
" A new approach for rotation-invariant and noise-resistant texture analysis and classification, April 2018, Machine Vision and Applications 29(6):455-466 "
dear
this is depending on your work there are many measures to evaluate the similarity such as: Euclidean distance or Cosine to measure the difference between the images. also, you can use Correlation, PSNR,MSE and SSIM.
first of all, the term 'similar' should be defined. if your mean, two images are same in terms of the content, correlation is the best measure.
Of course correlation should be used locally to provide higher detection rate.
It depends on what you are trying to do, I mean, if the task corresponds to know if two images are exactly the same or to identify the type of object. In the first case, you could use metrics such as SSIM, PSNR. In the second case, feature extraction algorithms and classification models could be useful in order to recognize the type of object into the image.
In my opinion, the following article may be useful for solving the question posed:
1, Brief Citation: Vladimir G. Krasilenko, Aleksandr I. Nikolskyy, Yuriy A. Bozniak, "Recognition algorithms of multilevel images of multicharacter identification objects based on nonlinear equivalent metrics and analysis of experimental data", Proceedings of SPIE Vol. 4731, (2002) SPIE Digital Library
You can find the Structural Similarity Index (SSIM) of the image A with a reference image using this function:
Sim-value = ssim(A,ref);
You can also use the correlation algorithm and if you are working with matlab there are several codes for feature matching, which give you the exact similarity between images using their features.
Please take a look the below link.
https://stackoverflow.com/questions/843972/image-comparison-fast-algorithm
Hope it helps.
You can also use the correlation algorithm and if you working with matlab there are several codes for feature matching, which give you the exact similarity between images.
One way is to use a feature detection such as sift. With this information. it is posible to detect similarities or disimiliraties.
I do not agree with Shervan Fekri Ershad , since in many cases for comparing two images of the same content, nonlinear nonequivalence spatial functions and MAED are better than correlation. And the connection between them is shown in our works, about which I already wrote earlier.
The similarity between two images is mathematically computed using specific functions, Researchers have used different objective measurements to evaluate similarity, such as the root mean square (RMS) maximum RMS signal-to-noise ratio (RMS), signal to noise ratio(SNR), correlation factor (CF) and Hausdorff distance (HD)
Basically, any distance metric such as Euclidean distance can be used to obtain the similarity between two images.
a distance or a similarity measure could be used between the vectors of features of images. More information can be found in this article :
https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=7007988
I have same questions. In my case, it was useful to evaluate the similarity with MSE, PSNR, Template matching, SIFT, SSIM, and CNN.
to calculate the similarity between document dj and query q we use the formula: cos (dj, q)
cos (dj, q) = (dj x q) / l dj l. l q l = [som (wij x wiq)] / [square root of (som wij²) x square root of (som wiq²)]
N.B: dj and q in arrow vector.
If the two images are binary, then "Dice" similarity coefficient and "Jaccard" similarity coefficient are good measures.
If two images are in colour you can also use F1 score measure. Example in matlab is available:
https://www.mathworks.com/help/images/ref/bfscore.html
Depending on your problem..but I advise you to implement one of the feature extraction methods such as PCA then measure the distance between features of each image to find the similarity between them.
Hello Parul Saxena ,
Take a look here: Article Similarity of Color Images
I hope it helps
According to my understanding of your question, you mean the comparison at the level of the whole image or pixels