Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Commit

Permalink
MVP
Browse files Browse the repository at this point in the history
  • Loading branch information
lucetre committed Dec 9, 2021
1 parent 407c2d2 commit ba8b647
Show file tree
Hide file tree
Showing 48 changed files with 153 additions and 140 deletions.
Binary file removed images_to_crop.png
Binary file not shown.
Binary file modified impl/images_to_crop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
262 changes: 137 additions & 125 deletions impl/main.ipynb

Large diffs are not rendered by default.

31 changes: 16 additions & 15 deletions impl/post_process/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def CropImage(im, imReference, tolerance=100):
ax[1].imshow(imReference)
ax[1].scatter(vimReference[:,0], vimReference[:,1], marker='x', c='red', s=200, linewidth=3)
plt.tight_layout()
plt.savefig('images_to_crop.png', dpi=300)
plt.savefig('images_to_crop.png', dpi=300, bbox_inches="tight")
plt.close()

H, _ = cv2.findHomography(vim, vimReference)
Expand Down Expand Up @@ -178,20 +178,21 @@ def main(source, target, clean, resultdir, tol=100):
tar = cv2.cvtColor(tar, cv2.COLOR_BGR2RGB)

plt.close()
fig, ax = plt.subplots(ncols=3, figsize=(15, 10))
print(f' Source\tMSE: {mse_src:.2f}\tPSNR: {psnr_src:.2f}\tSSIM: {ssim_src:.2f}')
ax[0].imshow(src), ax[0].set_title('Source')
ax[1].imshow(tar), ax[1].set_title('Target')
ax[2].imshow(diff_src, cmap='gray', vmin=0, vmax=255), ax[2].set_title('Difference')
plt.tight_layout()
plt.savefig(os.path.join(resultdir, 'source_result.pdf'), bbox_inches="tight")

plt.close()
fig, ax = plt.subplots(ncols=3, figsize=(15, 10))
print(f' Clear\tMSE: {mse_cle:.2f}\tPSNR: {psnr_cle:.2f}\tSSIM: {ssim_cle:.2f}')
ax[0].imshow(cle), ax[0].set_title('Clean')
ax[1].imshow(tar), ax[1].set_title('Target')
ax[2].imshow(diff_cle, cmap='gray', vmin=0, vmax=255), ax[2].set_title('Difference')
fig, ax = plt.subplots(ncols=4, figsize=(15, 10))
ax[0].imshow(src)
ax[1].imshow(cle)
ax[2].imshow(tar)
ax[3].imshow(diff_cle, cmap='gray', vmin=0, vmax=255)

ax[0].set_title('Source')
ax[1].set_title('Clean')
ax[2].set_title('Target')
ax[3].set_title('Difference')

plt.tight_layout()
plt.savefig(os.path.join(resultdir, 'clean_result.pdf'), bbox_inches="tight")
plt.savefig(os.path.join(resultdir, 'result.pdf'), bbox_inches="tight")

print(f' Source\tMSE: {mse_src:.2f}\tPSNR: {psnr_src:.2f}\tSSIM: {ssim_src:.2f}')
print(f' Clean\tMSE: {mse_cle:.2f}\tPSNR: {psnr_cle:.2f}\tSSIM: {ssim_cle:.2f}')

Binary file removed output.png
Binary file not shown.
Binary file removed result/graph_desktop/clean_result.pdf
Binary file not shown.
Binary file added result/graph_desktop/result.pdf
Binary file not shown.
Binary file removed result/graph_desktop/source_result.pdf
Binary file not shown.
Binary file removed result/graph_laptop/clean_result.pdf
Binary file not shown.
Binary file added result/graph_laptop/result.pdf
Binary file not shown.
Binary file removed result/graph_laptop/source_result.pdf
Binary file not shown.
Binary file removed result/intro_desktop/clean_result.pdf
Binary file not shown.
Binary file added result/intro_desktop/result.pdf
Binary file not shown.
Binary file removed result/intro_desktop/source_result.pdf
Binary file not shown.
Binary file removed result/intro_laptop/clean_result.pdf
Binary file not shown.
Binary file added result/intro_laptop/result.pdf
Binary file not shown.
Binary file removed result/intro_laptop/source_result.pdf
Binary file not shown.
Binary file removed result/lecture_desktop/clean_result.pdf
Binary file not shown.
Binary file added result/lecture_desktop/result.pdf
Binary file not shown.
Binary file removed result/lecture_desktop/source_result.pdf
Binary file not shown.
Binary file removed result/lecture_laptop/clean_result.pdf
Binary file not shown.
Binary file added result/lecture_laptop/result.pdf
Binary file not shown.
Binary file removed result/lecture_laptop/source_result.pdf
Binary file not shown.
Binary file modified result/physics/clean_cropped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed result/physics/clean_result.pdf
Binary file not shown.
Binary file added result/physics/result.pdf
Binary file not shown.
Binary file modified result/physics/source_cropped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed result/physics/source_result.pdf
Binary file not shown.
Binary file removed result/sample/clean_result.pdf
Binary file not shown.
Binary file added result/sample/result.pdf
Binary file not shown.
Binary file removed result/sample/source_result.pdf
Binary file not shown.
Binary file modified result/snipping/clean_cropped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed result/snipping/clean_result.pdf
Binary file not shown.
Binary file added result/snipping/result.pdf
Binary file not shown.
Binary file modified result/snipping/source_cropped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed result/snipping/source_result.pdf
Binary file not shown.
Binary file removed result/table_desktop/clean_result.pdf
Binary file not shown.
Binary file added result/table_desktop/result.pdf
Binary file not shown.
Binary file removed result/table_desktop/source_result.pdf
Binary file not shown.
Binary file removed result/table_laptop/clean_result.pdf
Binary file not shown.
Binary file added result/table_laptop/result.pdf
Binary file not shown.
Binary file removed result/table_laptop/source_result.pdf
Binary file not shown.
Binary file removed result/text_desktop/clean_result.pdf
Binary file not shown.
Binary file added result/text_desktop/result.pdf
Binary file not shown.
Binary file removed result/text_desktop/source_result.pdf
Binary file not shown.
Binary file removed result/text_laptop/clean_result.pdf
Binary file not shown.
Binary file added result/text_laptop/result.pdf
Binary file not shown.
Binary file removed result/text_laptop/source_result.pdf
Binary file not shown.

0 comments on commit ba8b647

Please sign in to comment.