Skip to content

Commit

Permalink
fix SSIM
Browse files Browse the repository at this point in the history
  • Loading branch information
zyddnys committed Jul 4, 2020
1 parent 131eed6 commit 84d8f39
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,10 @@ def detect_changes(last_frame, cur_frame, last_frame_bboxes, cur_frame_bboxes, s
last_frame_box_img = clahe.apply(cv2.cvtColor(last_frame_box_img, cv2.COLOR_RGB2GRAY))
cur_frame_box_img = clahe.apply(cv2.cvtColor(cur_frame_box_img, cv2.COLOR_RGB2GRAY))
# compute SSIM
v = metrics.structural_similarity(last_frame_box_img, cur_frame_box_img)
try :
v = metrics.structural_similarity(last_frame_box_img, cur_frame_box_img)
except :
continue
if v < ssim_threshold :
# cv2.imshow('img1', last_frame_box_img)
# cv2.imshow('img2', cur_frame_box_img)
Expand Down

0 comments on commit 84d8f39

Please sign in to comment.