Ayesha352 commited on
Commit
9dcaccd
·
verified ·
1 Parent(s): a77422a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -112,7 +112,7 @@ 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),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
 
@@ -128,7 +128,7 @@ def homography_all_detectors(flat_file, persp_file, json_file, xml_file):
128
  ordered_pts = ['TopLeft', 'TopRight', 'BottomRight', 'BottomLeft']
129
  xml_polygon = [xml_points[pt] for pt in ordered_pts]
130
  pts = np.array(xml_polygon, np.int32).reshape((-1,1,2))
131
- cv2.polylines(xml_gt_img,[pts],isClosed=True,color=(0,255,0),thickness=5)
132
 
133
  # Convert to RGB + resize + add headings
134
  flat_rgb = add_heading(fit_to_box(cv2.cvtColor(flat_with_roi,cv2.COLOR_BGR2RGB),600,600), "Flat Image with ROI")
 
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
 
 
128
  ordered_pts = ['TopLeft', 'TopRight', 'BottomRight', 'BottomLeft']
129
  xml_polygon = [xml_points[pt] for pt in ordered_pts]
130
  pts = np.array(xml_polygon, np.int32).reshape((-1,1,2))
131
+ cv2.polylines(xml_gt_img,[pts],isClosed=True,color=(255,0,0),thickness=5)
132
 
133
  # Convert to RGB + resize + add headings
134
  flat_rgb = add_heading(fit_to_box(cv2.cvtColor(flat_with_roi,cv2.COLOR_BGR2RGB),600,600), "Flat Image with ROI")