Find registration marks, tag center of mark (not top left corner)

This commit is contained in:
Matt McWilliams 2023-01-30 09:33:30 -05:00
parent 1589076974
commit 2c2604c4b0
1 changed files with 8 additions and 2 deletions

View File

@ -102,7 +102,7 @@ topHalfPts = find_in_half(topHalf)
thpts = group_points(topHalfPts)
for pt in thpts :
#print(f'{ttlx + pt[0]},{ttly + pt[1]}')
marks.append((ttlx + pt[0], ttly + pt[1],))
marks.append((ttlx + pt[0] + round(w / 2), ttly + pt[1] + round(h / 2),))
print(f'Found {len(thpts)} points')
#display(topHalf)
@ -114,7 +114,12 @@ bottomHalfPts = find_in_half(bottomHalf)
bhpts = group_points(bottomHalfPts)
for pt in bhpts :
#print(f'{btlx + pt[0]},{btly + pt[1]}')
marks.append((btlx + pt[0], btly + pt[1], ))
marks.append((btlx + pt[0] + round(w / 2), btly + pt[1] + round(h / 2), ))
clean = original.copy()
for pt in marks :
print(pt)
cv2.circle(clean, pt, 50, (0,0,255), -1)
print(f'Found {len(bhpts)} points')
@ -128,3 +133,4 @@ print(find_closest((width,0,), marks))
print(find_closest((0,height,), marks))
print(find_closest((width,height,), marks))
display(clean)