
--- binary mask map test.py
+++ binary mask map test.py
... | ... | @@ -40,8 +40,11 @@ |
40 | 40 |
def process(i, j): |
41 | 41 |
print(i) |
42 | 42 |
clean_img_copy = shift_img(clean_img, (i-k)/4, (j-k)/4) |
43 |
- binary_diff_mask_img = binary_diff_mask(dirty_img / 255, clean_img_copy / 255, threshold=0.2) |
|
44 |
- cv2.imwrite(f"test/test_img{(i-k)/4}-{(j-k)/4}.png", binary_diff_mask_img*255) |
|
43 |
+ binary_diff_mask_img = binary_diff_mask(dirty_img / 255, clean_img_copy / 255, threshold=0.3) |
|
44 |
+ success = cv2.imwrite(f"test/test_img_x{(i-k)/4}-y{(j-k)/4}.png", binary_diff_mask_img*255) |
|
45 |
+ if not success: |
|
46 |
+ print(f"Failed to save image at test/test_img{(i - k) / 4}-{(j - k) / 4}.png") |
|
47 |
+ |
|
45 | 48 |
|
46 | 49 |
with concurrent.futures.ProcessPoolExecutor() as executor: |
47 | 50 |
for i in range(k*2): |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?