(actual_path, actual_image, expected_path, expected_image)
| 370 | |
| 371 | |
| 372 | def crop_to_same(actual_path, actual_image, expected_path, expected_image): |
| 373 | # clip the images to the same size -- this is useful only when |
| 374 | # comparing eps to pdf |
| 375 | if actual_path[-7:-4] == 'eps' and expected_path[-7:-4] == 'pdf': |
| 376 | aw, ah, ad = actual_image.shape |
| 377 | ew, eh, ed = expected_image.shape |
| 378 | actual_image = actual_image[int(aw / 2 - ew / 2):int( |
| 379 | aw / 2 + ew / 2), int(ah / 2 - eh / 2):int(ah / 2 + eh / 2)] |
| 380 | return actual_image, expected_image |
| 381 | |
| 382 | |
| 383 | def calculate_rms(expected_image, actual_image): |
no outgoing calls
no test coverage detected
searching dependent graphs…