Compare commits
No commits in common. "44a828a880894121c3bf08db8e676551b6cc055c" and "29276df9d6464cfea76ac0d64e7057217d6789e7" have entirely different histories.
44a828a880
...
29276df9d6
@ -40,7 +40,7 @@ for file in os.listdir(input_folder):
|
|||||||
filename = input_folder + '/' + file
|
filename = input_folder + '/' + file
|
||||||
out_filename = output_folder + '/' + file
|
out_filename = output_folder + '/' + file
|
||||||
img = cv2.imread(filename, 0)
|
img = cv2.imread(filename, 0)
|
||||||
small_img = cv2.resize(img, (750, 750))
|
small_img = cv2.resize(img, (400, 400))
|
||||||
(corners, ids, rejected) = detector.detectMarkers(small_img)
|
(corners, ids, rejected) = detector.detectMarkers(small_img)
|
||||||
new_image = cv2.aruco.drawDetectedMarkers(
|
new_image = cv2.aruco.drawDetectedMarkers(
|
||||||
small_img,
|
small_img,
|
||||||
@ -73,18 +73,12 @@ for file in os.listdir(input_folder):
|
|||||||
print("x[%d]: %d"%(i, x[i]))
|
print("x[%d]: %d"%(i, x[i]))
|
||||||
print("y[%d]: %d"%(i, y[i]))
|
print("y[%d]: %d"%(i, y[i]))
|
||||||
print()
|
print()
|
||||||
i += 1
|
|
||||||
|
|
||||||
offset = 20
|
i += 1
|
||||||
crop_img = new_image[
|
|
||||||
np.min(x+offset):np.max(x-offset),
|
|
||||||
np.min(y+offset):np.max(y-offset)
|
|
||||||
]
|
|
||||||
|
|
||||||
print("imshape[0]: " + str(small_img.shape[0]))
|
print("imshape[0]: " + str(small_img.shape[0]))
|
||||||
print("imshape[1]: " + str(small_img.shape[1]))
|
print("imshape[1]: " + str(small_img.shape[1]))
|
||||||
cv2.imshow('window', new_image)
|
cv2.imshow('window', new_image)
|
||||||
cv2.imshow('cropped', crop_img)
|
|
||||||
# cv2.imwrite(out_filename, new_image)
|
# cv2.imwrite(out_filename, new_image)
|
||||||
|
|
||||||
cv2.waitKey(0)
|
cv2.waitKey(0)
|
||||||
|
Loading…
Reference in New Issue
Block a user