A near-infrared visual displacement monitoring method and device based on image algorithm
By preprocessing and contour point reconstruction of near-infrared images and building fitted circles with weights, the problem of low near-infrared visual displacement monitoring accuracy in the prior art is solved, and higher monitoring accuracy is achieved.
Patent Information
- Application Number
- CN202411968940.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-08
AI Technical Summary
The existing near-infrared visual displacement monitoring technology has the problem of low accuracy, which is affected by environmental interference, camera calibration and dynamic range, resulting in limited monitoring accuracy.
By preprocessing the near-infrared image, the contour points are extracted and reconstructed, the fitted circle is constructed based on the weight of the contour points, the actual moving distance of the target is calculated, and the monitoring accuracy is improved.
Eliminate the influence of noise and abnormal points, improve the smoothness and consistency of contour point data, enhance the accuracy and robustness of fitted circles, and thus improve the accuracy of near-infrared visual displacement monitoring.
Smart Images

Figure CN119784855A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of visual displacement monitoring, and in particular relates to a near-infrared visual displacement monitoring method and device based on an image algorithm. Background Art
[0002] The wavelength range of near-infrared light is 700nm to 2500nm. Compared with visible light, this wavelength range makes near-infrared light have stronger penetration ability and better material recognition ability, which is particularly suitable for non-contact detection. The use of near-infrared light for visual displacement monitoring has gradually become popular in fields such as materials science, structural monitoring and biomedicine.
[0003] As a non-contact detection method, near-infrared visual displacement monitoring usually uses a near-infrared camera to capture images of the target, and then monitors the actual displacement of the target through the image. However, due to the influence of environmental interference, near-infrared camera calibration and dynamic range, the current near-infrared visual displacement monitoring has the defect of low accuracy, which has limited the development of near-infrared visual displacement monitoring. Therefore, there is an urgent need for a near-infrared visual displacement monitoring method and device based on image algorithm to solve the defects of the existing technology. Summary of the invention
[0004] The present invention aims to provide a near-infrared visual displacement monitoring method and device based on image algorithm to solve the above-mentioned technical problems. By reconstructing the contour points extracted from the near-infrared image and constructing a fitting circle in combination with the weights of the contour points, the actual moving distance of the target can be solved, thereby improving the accuracy of near-infrared visual displacement monitoring.
[0005] In order to solve the above technical problems, an embodiment of the present invention provides a near-infrared visual displacement monitoring method based on an image algorithm, comprising:
[0006] Collecting a number of initial near-infrared images, preprocessing the initial near-infrared images according to a preset image processing algorithm, and obtaining an initial contour point set of each of the initial near-infrared images;
[0007] Reconstructing the contour points in the initial contour point set according to a preset contour point processing method to obtain a first contour point set for each of the initial near-infrared images;
[0008] Acquire the weight of each contour point in the first contour point set, and fit the contour points in the first contour point set based on the weight of each contour point to obtain a fitting circle of each of the initial near infrared images;
[0009] The equipment parameters of the near-infrared camera are obtained, and the actual moving distance of the target is calculated in combination with the fitting circle to complete the near-infrared visual displacement monitoring.
[0010] It can be understood that, compared with the prior art, the present invention obtains an initial contour point set by preprocessing the initial near-infrared image, and then reconstructs the contour points in the initial contour point set, and calculates the weights of the reconstructed contour points, and performs fitting based on the weights to obtain a fitting circle of the initial near-infrared image, and then calculates the actual moving distance of the target based on the fitting circle to complete near-infrared visual displacement monitoring. The present invention can eliminate discrete contour points caused by noise, occlusion or imaging errors by reconstructing the contour points, obtain smoother and more consistent contour point data, improve the feature reliability of the initial near-infrared image, and make the subsequent fitting circle calculation more accurate; constructing the fitting circle based on the weight can effectively reduce the fitting deviation caused by noise or abnormal points, improve the accuracy and robustness of the fitting circle target positioning, and thus improve the accuracy of solving the actual moving distance of the target, and improve the accuracy of near-infrared visual displacement monitoring.
[0011] As a preferred solution, preprocessing the initial near-infrared image according to a preset image processing algorithm to obtain an initial contour point set of each initial near-infrared image specifically includes:
[0012] Performing grayscale processing on each of the initial near-infrared images according to a preset grayscale algorithm to obtain a plurality of first near-infrared images;
[0013] Performing filtering processing on each of the first near-infrared images to obtain a plurality of second near-infrared images;
[0014] Converting the pixel value of each of the second near-infrared images into a preset first grayscale value and a preset second grayscale value to obtain a plurality of third near-infrared images;
[0015] Extracting the edge of each of the third near-infrared images according to a preset edge detection algorithm, and performing a closing operation on the edge of each of the third near-infrared images;
[0016] Based on the edge of each of the third near infrared images after the closing operation, the contour points of each of the third near infrared images are extracted in combination with a preset contour point extraction algorithm, and an initial contour point set of each of the initial near infrared images is determined.
[0017] This preferred scheme can reduce noise interference in the initial near-infrared image and reduce the complexity of the initial near-infrared image data by successively performing grayscale processing, filtering, and pixel value conversion processing on the initial near-infrared image, and improve the image feature accuracy of the initial near-infrared image through closed operation processing, thereby improving the accuracy of the subsequent fitting circle and the accuracy of near-infrared visual displacement monitoring.
[0018] As a preferred solution, reconstructing the contour points in the initial contour point set according to a preset contour point processing method to obtain a first contour point set for each of the initial near-infrared images specifically includes:
[0019] Obtaining the mean and standard deviation of the initial contour point set;
[0020] According to the mean and standard deviation of the initial contour point set, combined with a preset standard threshold, abnormal contour points in each of the initial contour point sets are eliminated to obtain a second contour point set for each initial near-infrared image;
[0021] The second contour point set is uniformly resampled to obtain a first contour point set for each of the initial near-infrared images.
[0022] This preferred solution eliminates abnormal contour points in the initial contour point set and then performs uniform resampling, which can eliminate discrete contour points caused by noise, occlusion or imaging errors, and obtain smoother and more consistent contour point data, thereby improving the calculation accuracy of subsequent fitting circles and the accuracy of near-infrared visual displacement monitoring.
[0023] As a preferred solution, the step of obtaining a weight of each contour point in the first contour point set, and fitting the contour points in the first contour point set based on the weight of each contour point to obtain a fitting circle of each initial near infrared image specifically includes:
[0024] Based on the coordinate information of each contour point in the first contour point set, obtaining a weight of each contour point in the first contour point set;
[0025] constructing a weighted matrix corresponding to each of the first contour point sets based on the weight of each contour point in the first contour point set;
[0026] constructing a weighted equation for each of the first contour point sets according to the coordinate information of each contour point in the first contour point set and a weighted matrix;
[0027] Solving the weighted equation of the first contour point set to obtain fitting circle parameters corresponding to each of the first contour point sets;
[0028] The contour points in the first contour point set are fitted based on the fitting circle parameters to obtain a fitting circle for each of the initial near-infrared images.
[0029] This preferred solution calculates the weight of each contour point so that contour points far from the center have less influence on the fitting results, enhances the suppression effect on contour points with poor signal-to-noise ratio or interference, effectively reduces the fitting deviation caused by noise or abnormal contour points, improves the accuracy and robustness of the fitting circle, and improves the accuracy of near-infrared visual displacement monitoring.
[0030] As a preferred solution, obtaining the weight of each contour point in the first contour point set based on the coordinate information of each contour point in the first contour point set specifically includes:
[0031] Based on the coordinate information of each contour point in the first contour point set, obtaining the coordinate median of the first contour point set, and constructing an initial circle center based on the coordinate median;
[0032] Based on the coordinate information of each contour point in the first contour point set, a weight of each contour point in the first contour point set is calculated:
[0033]
[0034] Among them, w i is the weight of the i-th contour point, and dist is the distance from the i-th contour point to the initial center of the circle.
[0035] This preferred solution calculates the weight of each contour point so that contour points far from the center have less influence on the fitting result, enhances the suppression effect on contour points with poor signal-to-noise ratio or interference, effectively reduces the fitting deviation caused by noise or abnormal contour points, and improves the accuracy and robustness of the fitting circle.
[0036] As a preferred solution, the acquisition of the device parameters of the near-infrared camera and the calculation of the actual moving distance of the target in combination with the fitting circle to complete the near-infrared visual displacement monitoring specifically include:
[0037] Obtaining device parameters of a near infrared camera, wherein the device parameters include: pixel size, object distance, and focal length;
[0038] Acquire the pixel displacement of the target according to the center coordinates of the fitting circle;
[0039] The actual moving distance of the target is calculated according to the pixel size, object distance, focal length and pixel displacement to complete the near-infrared visual displacement monitoring.
[0040] This preferred solution obtains the device parameters of the near-infrared camera, combines the coordinates of the center of the fitting circle, and uses basic geometric optics and triangle mapping principles to quickly and accurately calculate the actual moving distance of the target, thereby improving the accuracy and efficiency of near-infrared visual displacement monitoring.
[0041] Accordingly, the embodiment of the present invention improves a near-infrared visual displacement monitoring device based on an image algorithm, comprising: a contour point acquisition module, a contour point reconstruction module, a fitting circle calculation module and a displacement monitoring module;
[0042] The contour point acquisition module is used to collect a number of initial near-infrared images, pre-process the initial near-infrared images according to a preset image processing algorithm, and obtain an initial contour point set of each of the initial near-infrared images;
[0043] The contour point reconstruction module is used to reconstruct the contour points in the initial contour point set according to a preset contour point processing method to obtain a first contour point set for each of the initial near-infrared images;
[0044] The fitting circle calculation module is used to obtain the weight of each contour point in the first contour point set, and fit the contour points in the first contour point set based on the weight of each contour point to obtain a fitting circle of each of the initial near-infrared images;
[0045] The displacement monitoring module is used to obtain the equipment parameters of the near-infrared camera, and calculate the actual moving distance of the target in combination with the fitting circle to complete the near-infrared visual displacement monitoring.
[0046] As a preferred solution, the fitting circle calculation module includes: a fitting circle calculation unit;
[0047] The fitting circle calculation unit is used to obtain the weight of each contour point in the first contour point set based on the coordinate information of each contour point in the first contour point set;
[0048] constructing a weighted matrix corresponding to each of the first contour point sets based on the weight of each contour point in the first contour point set;
[0049] constructing a weighted equation for each of the first contour point sets according to the coordinate information of each contour point in the first contour point set and a weighted matrix;
[0050] Solving the weighted equation of the first contour point set to obtain fitting circle parameters corresponding to each of the first contour point sets;
[0051] The contour points in the first contour point set are fitted based on the fitting circle parameters to obtain a fitting circle for each of the initial near-infrared images.
[0052] As a preferred solution, the fitting circle calculation unit includes: a weight calculation subunit;
[0053] The weight calculation subunit is used to obtain the coordinate median of the first contour point set based on the coordinate information of each contour point in the first contour point set, and construct an initial circle center based on the coordinate median;
[0054] Based on the coordinate information of each contour point in the first contour point set, a weight of each contour point in the first contour point set is calculated:
[0055]
[0056] Among them, w i is the weight of the i-th contour point, and dist is the distance from the i-th contour point to the initial center of the circle.
[0057] As a preferred solution, the displacement monitoring module includes: a displacement monitoring unit;
[0058] The displacement monitoring unit is used to obtain the device parameters of the near-infrared camera, and the device parameters include: pixel size, object distance and focal length;
[0059] Acquire the pixel displacement of the target according to the center coordinates of the fitting circle;
[0060] The actual moving distance of the target is calculated according to the pixel size, object distance, focal length and pixel displacement to complete the near-infrared visual displacement monitoring.
[0061] It can be understood that, compared with the prior art, the present device obtains an initial contour point set by preprocessing the initial near-infrared image, and then reconstructs the contour points in the initial contour point set, calculates the weights of the reconstructed contour points, and performs fitting based on the weights to obtain a fitting circle of the initial near-infrared image, and then calculates the actual moving distance of the target based on the fitting circle to complete near-infrared visual displacement monitoring. By reconstructing the contour points, the present device can eliminate discrete contour points caused by noise, occlusion or imaging errors, obtain smoother and more consistent contour point data, improve the feature reliability of the initial near-infrared image, and make the subsequent fitting circle calculation more accurate; constructing the fitting circle based on the weight can effectively reduce the fitting deviation caused by noise or abnormal points, improve the accuracy and robustness of the fitting circle target positioning, and thus improve the accuracy of solving the actual moving distance of the target, and improve the accuracy of near-infrared visual displacement monitoring. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 : A flowchart of a near-infrared visual displacement monitoring method based on an image algorithm provided in an embodiment of the present invention;
[0063] Figure 2 : A schematic diagram of the target position placement of a near-infrared camera and a near-infrared light source provided in an embodiment of the present invention;
[0064] Figure 3 : A schematic diagram of a visual displacement calculation principle provided by an embodiment of the present invention;
[0065] Figure 4 : A schematic flow chart of another near-infrared visual displacement monitoring method based on an image algorithm provided in an embodiment of the present invention;
[0066] Figure 5 : A schematic structural diagram of a near-infrared visual displacement monitoring device based on an image algorithm provided in an embodiment of the present invention;
[0067] Among them, 201: contour point acquisition module; 202: contour point reconstruction module; 203: fitting circle calculation module; 204: displacement monitoring module. DETAILED DESCRIPTION
[0068] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0069] Embodiment 1
[0070] Please refer to Figure 1 , is a step flow chart of a near-infrared visual displacement monitoring method based on an image algorithm provided in an embodiment of the present invention, including steps S101 to S104.
[0071] Step S101: collecting a number of initial near-infrared images, pre-processing the initial near-infrared images according to a preset image processing algorithm, and obtaining an initial contour point set of each of the initial near-infrared images.
[0072] In an alternative embodiment, please refer to Figure 2 , is a schematic diagram of the target position placement of a near-infrared camera and a near-infrared light source provided by an embodiment of the present invention; Figure 2 As shown, the wavelength of the near-infrared light source is 850nm. The initial near-infrared image is collected by adjusting the parameters of the near-infrared camera. During the initial near-infrared image collection process, it is necessary to modulate the target of the near-infrared light source into the field of view of the near-infrared camera, and adjust the focal length and aperture of the near-infrared camera to make the target image clear.
[0073] In this embodiment, the preprocessing of the initial near-infrared image according to a preset image processing algorithm to obtain an initial contour point set of each initial near-infrared image specifically includes:
[0074] Performing grayscale processing on each of the initial near-infrared images according to a preset grayscale algorithm to obtain a plurality of first near-infrared images;
[0075] Performing filtering processing on each of the first near-infrared images to obtain a plurality of second near-infrared images;
[0076] Converting the pixel value of each of the second near-infrared images into a preset first grayscale value and a preset second grayscale value to obtain a plurality of third near-infrared images;
[0077] Extracting the edge of each of the third near-infrared images according to a preset edge detection algorithm, and performing a closing operation on the edge of each of the third near-infrared images;
[0078] Based on the edge of each of the third near infrared images after the closing operation, the contour points of each of the third near infrared images are extracted in combination with a preset contour point extraction algorithm, and an initial contour point set of each of the initial near infrared images is determined.
[0079] This embodiment can reduce noise interference in the initial near-infrared image and reduce the complexity of the initial near-infrared image data by successively performing grayscale processing, filtering, and pixel value conversion processing on the initial near-infrared image, and improve the image feature accuracy of the initial near-infrared image through closed operation processing, thereby improving the accuracy of the subsequent fitting circle and the accuracy of near-infrared visual displacement monitoring.
[0080] In an optional embodiment, the image is grayed using the cv2.cvtColor and cv2.COLOR_BGR2GRAY functions in the opencv-python library, and then the first near-infrared image is median filtered using the cv2.medianBlur function in the opencv-python library. Then, the second near-infrared image is binarized using the cv2.threshold function in the opencv-python library, and the image pixel values are converted into a preset first grayscale value and a preset second grayscale value (i.e., 0 and 255). Then, the third near-infrared image is subjected to Canny operator edge extraction using the cv2.Canny function in the opencv-python library. Then, the edge of the third near-infrared image is closed using the cv2.dilate function and the cv2.erode function in the opencv-python library. Finally, the third near-infrared image is subjected to contour point extraction using the cv2.findContours function in the opencv-python library to determine an initial contour point set for each initial near-infrared image.
[0081] It should be noted that the opencv-python library is an open source computer vision and machine learning software library, which is often used for image processing. Since the use of related functions in the opencv-python library for image processing has been relatively mature, we will not go into details here.
[0082] In the above embodiment, through grayscale processing, noise interference in color information can be reduced, so that useful information in the image is more prominent, and it is simplified to a single grayscale channel, which greatly reduces the complexity of image data. This helps to reduce storage requirements and processing time; median filtering can effectively remove salt and pepper noise and random noise in near-infrared images, while retaining edge details, making the image smoother and less blurred; converting image pixel values into two grayscale values significantly simplifies the data complexity of the image, making the target boundary clearer and enhancing the subsequent edge and contour point extraction effect. Through closed operation processing, small holes and cracks in the edge of the image can be filled, making the edge more continuous, making the contour smoother, clearer and seamless, and improving the accuracy of contour point recognition.
[0083] Step S102: reconstructing contour points in the initial contour point set according to a preset contour point processing method to obtain a first contour point set of each initial near-infrared image.
[0084] In this embodiment, reconstructing the contour points in the initial contour point set according to the preset contour point processing method to obtain the first contour point set of each initial near-infrared image specifically includes:
[0085] Obtaining the mean and standard deviation of the initial contour point set;
[0086] According to the mean and standard deviation of the initial contour point set, combined with a preset standard threshold, abnormal contour points in each of the initial contour point sets are eliminated to obtain a second contour point set for each initial near-infrared image;
[0087] The second contour point set is uniformly resampled to obtain a first contour point set for each of the initial near-infrared images.
[0088] This embodiment eliminates abnormal contour points in the initial contour point set and then performs uniform resampling, which can eliminate discrete contour points caused by noise, occlusion or imaging errors, and obtain smoother and more consistent contour point data, thereby improving the calculation accuracy of subsequent fitting circles and improving the accuracy of near-infrared visual displacement monitoring.
[0089] In an optional embodiment, the Z-score value method can be used to eliminate abnormal contour points in each of the initial contour point sets. Specifically, the mean and standard deviation of the initial contour point set are calculated, and then the contour points in the initial contour point set are judged as abnormal contour points based on the Z-score value (i.e., the preset standard threshold). Finally, the second contour point set is uniformly resampled to obtain the first contour point set of each of the initial near-infrared images.
[0090] It should be noted that the Z-score method is used to describe the position of a value relative to the mean of the entire data set. It represents the distance between the original score and the mean, and the standard deviation is used to measure this distance.
[0091] In an optional embodiment, the cv2.cornerSubPix function in the opencv-python library may be used to refine the contour points into sub-pixels, and remove abnormal contour points in each of the initial contour point sets.
[0092] Step S103: obtaining the weight of each contour point in the first contour point set, and fitting the contour points in the first contour point set based on the weight of each contour point to obtain a fitting circle of each of the initial near-infrared images.
[0093] In this embodiment, the step of obtaining the weight of each contour point in the first contour point set, and fitting the contour points in the first contour point set based on the weight of each contour point to obtain a fitting circle for each of the initial near-infrared images specifically includes:
[0094] Based on the coordinate information of each contour point in the first contour point set, obtaining a weight of each contour point in the first contour point set;
[0095] constructing a weighted matrix corresponding to each of the first contour point sets based on the weight of each contour point in the first contour point set;
[0096] constructing a weighted equation for each of the first contour point sets according to the coordinate information of each contour point in the first contour point set and a weighted matrix;
[0097] Solving the weighted equation of the first contour point set to obtain fitting circle parameters corresponding to each of the first contour point sets;
[0098] The contour points in the first contour point set are fitted based on the fitting circle parameters to obtain a fitting circle for each of the initial near-infrared images.
[0099] This embodiment calculates the weight of each contour point so that the contour points far from the center have less influence on the fitting result, enhances the suppression effect on contour points with poor signal-to-noise ratio or interference, effectively reduces the fitting deviation caused by noise or abnormal contour points, improves the accuracy and robustness of the fitting circle, and improves the accuracy of near-infrared visual displacement monitoring.
[0100] In this embodiment, acquiring the weight of each contour point in the first contour point set based on the coordinate information of each contour point in the first contour point set specifically includes:
[0101] Based on the coordinate information of each contour point in the first contour point set, obtaining the coordinate median of the first contour point set, and constructing an initial circle center based on the coordinate median;
[0102] Based on the coordinate information of each contour point in the first contour point set, a weight of each contour point in the first contour point set is calculated:
[0103]
[0104] Among them, w i is the weight of the i-th contour point, and dist is the distance from the i-th contour point to the initial center of the circle.
[0105] This embodiment calculates the weight of each contour point so that contour points far from the center have less influence on the fitting result, enhances the suppression effect on contour points with poor signal-to-noise ratio or interference, effectively reduces the fitting deviation caused by noise or abnormal contour points, and improves the accuracy and robustness of the fitting circle.
[0106] In an optional embodiment, the weight of each contour point in the first contour point set is calculated according to the above formula (1), and then a weighting matrix W corresponding to each first contour point set is constructed according to the weight of each contour point in the first contour point set, and a weighting equation of each first contour point set is constructed, wherein the weighting equation is as follows:
[0107] A w =W*A,
[0108] B w =W*B,
[0109] Among them, A is the coordinate information of the contour point, B is a vector used to represent the square distance from each contour point to the initial center of the circle, and W is a weighted matrix that includes the weight of each contour point in the form of a diagonal matrix;
[0110] Then, the weighted equation is solved using the np.linalg.lstsq function to obtain the fitting circle parameters corresponding to each of the first contour point sets, where the fitting circle parameters include the coordinates of the center of the circle and the radius.
[0111] It should be noted that the np.linalg.lstsq function is used to solve the least squares problem. The np.linalg.lstsq function can quickly solve the solution of the weighted equation.
[0112] In an optional embodiment, after obtaining the fitting circle parameters, the fitting circle parameters at different times can be averaged to obtain the average values of the center coordinates and the radius, so that the positioning of the fitting circle is more stable and the accuracy of subsequent near-infrared visual displacement monitoring is improved.
[0113] Step S104: acquiring the equipment parameters of the near-infrared camera, and calculating the actual moving distance of the target in combination with the fitting circle, thereby completing the near-infrared visual displacement monitoring.
[0114] In this embodiment, the acquisition of the device parameters of the near-infrared camera and the calculation of the actual moving distance of the target in combination with the fitting circle to complete the near-infrared visual displacement monitoring specifically include:
[0115] Obtaining device parameters of a near infrared camera, wherein the device parameters include: pixel size, object distance, and focal length;
[0116] Acquire the pixel displacement of the target according to the center coordinates of the fitting circle;
[0117] The actual moving distance of the target is calculated according to the pixel size, object distance, focal length and pixel displacement to complete the near-infrared visual displacement monitoring.
[0118] In an alternative embodiment, please refer to Figure 3 , is a schematic diagram of a visual displacement calculation principle provided by an embodiment of the present invention; Figure 3 As shown, according to the principles of geometric optics and triangle mapping, the moving distance of the near-infrared light source can be obtained through the moving distance of the target image pixels, the image distance and the object distance;
[0119] Specifically, the pixel size is obtained through the near-infrared camera equipment manual, and the distance between the near-infrared light source target and the near-infrared camera is measured using a laser rangefinder to obtain the object distance. When the object distance is large, the image distance approaches the focal length. In this embodiment, the image distance and the focal length are equal. According to the proportional relationship of similar triangles, the relationship between the moving distance of the near-infrared light source and the moving distance of the target image pixel is described by the following formula (2):
[0120]
[0121] Then, the target image pixel moving distance is solved according to the center coordinates of the fitting circle at the previous and next moments, and it is substituted into formula (2) to calculate the actual moving distance of the target (i.e., near-infrared light source), thus completing the near-infrared visual displacement monitoring.
[0122] In an alternative embodiment, please refer to Figure 4 , which is a flow chart of another near-infrared visual displacement monitoring method based on an image algorithm provided by an embodiment of the present invention, such as Figure 4 As shown, a near-infrared image is acquired, and then grayscale processing, median filtering, binarization processing, Canny edge extraction and closing operation processing are performed in sequence to extract the contour points of the near-infrared image. Then, outliers in the contour points are removed, and then the contour points are resampled and the sub-pixels of the contour points are refined. Finally, the weighted least squares method is used to fit the circle, and the displacement is calculated based on the center diameter of the circle to complete the near-infrared visual displacement monitoring.
[0123] This embodiment obtains an initial contour point set by preprocessing the initial near-infrared image, then reconstructs the contour points in the initial contour point set, calculates the weights of the reconstructed contour points, and performs fitting based on the weights to obtain a fitting circle of the initial near-infrared image. Then, the actual moving distance of the target is calculated based on the fitting circle to complete near-infrared visual displacement monitoring. This embodiment can eliminate discrete contour points caused by noise, occlusion or imaging errors by reconstructing the contour points, obtain smoother and more consistent contour point data, improve the feature reliability of the initial near-infrared image, and make the subsequent fitting circle calculation more accurate; constructing the fitting circle based on the weights can effectively reduce the fitting deviation caused by noise or abnormal points, improve the accuracy and robustness of the fitting circle target positioning, and thus improve the accuracy of solving the actual moving distance of the target and the accuracy of near-infrared visual displacement monitoring.
[0124] Embodiment 2
[0125] Please refer to Figure 5 , which is a structural schematic diagram of a near-infrared visual displacement monitoring device based on an image algorithm provided in an embodiment of the present invention, including: a contour point acquisition module 201, a contour point reconstruction module 202, a fitting circle calculation module 203 and a displacement monitoring module 204.
[0126] The contour point acquisition module 201 is used to collect a number of initial near-infrared images, pre-process the initial near-infrared images according to a preset image processing algorithm, and obtain an initial contour point set of each of the initial near-infrared images.
[0127] In this embodiment, the contour point acquisition module 201 includes: a contour point acquisition unit;
[0128] The contour point acquisition unit is used to perform grayscale processing on each of the initial near-infrared images according to a preset grayscale algorithm to obtain a plurality of first near-infrared images;
[0129] Performing filtering processing on each of the first near-infrared images to obtain a plurality of second near-infrared images;
[0130] Converting the pixel value of each of the second near-infrared images into a preset first grayscale value and a preset second grayscale value to obtain a plurality of third near-infrared images;
[0131] Extracting the edge of each of the third near-infrared images according to a preset edge detection algorithm, and performing a closing operation on the edge of each of the third near-infrared images;
[0132] Based on the edge of each of the third near infrared images after the closing operation, the contour points of each of the third near infrared images are extracted in combination with a preset contour point extraction algorithm, and an initial contour point set of each of the initial near infrared images is determined.
[0133] The contour point reconstruction module 202 is used to reconstruct the contour points in the initial contour point set according to a preset contour point processing method to obtain a first contour point set for each of the initial near-infrared images.
[0134] In this embodiment, the contour point reconstruction module 202 includes: a contour point reconstruction unit;
[0135] The contour point reconstruction unit is used to obtain the mean and standard deviation of the initial contour point set;
[0136] According to the mean and standard deviation of the initial contour point set, combined with a preset standard threshold, abnormal contour points in each of the initial contour point sets are eliminated to obtain a second contour point set for each initial near-infrared image;
[0137] The second contour point set is uniformly resampled to obtain a first contour point set for each of the initial near-infrared images.
[0138] The fitting circle calculation module 203 is used to obtain the weight of each contour point in the first contour point set, and fit the contour points in the first contour point set based on the weight of each contour point to obtain a fitting circle of each of the initial near infrared images.
[0139] In this embodiment, the fitting circle calculation module 203 includes: a fitting circle calculation unit;
[0140] The fitting circle calculation unit is used to obtain the weight of each contour point in the first contour point set based on the coordinate information of each contour point in the first contour point set;
[0141] constructing a weighted matrix corresponding to each of the first contour point sets based on the weight of each contour point in the first contour point set;
[0142] constructing a weighted equation for each of the first contour point sets according to the coordinate information of each contour point in the first contour point set and a weighted matrix;
[0143] Solving the weighted equation of the first contour point set to obtain fitting circle parameters corresponding to each of the first contour point sets;
[0144] The contour points in the first contour point set are fitted based on the fitting circle parameters to obtain a fitting circle for each of the initial near-infrared images.
[0145] In this embodiment, the fitting circle calculation unit includes: a weight calculation subunit;
[0146] The weight calculation subunit is used to obtain the coordinate median of the first contour point set based on the coordinate information of each contour point in the first contour point set, and construct an initial circle center based on the coordinate median;
[0147] Based on the coordinate information of each contour point in the first contour point set, a weight of each contour point in the first contour point set is calculated:
[0148]
[0149] Among them, w i is the weight of the i-th contour point, and dist is the distance from the i-th contour point to the initial center of the circle.
[0150] The displacement monitoring module 204 is used to obtain the equipment parameters of the near-infrared camera, and calculate the actual moving distance of the target in combination with the fitting circle to complete the near-infrared visual displacement monitoring.
[0151] In this embodiment, the displacement monitoring module 204 includes: a displacement monitoring unit;
[0152] The displacement monitoring unit is used to obtain the device parameters of the near-infrared camera, and the device parameters include: pixel size, object distance and focal length;
[0153] Acquire the pixel displacement of the target according to the center coordinates of the fitting circle;
[0154] The actual moving distance of the target is calculated according to the pixel size, object distance, focal length and pixel displacement to complete the near-infrared visual displacement monitoring.
[0155] This embodiment obtains an initial contour point set by preprocessing the initial near-infrared image, then reconstructs the contour points in the initial contour point set, calculates the weights of the reconstructed contour points, and performs fitting based on the weights to obtain a fitting circle of the initial near-infrared image. Then, the actual moving distance of the target is calculated based on the fitting circle to complete near-infrared visual displacement monitoring. This embodiment can eliminate discrete contour points caused by noise, occlusion or imaging errors by reconstructing the contour points, obtain smoother and more consistent contour point data, improve the feature reliability of the initial near-infrared image, and make the subsequent fitting circle calculation more accurate; constructing the fitting circle based on the weights can effectively reduce the fitting deviation caused by noise or abnormal points, improve the accuracy and robustness of the fitting circle target positioning, and thus improve the accuracy of solving the actual moving distance of the target and the accuracy of near-infrared visual displacement monitoring.
[0156] In summary, the embodiment of the present invention obtains an initial contour point set by preprocessing the initial near-infrared image, and then reconstructs the contour points in the initial contour point set, calculates the weights of the reconstructed contour points, and performs fitting based on the weights to obtain a fitting circle of the initial near-infrared image. Then, the actual moving distance of the target is calculated based on the fitting circle to complete near-infrared visual displacement monitoring. The embodiment of the present invention can eliminate discrete contour points caused by noise, occlusion or imaging errors by reconstructing the contour points, obtain smoother and more consistent contour point data, improve the feature reliability of the initial near-infrared image, and make the subsequent fitting circle calculation more accurate; constructing the fitting circle based on the weight can effectively reduce the fitting deviation caused by noise or abnormal points, improve the accuracy and robustness of the fitting circle target positioning, and thus improve the accuracy of solving the actual moving distance of the target, and improve the accuracy of near-infrared visual displacement monitoring.
[0157] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.
Claims
1. A near-infrared visual displacement monitoring method based on image algorithm, characterized in that: include: Collecting a number of initial near-infrared images, preprocessing the initial near-infrared images according to a preset image processing algorithm, and obtaining an initial contour point set of each of the initial near-infrared images; Reconstructing the contour points in the initial contour point set according to a preset contour point processing method to obtain a first contour point set for each of the initial near-infrared images; Acquire the weight of each contour point in the first contour point set, and fit the contour points in the first contour point set based on the weight of each contour point to obtain a fitting circle of each of the initial near infrared images; The equipment parameters of the near-infrared camera are obtained, and the actual moving distance of the target is calculated in combination with the fitting circle to complete the near-infrared visual displacement monitoring.
2. A near-infrared visual displacement monitoring method based on image algorithm as claimed in claim 1, characterized in that: The preprocessing of the initial near-infrared image according to a preset image processing algorithm to obtain an initial contour point set of each of the initial near-infrared images specifically includes: Performing grayscale processing on each of the initial near-infrared images according to a preset grayscale algorithm to obtain a plurality of first near-infrared images; Performing filtering processing on each of the first near-infrared images to obtain a plurality of second near-infrared images; Converting the pixel value of each of the second near-infrared images into a preset first grayscale value and a preset second grayscale value to obtain a plurality of third near-infrared images; Extracting the edge of each of the third near-infrared images according to a preset edge detection algorithm, and performing a closing operation on the edge of each of the third near-infrared images; Based on the edge of each of the third near infrared images after the closing operation, the contour points of each of the third near infrared images are extracted in combination with a preset contour point extraction algorithm, and an initial contour point set of each of the initial near infrared images is determined.
3. A near-infrared visual displacement monitoring method based on image algorithm as claimed in claim 2, characterized in that: The reconstructing the contour points in the initial contour point set according to the preset contour point processing method to obtain the first contour point set of each initial near-infrared image specifically includes: Obtaining the mean and standard deviation of the initial contour point set; According to the mean and standard deviation of the initial contour point set, combined with a preset standard threshold, abnormal contour points in each of the initial contour point sets are eliminated to obtain a second contour point set for each initial near-infrared image; The second contour point set is uniformly resampled to obtain a first contour point set for each of the initial near-infrared images.
4. A near-infrared visual displacement monitoring method based on image algorithm as claimed in claim 1, characterized in that: The acquiring the weight of each contour point in the first contour point set, and fitting the contour points in the first contour point set based on the weight of each contour point to obtain a fitting circle of each of the initial near infrared images specifically includes: Based on the coordinate information of each contour point in the first contour point set, obtaining a weight of each contour point in the first contour point set; constructing a weighted matrix corresponding to each of the first contour point sets based on the weight of each contour point in the first contour point set; constructing a weighted equation for each of the first contour point sets according to the coordinate information of each contour point in the first contour point set and a weighted matrix; Solving the weighted equation of the first contour point set to obtain fitting circle parameters corresponding to each of the first contour point sets; The contour points in the first contour point set are fitted based on the fitting circle parameters to obtain a fitting circle for each of the initial near-infrared images.
5. A near-infrared visual displacement monitoring method based on image algorithm as claimed in claim 4, characterized in that: The obtaining, based on the coordinate information of each contour point in the first contour point set, the weight of each contour point in the first contour point set specifically includes: Based on the coordinate information of each contour point in the first contour point set, obtaining the coordinate median of the first contour point set, and constructing an initial circle center based on the coordinate median; Based on the coordinate information of each contour point in the first contour point set, a weight of each contour point in the first contour point set is calculated: Among them, w i is the weight of the i-th contour point, and dist is the distance from the i-th contour point to the initial center of the circle.
6. The near-infrared visual displacement monitoring method based on image algorithm as claimed in claim 1, characterized in that: The method of obtaining the equipment parameters of the near-infrared camera and calculating the actual moving distance of the target in combination with the fitting circle to complete the near-infrared visual displacement monitoring specifically includes: Obtaining device parameters of a near infrared camera, wherein the device parameters include: pixel size, object distance, and focal length; Acquire the pixel displacement of the target according to the center coordinates of the fitting circle; The actual moving distance of the target is calculated according to the pixel size, object distance, focal length and pixel displacement to complete the near-infrared visual displacement monitoring.
7. A near-infrared visual displacement monitoring device based on image algorithm, characterized in that: include: Contour point acquisition module, contour point reconstruction module, fitting circle calculation module and displacement monitoring module; The contour point acquisition module is used to collect a number of initial near-infrared images, pre-process the initial near-infrared images according to a preset image processing algorithm, and obtain an initial contour point set of each of the initial near-infrared images; The contour point reconstruction module is used to reconstruct the contour points in the initial contour point set according to a preset contour point processing method to obtain a first contour point set for each of the initial near-infrared images; The fitting circle calculation module is used to obtain the weight of each contour point in the first contour point set, and fit the contour points in the first contour point set based on the weight of each contour point to obtain a fitting circle of each of the initial near-infrared images; The displacement monitoring module is used to obtain the equipment parameters of the near-infrared camera, and calculate the actual moving distance of the target in combination with the fitting circle to complete the near-infrared visual displacement monitoring.
8. The near-infrared visual displacement monitoring device based on image algorithm as claimed in claim 7, characterized in that: The fitting circle calculation module includes: a fitting circle calculation unit; The fitting circle calculation unit is used to obtain the weight of each contour point in the first contour point set based on the coordinate information of each contour point in the first contour point set; constructing a weighted matrix corresponding to each of the first contour point sets based on the weight of each contour point in the first contour point set; constructing a weighted equation for each of the first contour point sets according to the coordinate information of each contour point in the first contour point set and a weighted matrix; Solving the weighted equation of the first contour point set to obtain fitting circle parameters corresponding to each of the first contour point sets; The contour points in the first contour point set are fitted based on the fitting circle parameters to obtain a fitting circle for each of the initial near-infrared images.
9. A near-infrared visual displacement monitoring device based on image algorithm as claimed in claim 8, characterized in that: The fitting circle calculation unit includes: a weight calculation subunit; The weight calculation subunit is used to obtain the coordinate median of the first contour point set based on the coordinate information of each contour point in the first contour point set, and construct an initial circle center based on the coordinate median; Based on the coordinate information of each contour point in the first contour point set, a weight of each contour point in the first contour point set is calculated: Among them, w i is the weight of the i-th contour point, and dist is the distance from the i-th contour point to the initial center of the circle.
10. The near-infrared visual displacement monitoring device based on image algorithm as claimed in claim 7, characterized in that: The displacement monitoring module comprises: a displacement monitoring unit; The displacement monitoring unit is used to obtain the device parameters of the near-infrared camera, and the device parameters include: pixel size, object distance and focal length; Acquire the pixel displacement of the target according to the center coordinates of the fitting circle; The actual moving distance of the target is calculated according to the pixel size, object distance, focal length and pixel displacement to complete the near-infrared visual displacement monitoring.
Citation Information
Cited By
Bridge multi-point displacement measurement method and device based on edge detection
CN122175893A