calculate the similarity function using the framework in the paper
the function has someproblem in reading large video file.