c++ visual processing—–cv::findContours function performs denoising, smoothing, edge detection and contour detection on images, and dynamically detects graphics

cv::findContours cv::findContours is a function in OpenCV used to find the contours of objects in images. Contours are the boundaries of objects and are commonly used for object detection, segmentation, and shape analysis. The basic usage of the cv::findContours function is as follows: cv::findContours(image, contours, hierarchy, mode, method, offset = cv::Point(0, 0)); image: The input […]

Understanding of merging of halcon contour algorithm

************************************************Contour merge: two Connect the outlines************************************************ *************************************************** ************ gen_contour_polygon_xld (FirstContour, [500,1000], [1,1]) gen_contour_polygon_xld (SecondContour, [1000,500], [2000,2000]) gen_contour_polygon_xld (SecondContour1, [1000,500], [500,1001]) gen_contour_polygon_xld (SecondContour2, [1000,500], [3000,3000]) gen_contour_polygon_xld (SecondContour1, [500,1000], [500,1001]) * gen_contour_polygon_xld (SecondContour1, [1000,1000], [1000,500]) concat_obj (FirstContour, SecondContour1, ConcatContour) concat_obj(ConcatContour, SecondContour, ConcatContour) concat_obj(ConcatContour, SecondContour2, ConcatContour) *Returns the length of the contour distance_cc(ConcatContour, ConcatContour, ‘point_to_segment’, DistanceMin, DistanceMax) *Returns […]

[Python Ocean Topic 8] Cartopy adjusts the number of contourf filling intervals for drawing topographic and bathymetric maps

[Python Ocean Topic 8] Cartopy adjusts the number of contourf filling intervals for drawing topographic and bathymetric maps article Sometimes I want to make the contourf picture more detailed. At this time, it is necessary to increase the number of filling intervals Contents of this issue 1: The number of fillings in contourf changes cf […]

[Python Ocean Topic 9] Cartopy draws terrain contour maps

[Python Ocean Topic 9] Cartopy draws terrain contour maps The basics of the water depth chart are almost the same, and can be replaced by temperature, salinity, etc. This issue plus depth contours Contents of this issue 1: Topographic contours cf = ax.contour(lon, lat, ele[:, :], levels=np.linspace(-9000,-100,10), colors=’gray’, linestyles=’-‘, linewidths=0.25, transform=ccrs.PlateCarree()) 2: Change color colors=’gray’ […]

OpenCV contour approximation-polygon fitting, bounding rectangle and bounding circle

Introduction Contour Approximation refers to approximating or fitting the contour to obtain an approximate contour. In image processing, contours represent the boundaries of objects in an image, so contour approximation can be used to describe and identify the shape of objects. Polygon fitting Polygon fitting (Approximating Polygons) is to approximate the outline into a polygon […]

OpenCV Python How to find the shortest distance between a point and a contour in an image?

We can use cv2.pointPolygonTest() to calculate the shortest distance between a point on the image and the contour, passing the contour point coordinates and point coordinates as parameters to it. Before using cv2.pointPolygonTest() we need to calculate the contours in the image. We can follow the following steps to find the shortest distance between a […]