# How to calculate the distance between two objects/points?

The objects or points in this scenario are videos. Each video is represented by a set of features (suppose 10). Now if we have two videos that we need to calculate euclidean distance between them, it is pretty clear for me how to do it. But if the features for the video were generated on multiple levels instead of just one, i.e instead of generating the features for the whole duration of the video, we do it in several parts, like we divide the video into 4 parts (quarters) according to its duration and generate the features for those 4 parts/segments.

ps: The dividing of a video according to its duration is just an example for the sake of clarity of this question, but in reality it is divided according to some other criteria that could result for one video to be segmented into 3 parts and another one into 4 parts.

Now the question, if the video was represented in the above explained format, what is the best way to calculate the distance (euclidean etc.) between two videos given that not all videos have same number of parts/segments ?

My ideas included:

• If the two videos have unbalanced number of segments, only compare the common segments. (This would imply losing a lot of data)
• If video1 has n segments and video2 has m segments, the comparison would be: for every i in n compare it to every j in m. (This maybe computationally complex)

I'd appreciate all help, like referral to an article, paper, section in some book, or simply your informed answer.

• Why extract features? How about representing each frame of each video as a matrix of pixels and then each video as a tensor? You can then use a tensor norm to compare them. – user0 Jun 23 '17 at 15:34
• The aim is to identify and categorize videos based on their content, be it audio, video, metadata, transcripts... – Hasan J Jun 24 '17 at 13:21