Ayesha352 commited on
Commit
bfb04e8
·
verified ·
1 Parent(s): 0e14d57

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -112,16 +112,16 @@ def homography_all_detectors(flat_file, persp_file, json_file, xml_file):
112
  # 1. Flat image with ROI (from JSON)
113
  flat_with_roi = flat_img.copy()
114
  roi_corners_flat = get_rotated_rect_corners(roi_x,roi_y,roi_w,roi_h,roi_rot_deg)
115
- cv2.polylines(flat_with_roi,[roi_corners_flat.astype(int)],True,(0,255,0),2)
116
  for px,py in roi_corners_flat:
117
  cv2.circle(flat_with_roi,(int(px),int(py)),5,(255,0,0),-1)
118
 
119
  # 2. Perspective with Homography ROI
120
  roi_corners_persp = cv2.perspectiveTransform(roi_corners_flat.reshape(-1,1,2),H).reshape(-1,2)
121
  persp_roi = persp_img.copy()
122
- cv2.polylines(persp_roi,[roi_corners_persp.astype(int)],True,(255,0,255),5) #--------------------thicknes------------------------------------
123
  for px,py in roi_corners_persp:
124
- cv2.circle(persp_roi,(int(px),int(py)),5,(0,255,0),3)
125
 
126
  # 3. Perspective with GT ROI (from XML)
127
  xml_gt_img = persp_img.copy()
 
112
  # 1. Flat image with ROI (from JSON)
113
  flat_with_roi = flat_img.copy()
114
  roi_corners_flat = get_rotated_rect_corners(roi_x,roi_y,roi_w,roi_h,roi_rot_deg)
115
+ cv2.polylines(flat_with_roi,[roi_corners_flat.astype(int)],True,(0,255,0),3)
116
  for px,py in roi_corners_flat:
117
  cv2.circle(flat_with_roi,(int(px),int(py)),5,(255,0,0),-1)
118
 
119
  # 2. Perspective with Homography ROI
120
  roi_corners_persp = cv2.perspectiveTransform(roi_corners_flat.reshape(-1,1,2),H).reshape(-1,2)
121
  persp_roi = persp_img.copy()
122
+ cv2.polylines(persp_roi,[roi_corners_persp.astype(int)],True,(0,0,255),5) #--------------------thicknes------------------------------------
123
  for px,py in roi_corners_persp:
124
+ cv2.circle(persp_roi,(int(px),int(py)),5,(0,255,0),5)
125
 
126
  # 3. Perspective with GT ROI (from XML)
127
  xml_gt_img = persp_img.copy()