vector calculation to compare the image