File tree 1 file changed +1
-12
lines changed 1 file changed +1
-12
lines changed Original file line number Diff line number Diff line change @@ -254,22 +254,11 @@ def calculate_rms(expectedImage, actualImage):
254
254
raise ImageComparisonFailure (
255
255
"image sizes do not match expected size: {0} "
256
256
"actual size {1}" .format (expectedImage .shape , actualImage .shape ))
257
-
258
257
num_values = np .prod (expectedImage .shape )
259
258
abs_diff_image = abs (expectedImage - actualImage )
260
-
261
- # On Numpy 1.6, we can use bincount with minlength, which is much
262
- # faster than using histogram
263
- expected_version = version .LooseVersion ("1.6" )
264
- found_version = version .LooseVersion (np .__version__ )
265
- if found_version >= expected_version :
266
- histogram = np .bincount (abs_diff_image .ravel (), minlength = 256 )
267
- else :
268
- histogram = np .histogram (abs_diff_image , bins = np .arange (257 ))[0 ]
269
-
259
+ histogram = np .bincount (abs_diff_image .ravel (), minlength = 256 )
270
260
sum_of_squares = np .sum (histogram * np .arange (len (histogram )) ** 2 )
271
261
rms = np .sqrt (float (sum_of_squares ) / num_values )
272
-
273
262
return rms
274
263
275
264
You can’t perform that action at this time.
0 commit comments