I want to create a module with OPENCV like on below. But function of opencv which is cv.matchShapes(...), support only a contour for searching. How can I create a reference model which has multiple contours with OPENCV?
Information: (contour1 is not supported for multiple contours)
- Python: cv2.matchShapes(<b>contour1</b>, contour2, method, parameter)
复制代码
Halcon Codes:
- read_image (Test, 'test.jpg')
- gen_rectangle1 (ROI_0, -3.64286, -31.5379, 152.201, 114.278)
- reduce_domain(Test, ROI_0, ImageReduced)
- create_shape_model (ImageReduced, 4, rad(0), rad(360), rad(1.6523), ['none','no_pregeneration'], 'use_polarity', [12,17,5], 4, ModelID)
- get_shape_model_contours(ModelContours, ModelID, 1)
- find_shape_model(Test, ModelID, -0.39, 0.79, 0.5, 1, 0.5, 'least_squares', 0, 0.9, Row, Column, Angle, Score)
复制代码
|