before_gray = cv2.cvtColor(test_img, cv2.COLOR_BGR2GRAY)
after_gray = cv2.cvtColor(resized_img, cv2.COLOR_BGR2GRAY)
ssim_measures[img_path]= structural_similarity(before_gray, after_gray)
The difference between dataset/1031.png and the original image is :
(1.0, array([[1., 1., 1., ..., 1., 1., 1.],
[1., 1., 1., ..., 1., 1., 1.],
[1., 1., 1., ..., 1., 1., 1.],
...,
[1., 1., 1., ..., 1., 1., 1.],
[1., 1., 1., ..., 1., 1., 1.],
[1., 1., 1., ..., 1., 1., 1.]]))
The difference between dataset/1032.png and the original image is :
(0.39463490206448315, array([[0.96390728, 0.96390728, 0.96390728, ..., 0.94935428, 0.95422955,
0.96262072],
[0.96390728, 0.96390728, 0.96390728, ..., 0.95037674, 0.95556306,
0.96262072],
[0.96542089, 0.96542089, 0.96542089, ..., 0.95159068, 0.95631448,
0.96284907],
...,
[0.88780272, 0.88945048, 0.8959446 , ..., 0.12923806, 0.1293358 ,
0.12989893],
[0.91285562, 0.91285562, 0.916443 , ..., 0.12964783, 0.12972166,
0.13018334],
[0.93115689, 0.93115689, 0.93379464, ..., 0.12997426, 0.1300723 ,
0.13053634]]))
The difference between dataset/1033.png and the original image is :
(0.339799953965668, array([[0.07601922, 0.07601922, 0.07601922, ..., 0.05381174, 0.05381174,
0.05381174],
[0.07601922, 0.07601922, 0.07601922, ..., 0.05381174, 0.05381174,
0.05381174],
[0.07601922, 0.07601922, 0.07601922, ..., 0.05381174, 0.05381174,
0.05381174],
...,
[0.87094943, 0.87094943, 0.87094943, ..., 0.20371599, 0.20371599,
0.20371599],
[0.87094943, 0.87094943, 0.87094943, ..., 0.20371599, 0.20371599,
0.20371599],
[0.87094943, 0.87094943, 0.87094943, ..., 0.20371599, 0.20371599,
0.20371599]]))
The closest value: (1.0, array([[1., 1., 1., ..., 1., 1., 1.],
[1., 1., 1., ..., 1., 1., 1.],
[1., 1., 1., ..., 1., 1., 1.],
...,
[1., 1., 1., ..., 1., 1., 1.],
[1., 1., 1., ..., 1., 1., 1.],
[1., 1., 1., ..., 1., 1., 1.]]))
######################################################################
The most similar according to SSIM: {'dataset/1031.png': (1.0, array([[1., 1., 1., ..., 1., 1., 1.],
[1., 1., 1., ..., 1., 1., 1.],
[1., 1., 1., ..., 1., 1., 1.],
...,
[1., 1., 1., ..., 1., 1., 1.],
[1., 1., 1., ..., 1., 1., 1.],
[1., 1., 1., ..., 1., 1., 1.]]))}