MATLAB Answers

How do i compare vectors of images of same object that I have run through Alexnet using Euclidean Distance against other non object images

3 views (last 30 days)
I have just over 200(208 to be precise)different images of the same object that I have run through Alexnet and extracted the Fc6 layer data containing the image vector values (208x4096) for each of them and stored them as .dat files in a folder named fc6. I have also done the same with random similar images but none of which contain the object found in the original folder of images. I need to try to produce the Euclidean distance of each of the object images against each of the other object images (approx just over 43,000 comparisons). After this I need to run another Euclidean distance calc between each object image and each non object image's vector values. Im fairly new to Matlab and dont quite know how to write this in the command line to get the results Im looking for, I have seen code with the Euclidean distance formula eg: Dist = sqrt(sum((image1(:) - image2(:)) .^ 2)), and I believe this will get the distance between two images but is there certain values I have to enter between the bracketed colons? and how can i do this for multiple vectors, problem being is, I dont quite know how to let Matlab know which values i wish to calculate between and then find a way to see if the object images distances are significant shorter than the Object v Non-Object images. thank you in advance of any help you can give me.

  0 Comments

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 23 Mar 2018
"is there certain values I have to enter between the bracketed colons?" No, it's fine as you have it.
You can even use immse(), a built in function.
"how can i do this for multiple vectors" You just put the calculation in a loop and index dist:
Dist(k) = sqrt(immse(image1, image2));

More Answers (0)


Translated by