bakeup
This commit is contained in:
6
tracking/shopcart/cart_tempt/说明.txt
Normal file
6
tracking/shopcart/cart_tempt/说明.txt
Normal file
@ -0,0 +1,6 @@
|
||||
5幅图:
|
||||
incart.png
|
||||
outcart.png
|
||||
incart_ftmp.png
|
||||
outcart_ftmp.png
|
||||
cartboarder.png
|
@ -36,10 +36,10 @@ def temp_add_boarder():
|
||||
|
||||
|
||||
def create_front_temp():
|
||||
image = cv2.imread("image_front.png")
|
||||
image = cv2.imread("./iCart4/b.png")
|
||||
Height, Width = image.shape[:2]
|
||||
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
|
||||
thresh, binary = cv2.threshold(gray, 1, 255, cv2.THRESH_BINARY_INV)
|
||||
thresh, binary = cv2.threshold(gray, 128, 255, cv2.THRESH_BINARY_INV)
|
||||
board = cv2.bitwise_not(binary)
|
||||
contours, _ = cv2.findContours(board, cv2.RETR_LIST, cv2.CHAIN_APPROX_NONE)
|
||||
|
||||
@ -48,12 +48,12 @@ def create_front_temp():
|
||||
img = np.zeros((Height, Width), dtype=np.uint8)
|
||||
cv2.drawContours(img, [cnt], -1, 255, 3)
|
||||
k += 1
|
||||
cv2.imwrite(f"fronttemp_{k}.png", img)
|
||||
cv2.imwrite(f"./iCart4/back{k}.png", img)
|
||||
|
||||
imgshow = cv2.drawContours(image, contours, -1, (0,255,0), 3)
|
||||
cv2.imwrite("board_ftmp_line.png", imgshow)
|
||||
cv2.imwrite("./iCart4/board_back_line.png", imgshow)
|
||||
|
||||
# cv2.imwrite("4.png", board)
|
||||
# cv2.imwrite("./iCart4/4.png", board)
|
||||
# cv2.imwrite("1.png", gray)
|
||||
# cv2.imwrite("2.png", binary)
|
||||
|
BIN
tracking/shopcart/iCart4.zip
Normal file
BIN
tracking/shopcart/iCart4.zip
Normal file
Binary file not shown.
Reference in New Issue
Block a user