Find registration marks, tag center of mark (not top left corner)
This commit is contained in:
parent
1589076974
commit
2c2604c4b0
|
@ -102,7 +102,7 @@ topHalfPts = find_in_half(topHalf)
|
||||||
thpts = group_points(topHalfPts)
|
thpts = group_points(topHalfPts)
|
||||||
for pt in thpts :
|
for pt in thpts :
|
||||||
#print(f'{ttlx + pt[0]},{ttly + pt[1]}')
|
#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')
|
print(f'Found {len(thpts)} points')
|
||||||
#display(topHalf)
|
#display(topHalf)
|
||||||
|
@ -114,7 +114,12 @@ bottomHalfPts = find_in_half(bottomHalf)
|
||||||
bhpts = group_points(bottomHalfPts)
|
bhpts = group_points(bottomHalfPts)
|
||||||
for pt in bhpts :
|
for pt in bhpts :
|
||||||
#print(f'{btlx + pt[0]},{btly + pt[1]}')
|
#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')
|
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((0,height,), marks))
|
||||||
print(find_closest((width,height,), marks))
|
print(find_closest((width,height,), marks))
|
||||||
|
|
||||||
|
display(clean)
|
||||||
|
|
Loading…
Reference in New Issue