Different-source image registration and binocular positioning method for visible light image and infrared image
Through the combined use of YOLOv8 algorithm and ORB/Brief operator, the noise and contrast problems in the registration of visible light images and infrared images are solved, efficient feature point matching and three-dimensional coordinate calculation are achieved, and the accuracy and efficiency of binocular positioning are improved. .
Patent Information
- Application Number
- CN202410687461.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-09-03
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
It is difficult to effectively register visible light images and infrared images with existing technology, resulting in excessive noise and contrast inversion in binocular positioning, which in turn affects positioning accuracy and computing efficiency.
The YOLOv8 algorithm is used for target detection and semantic segmentation, the ORB and Brief operators are combined for feature point extraction and matching, and the three-dimensional coordinates are calculated through the triangulation principle to achieve heterogeneous image registration and binocular positioning of visible light images and infrared images.
It effectively avoids the problems of noise and contrast inversion, shortens the calculation time, ensures the accuracy and stability of feature point matching, and provides reliable parallax information for the identification and positioning of human targets.
Smart Images

Figure CN118587283A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer vision and image processing, and in particular to a heterogeneous image registration and binocular positioning method of a visible light image and an infrared image. Background Art
[0002] Visible light images are images formed by capturing visible light (light within the spectrum that the human eye can see); infrared images are images formed by capturing infrared rays (electromagnetic waves with longer wavelengths than visible light); heterogeneous image registration is the alignment of images acquired from different sensors, at different times, from different perspectives or under different conditions, so that these images match in space; binocular positioning is a technology based on stereo vision that uses two cameras to obtain the three-dimensional information and spatial position of an object;
[0003] During the operation of lifting machinery, safety accidents caused by human behavior occur frequently, which can easily lead to various accidental casualties. Traditional detection of intrusion into dangerous areas for workers generally uses positioning technologies such as RFID (Radio Frequency Identification), UWB (Ultra Wide Band), and GPS (Global Positioning System) to obtain the location information of people and machinery, and then integrate it into the BIM (Building Information Modeling) building model. Finally, through the judgment, analysis, processing, and transmission of the server, the unsafe behavior of on-site personnel is monitored. However, the actual operation process of these methods is relatively complicated, requiring workers to always wear sensors, and interfering with the normal operation of workers, and also adding a burden to management work;
[0004] With the development of image processing technology and the popularization of video acquisition equipment, the use of image processing to achieve personnel identification and positioning has become a focus of attention; however, the traditional single-use visible light camera for field data acquisition is greatly limited by lighting and environment, making it difficult to obtain comprehensive information;
[0005] At present, the common visible light image and infrared image registration methods are mainly divided into two types: region-based registration method and feature-based registration method. However, the region-based registration method has large amount of calculation, complex calculation, low registration accuracy, and often cannot play a practical effect when based on a large number of images.
[0006] Most feature-based image registration algorithms design corresponding strategies to extract the salient features of the target in the image as much as possible, and then calculate the correlation of features between image pairs for feature matching calculations; these methods are more suitable for application in industrial sites; but due to the different imaging principles of visible light images and infrared images, there is often a contrast reversal phenomenon between the foreground and background of the two, and infrared images are more likely to contain a large number of noise points. Therefore, various mismatches often occur when extracting features from the two. Due to the registration problem of visible light images and infrared images, it is also extremely difficult to perform binocular positioning directly between visible light cameras and infrared cameras. Summary of the invention
[0007] The purpose of the present invention is to provide a heterogeneous image registration and binocular positioning method for visible light images and infrared images to solve the problems raised in the above background technology.
[0008] In order to solve the above technical problems, the present invention provides the following technical solutions: a heterogeneous image registration and binocular positioning method of a visible light image and an infrared image, the method comprising the following steps:
[0009] S1, respectively obtain the image captured by the visible light camera (left eye image) and the image captured by the infrared camera (right eye image);
[0010] S2, calibrating the binocular vision system composed of a visible light camera and an infrared camera, obtaining calibration parameters of the binocular camera, and obtaining a binocular image, wherein the calibration parameters include intrinsic parameters, extrinsic parameters, and distortion parameters of the visible light camera and the infrared camera;
[0011] S3, stereoscopically calibrate the visible light image and the infrared image to eliminate the distortion between the binocular images so that the left image and the right image in the binocular image are aligned in the horizontal direction; if the visible light camera and the infrared camera are placed in an upper and lower position, the two images are rotated 90° counterclockwise and then aligned and calibrated to obtain the calibrated visible light image Image_vis and the calibrated infrared image Image_ir;
[0012] S4. Use the YOLOv8 algorithm to perform target detection and semantic segmentation on the corrected visible light image and infrared image, identify the target area of interest, obtain the target category, and create a mask contour image of the target of interest based on its semantic segmentation result;
[0013] S5, extracting and matching corresponding feature points of the corrected infrared mask image and visible light mask image;
[0014] S6, output the binocular image and the coordinates of the paired points, calculate the disparity of the matched feature points and take the average as the target disparity;
[0015] S7, obtaining a reprojection matrix through parallax and calibration parameters, and calculating the three-dimensional coordinates of the target image in the actual space using the triangulation principle;
[0016] The target region of interest refers to a specific object region in an image or video that needs to be paid special attention to and processed;
[0017] The YOLOv8 algorithm is a target detection algorithm.
[0018] In step S2, the binocular camera composed of a visible light camera and an infrared camera is calibrated, including: using a 12×9 chessboard calibration board dedicated to the infrared camera, each chessboard size is 30mm×30mm, the accuracy is 0.01mm, a heating resistor is set behind the black grid of the calibration board, and the white resistor is a conventional board. After the calibration board is powered on to heat the black chessboard to 35°C, 10 to 20 pairs of images of the chessboard calibration board in different postures are collected with a binocular camera composed of a visible light camera and an infrared camera. The calibration toolbox Stereo Camera Calibrator of MATLAB is used for calibration to obtain the intrinsic parameter matrix M, the extrinsic parameter translation matrix T and the rotation matrix R, the radial distortion coefficients K1, K2, K3 and the tangential distortion coefficients P1, P2 of the binocular camera. In step S3, the specific method of stereo correction of the binocular image is as follows:
[0019]
[0020] Among them, (u,v) is the original coordinate on the image, (u',v') is the coordinate after the image is stereo corrected, r is a variable, K1, K2, K3 are radial distortion parameters; P1, P2 are tangential distortion parameters.
[0021] In step S4, the target detection algorithm YOLOv8 is used to perform target detection and semantic segmentation on the input corrected visible light and infrared images, identify the target area of interest and create a target mask contour image based on the semantic segmentation results, which specifically includes the following steps:
[0022] S4-1. The visible light images and infrared images taken by the crane on site are used as data sets. CVAT is used to annotate the images and output mask data set mask images. The constructed training data set is randomly divided into training set, validation set and test set with a ratio of 3:1:1.
[0023] S4-2. Use the PyTorch framework to build the YOLOv8 network model and set the corresponding network training parameters. The network training parameters include model settings, training settings, verification settings, and test settings.
[0024] S4-3. After the settings are completed, load the open source pre-trained model and start training using the GPU. After the training is completed, the YOLOv8 semantic segmentation network model with the best performance in the validation set is obtained;
[0025] S4-4, inputting the visible light image and the infrared image into the trained target detection network respectively, and outputting the object recognition information, including the category of the object, the position information of the detection frame and the target mask information;
[0026] The CVAT (Computer Vision Annotation Tool) is an annotation tool for computer vision tasks.
[0027] The mask contour images of the visible light image and the infrared image constructed by YOLOv8 semantic segmentation obtain the contour point information of the target to be detected through YOLOv8 semantic segmentation and map it to a pre-made pure black image with the same resolution as the original image, and fill the part between the contour points with a white image for polygon filling, finally forming a mask binary image of the image.
[0028] The pure black image is an image with a pixel value of 0;
[0029] The white image is an image with a pixel value of 255;
[0030] In step S5, feature point extraction and matching are performed on the mask contour images of the visible light image and the infrared image after stereo correction, which specifically includes the following steps:
[0031] S5-1. Use the ORB operator to extract feature points from the visible light mask image and the infrared mask image that have completed stereo correction, and obtain feature point sets Points_vis and Points_ir of the two mask images;
[0032] S5-2, using the Brief operator to calculate the feature point descriptors of Points_vis and Points_ir, and obtain the feature point descriptors Description_vis and Description_ir of the two mask images;
[0033] S5-3, after obtaining the feature points and their descriptors of the two mask images, create a Brute-Force matcher, set the matching condition to match based on the Hamming distance, match the feature points Points_vis and Points_ir of the two images and their descriptors Description_vis and Description_ir, and obtain a rough matching result;
[0034] S5-4. Use the RANSAC algorithm to perform secondary filtering on the feature points after rough matching.
[0035] In step S6, the calculation of the disparity of the matched feature points and taking the average as the disparity of the target specifically includes the following steps:
[0036] S6-1. Extract the horizontal and vertical coordinates of the matching points after secondary filtering, and define the corresponding matching point coordinates as (x_vis_1, y_vis_1) and (x_ir_1, y_ir_1), (x_vis_2, y_vis_2) and (x_ir_2, y_ir_2), ..., (x_vis_n, y_vis_n) and (x_ir_n, y_ir_n);
[0037] Among them, the horizontal and vertical coordinates of the matching points on the visible light image are defined as (x_vis_1, y_vis_1), (x_vis_2, y_vis_2), ..., (x_vis_n, y_vis_n), respectively;
[0038] The horizontal and vertical coordinates of the corresponding matching points on the infrared image are defined as (x_ir_1, y_ir_1), (x_ir_2, y_ir_2), ..., (x_ir_n, y_ir_n);
[0039] S6-2. Subtract the horizontal coordinates of the corresponding matching points to obtain the disparity of each feature point:
[0040] dk=x_vis_k-x_ir_k
[0041] Where k = 1, 2, ..., n; dk is the disparity of the kth group of matched feature points;
[0042] S6-3, after calculating the disparities of all the matched feature points, average the disparities of all the feature points, and use the average as the final disparity of the target;
[0043]
[0044] Where D is the average disparity of the target position; n is the number of matched feature points; dk is the disparity of the kth group of matched feature points.
[0045] In step S7, the reprojection matrix obtained by the parallax and calibration parameters is used to calculate the three-dimensional coordinates of the target in the image in the actual space using the triangulation principle. The calculation formula is:
[0046]
[0047] Among them, the baseline B is the actual physical distance between the optical centers of the binocular cameras, and its specific value is obtained by calculating the second norm of the external parameter matrix T obtained in step S2. f is the focal length of the camera, which is obtained through the internal parameter matrix M; dk is the disparity of the kth group of matched feature points; (cx, cy) is the coordinate of the center point of the imaging plane in the pixel coordinate system; X represents the horizontal coordinate of the three-dimensional coordinate; Y represents the vertical coordinate of the three-dimensional coordinate; Z represents the vertical axis coordinate of the three-dimensional coordinate.
[0048] In step S4-3, the best performing YOLOv8 semantic segmentation network model is the network model with the highest mAP value;
[0049] The mAP value is an evaluation indicator used to measure the performance of target detection and information retrieval systems;
[0050] The mAP value is specifically calculated as follows:
[0051] Prepare the dataset: including images and their corresponding annotation boxes and category information; the dataset used here is the validation dataset; Model prediction: use the target detection model to predict the images in the dataset to obtain the location and category of the detection box; Calculate the accuracy and recall rate: calculate the accuracy and recall rate of each category based on the prediction results and the true annotations; Calculate the AP value: for each category, calculate the AP value based on the area under the accuracy-recall curve; Calculate the mAP value: average the AP values of all categories to get the mAP value;
[0052] The AP value is the average precision of each class;
[0053] The accuracy refers to the proportion of correctly detected objects among all detected objects.
[0054] Compared with the prior art, the beneficial effects achieved by the present invention are:
[0055] 1. The present invention uses the YOLOv8 network to perform target detection and semantic segmentation on the target of interest on the image, reconstructs the segmented target in the form of a mask contour image and processes only the mask image, effectively avoiding the excessive noise or contrast inversion caused by the different imaging principles of visible light cameras and infrared cameras. At the same time, since only the features are processed, the algorithm calculation time is effectively shortened;
[0056] 2. The present invention proposes a visible light image and infrared image registration method, which realizes the detection and filtering of feature points, ensures that the matched points are basically all from the target of interest, and provides stable parallax for subsequent target positioning;
[0057] 3. The present invention proposes a method for identifying and locating a binocular camera by combining a visible light camera and an infrared camera, which can be used in conjunction with a binocular vision experimental platform to effectively complete the identification and positioning of human targets. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0059] Figure 1 It is a flow chart of the heterogeneous image registration and binocular positioning method of the visible light image and infrared image of the present invention;
[0060] Figure 2 It is a schematic diagram of the steps of the heterogeneous image registration and binocular positioning method of the visible light image and infrared image of the present invention;
[0061] Figure 3 It is a schematic diagram of the network structure of the deep learning convolutional neural network model YOLOv8 of the present invention;
[0062] Figure 4 This is a diagram showing the effect of the target registration method of the present invention on the corrected original image. DETAILED DESCRIPTION
[0063] 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.
[0064] See also Figure 1-Figure 4 The present invention provides a technical solution: a heterogeneous image registration method of a visible light image and an infrared image and a binocular positioning method, the method comprising the following steps:
[0065] S1, respectively obtain the image captured by the visible light camera (left eye image) and the image captured by the infrared camera (right eye image);
[0066] S2, calibrating the binocular vision system composed of a visible light camera and an infrared camera, obtaining calibration parameters of the binocular camera, and obtaining a binocular image, wherein the calibration parameters include intrinsic parameters, extrinsic parameters, and distortion parameters of the visible light camera and the infrared camera;
[0067] S3, stereoscopically calibrate the visible light image and the infrared image to eliminate the distortion between the binocular images so that the left image and the right image in the binocular image are aligned in the horizontal direction; if the visible light camera and the infrared camera are placed in an upper and lower position, the two images are rotated 90° counterclockwise and then aligned and calibrated to obtain the calibrated visible light image Image_vis and the calibrated infrared image Image_ir;
[0068] S4. Use the YOLOv8 algorithm to perform target detection and semantic segmentation on the corrected visible light image and infrared image, identify the target area of interest, obtain the target category, and create a mask contour image of the target of interest based on its semantic segmentation result;
[0069] S5, extracting and matching corresponding feature points of the corrected infrared mask image and visible light mask image;
[0070] S6, output the binocular image and the coordinates of the paired points, calculate the disparity of the matched feature points and take the average as the target disparity;
[0071] S7, obtaining a reprojection matrix through parallax and calibration parameters, and calculating the three-dimensional coordinates of the target image in the actual space using the triangulation principle;
[0072] The target region of interest refers to a specific object region in an image or video that needs to be paid special attention to and processed;
[0073] The YOLOv8 algorithm is a target detection algorithm.
[0074] In step S2, the binocular camera composed of a visible light camera and an infrared camera is calibrated, including: using a 12×9 chessboard calibration board dedicated to the infrared camera, each chessboard size is 30mm×30mm, the accuracy is 0.01mm, a heating resistor is set behind the black grid of the calibration board, and the white resistor is a conventional board. After the calibration board is powered on to heat the black chessboard to 35°C, 10 to 20 pairs of images of the chessboard calibration board in different postures are collected with a binocular camera composed of a visible light camera and an infrared camera. The calibration toolbox Stereo Camera Calibrator of MATLAB is used for calibration to obtain the intrinsic parameter matrix M, the extrinsic parameter translation matrix T and the rotation matrix R, the radial distortion coefficients K1, K2, K3 and the tangential distortion coefficients P1, P2 of the binocular camera. In step S3, the specific method of stereo correction of the binocular image is as follows:
[0075]
[0076] Among them, (u,v) is the original coordinate on the image, (u',v') is the coordinate after the image is stereo corrected, r is a variable, K1, K2, K3 are radial distortion parameters; P1, P2 are tangential distortion parameters.
[0077] In step S4, the target detection algorithm YOLOv8 is used to perform target detection and semantic segmentation on the input corrected visible light and infrared images, identify the target area of interest and create a target mask contour image based on the semantic segmentation results, which specifically includes the following steps:
[0078] S4-1. The visible light images and infrared images taken by the crane on site are used as data sets. CVAT is used to annotate the images and output mask data set mask images. The constructed training data set is randomly divided into training set, validation set and test set with a ratio of 3:1:1.
[0079] S4-2. Use the PyTorch framework to build the YOLOv8 network model and set the corresponding network training parameters. The network training parameters include model settings, training settings, verification settings, and test settings.
[0080] S4-3. After the settings are completed, load the open source pre-trained model and start training using the GPU. After the training is completed, the YOLOv8 semantic segmentation network model with the best performance in the validation set is obtained;
[0081] S4-4, inputting the visible light image and the infrared image into the trained target detection network respectively, and outputting the object recognition information, including the category of the object, the position information of the detection frame and the target mask information;
[0082] The CVAT (Computer Vision Annotation Tool) is an annotation tool for computer vision tasks.
[0083] The mask contour images of the visible light image and the infrared image constructed by YOLOv8 semantic segmentation obtain the contour point information of the target to be detected through YOLOv8 semantic segmentation and map it to a pre-made pure black image with the same resolution as the original image, and fill the part between the contour points with a white image for polygon filling, finally forming a mask binary image of the image.
[0084] The pure black image is an image with a pixel value of 0;
[0085] The white image is an image with a pixel value of 255;
[0086] In step S5, feature point extraction and matching are performed on the mask contour images of the visible light image and the infrared image after stereo correction, which specifically includes the following steps:
[0087] S5-1. Use the ORB operator to extract feature points from the visible light mask image and the infrared mask image that have completed stereo correction, and obtain feature point sets Points_vis and Points_ir of the two mask images;
[0088] S5-2, using the Brief operator to calculate the feature point descriptors of Points_vis and Points_ir, and obtain the feature point descriptors Description_vis and Description_ir of the two mask images;
[0089] S5-3, after obtaining the feature points and their descriptors of the two mask images, create a Brute-Force matcher, set the matching condition to match based on the Hamming distance, match the feature points Points_vis and Points_ir of the two images and their descriptors Description_vis and Description_ir, and obtain a rough matching result;
[0090] S5-4. Use the RANSAC algorithm to perform secondary filtering on the feature points after rough matching.
[0091] In step S6, the calculation of the disparity of the matched feature points and taking the average as the disparity of the target specifically includes the following steps:
[0092] S6-1. Extract the horizontal and vertical coordinates of the matching points after secondary filtering, and define the corresponding matching point coordinates as (x_vis_1, y_vis_1) and (x_ir_1, y_ir_1), (x_vis_2, y_vis_2) and (x_ir_2, y_ir_2), ..., (x_vis_n, y_vis_n) and (x_ir_n, y_ir_n);
[0093] Among them, the horizontal and vertical coordinates of the matching points on the visible light image are defined as (x_vis_1, y_vis_1), (x_vis_2, y_vis_2), ..., (x_vis_n, y_vis_n), respectively;
[0094] The horizontal and vertical coordinates of the corresponding matching points on the infrared image are defined as (x_ir_1, y_ir_1), (x_ir_2, y_ir_2), ..., (x_ir_n, y_ir_n);
[0095] S6-2. Subtract the horizontal coordinates of the corresponding matching points to obtain the disparity of each feature point:
[0096] dk=x_vis_k-x_ir_k
[0097] Where k = 1, 2, ..., n; dk is the disparity of the kth group of matched feature points;
[0098] S6-3, after calculating the disparities of all the matched feature points, average the disparities of all the feature points, and use the average as the final disparity of the target;
[0099]
[0100] Where D is the average disparity of the target position, n is the number of matched feature points, and dk is the disparity of the kth group of matched feature points.
[0101] In step S7, the reprojection matrix obtained by the parallax and calibration parameters is used to calculate the three-dimensional coordinates of the target in the image in the actual space using the triangulation principle. The calculation formula is:
[0102]
[0103] Among them, the baseline B is the actual physical distance between the optical centers of the binocular cameras, and its specific value is obtained by calculating the second norm of the external parameter matrix T obtained in step S2. f is the focal length of the camera, which is obtained through the internal parameter matrix M; dk is the disparity of the kth group of matched feature points; (cx, cy) is the coordinate of the center point of the imaging plane in the pixel coordinate system; X represents the horizontal coordinate of the three-dimensional coordinate; Y represents the vertical coordinate of the three-dimensional coordinate; Z represents the vertical axis coordinate of the three-dimensional coordinate.
[0104] In step S4-3, the best performing YOLOv8 semantic segmentation network model is the network model with the highest mAP value;
[0105] The mAP value is an evaluation indicator used to measure the performance of target detection and information retrieval systems;
[0106] The mAP value is specifically calculated as follows:
[0107] Prepare the dataset: including images and their corresponding annotation boxes and category information; the dataset used here is the validation dataset; Model prediction: use the target detection model to predict the images in the dataset to obtain the location and category of the detection box; Calculate the accuracy and recall rate: calculate the accuracy and recall rate of each category based on the prediction results and the true annotations; Calculate the AP value: for each category, calculate the AP value based on the area under the accuracy-recall curve; Calculate the mAP value: average the AP values of all categories to get the mAP value;
[0108] The AP value is the average precision of each class;
[0109] The accuracy refers to the proportion of correctly detected objects among all detected objects.
[0110] In an embodiment of the present invention, a visible light image and an infrared image are acquired by a visible light camera and an infrared camera; and an intrinsic parameter matrix is acquired:
[0111] Visible light camera intrinsic parameter matrix:
[0112]
[0113] Infrared camera internal parameter matrix:
[0114]
[0115] Get the external parameter matrix:
[0116] Translation matrix T:
[0117]
[0118] Unit: (mm);
[0119] Rotation matrix R:
[0120]
[0121] Distortion parameters:
[0122] Distortion parameters of binocular camera (visible light camera):
[0123] ["-0.0001","0.000001","-0.00000001","0.00001","0.00001"]
[0124] Where K1 = -0.0001, K2 = 0.000001, K3 = -0.00000001, P1 = 0.00001, P2 = 0.00001;
[0125] A point in the image is (u,v)=(320,240),
[0126] Use the following formula to calculate:
[0127]
[0128] Among them, (u,v) is the original coordinate on the image, (u',v') is the coordinate after the image is stereo corrected, r is a variable, K1, K2, K3 are radial distortion parameters; P1, P2 are tangential distortion parameters.
[0129]
[0130] u'=320*[1-0.0001*160000+0.000001*160000 2-0.00000001
[0131] *160000 3 ]+[2*0.00001*320*240-0.00001*(160000 2 +2
[0132] *320 2 )]≈319.553536
[0133] v'=240*[1-0.0001*160000+0.000001*160000 2 -0.00000001
[0134] *160000 3 ]+[0.00001*(160000 2 +2*240 2 )+2*0.00001*320
[0135] *240]≈245.150464
[0136] The corrected visible light image Image_vis and infrared image Image_ir are obtained by computer calculation;
[0137] The YOLOv8 algorithm is used to perform target detection and semantic segmentation on the corrected visible light image and infrared image, identify the target area of interest, obtain the target category, and create a mask contour image of the target of interest based on its semantic segmentation results;
[0138] Left eye image mask outline:
[0139] 1.[(150,200),(152,205),(155,210),(160,215),(165,220),(170,225)]
[0140] 2.[(300,350),(305,355),(310,360),(315,365),(320,370),(325,375)]
[0141] Right eye image mask outline:
[0142] 1.[(155,205),(157,210),(160,215),(165,220),(170,225),(175,230)]
[0143] 2.[(305,355),(310,360),(315,365),(320,370),(325,375),(330,380)]
[0144] Extract and match the corresponding feature points of the corrected infrared mask image and visible light mask image;
[0145] Points_vis=[(100,200),(150,250),(200,300),(250,350),(300,400)]
[0146] Points_ir=[(110,210),(160,260),(210,310),(260,360),(310,410)]
[0147] Output the binocular image and the coordinates of the paired points, calculate the disparity of the matched feature points and take their average as the target disparity; dk = x_vis_k - x_ir_k, dk is the disparity of the kth group of matched feature points; where k = 1, 2, ..., n;
[0148] The calculated disparity mean is D = 10;
[0149] The reprojection matrix is obtained through parallax and calibration parameters, and the three-dimensional coordinates of the target in the image in the actual space are calculated using the triangulation principle;
[0150] The reprojection matrix obtained through parallax and calibration parameters is used to calculate the three-dimensional coordinates of the target in the image in the actual space using the triangulation principle. The calculation formula is:
[0151]
[0152] Among them, the baseline B is the actual physical distance between the optical centers of the binocular cameras, and its specific value is obtained by calculating the second norm of the external parameter matrix T obtained in step S2. f is the focal length of the camera, which is obtained through the internal parameter matrix M; dk is the disparity of the kth group of matched feature points; (cx, cy) is the coordinate of the center point of the imaging plane in the pixel coordinate system; X represents the horizontal coordinate of the three-dimensional coordinate; Y represents the vertical coordinate of the three-dimensional coordinate; Z represents the vertical axis coordinate of the three-dimensional coordinate.
[0153] f=50, B=1000, (cx,cy)=(500,500);
[0154] The three-dimensional coordinates of the target are:
[0155]
[0156] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0157] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. Heterogeneous image registration and binocular positioning method of visible light image and infrared image, Features: The method comprises the following steps: S1, respectively obtaining images collected by a visible light camera and an image collected by an infrared camera; S2, calibrating the binocular vision system composed of a visible light camera and an infrared camera, obtaining calibration parameters of the binocular camera, and obtaining a binocular image, wherein the calibration parameters include intrinsic parameters, extrinsic parameters, and distortion parameters of the visible light camera and the infrared camera; S3, stereoscopically calibrate the visible light image and the infrared image to eliminate the distortion between the binocular images so that the left image and the right image in the binocular image are aligned in the horizontal direction; if the visible light camera and the infrared camera are placed in an upper and lower position, the two images are rotated 90° counterclockwise and then aligned and calibrated to obtain the calibrated visible light image Image_vis and the calibrated infrared image Image_ir; S4. Use the YOLOv8 algorithm to perform target detection and semantic segmentation on the corrected visible light image and infrared image, identify the target area of interest, obtain the target category, and create a mask contour image of the target of interest based on its semantic segmentation result; S5, extracting and matching corresponding feature points of the corrected infrared mask image and visible light mask image; S6, output the binocular image and the coordinates of the paired points, calculate the disparity of the matched feature points and take the average as the target disparity; S7, obtaining a reprojection matrix through parallax and calibration parameters, and calculating the three-dimensional coordinates of the target image in the actual space using the triangulation principle; The target region of interest refers to a specific object region in an image or video that needs to be paid special attention to and processed; The YOLOv8 algorithm is a target detection algorithm.
2. The heterogeneous image registration and binocular positioning method of visible light image and infrared image according to claim 1, Features: In step S2, The binocular camera composed of a visible light camera and an infrared camera is calibrated, including: using a 12×9 chessboard calibration board dedicated to the infrared camera, each chessboard is 30mm×30mm in size and has an accuracy of 0.01mm, a heating resistor is arranged behind the black grid of the calibration board, and the white resistor is a conventional board, the calibration board is powered on to heat the black chessboard to 35°C, and then 10 to 20 pairs of images of the chessboard calibration board in different postures are collected by a binocular camera composed of a visible light camera and an infrared camera, and the calibration is performed using the calibration toolbox Stereo Camera Calibrator of MATLAB to obtain the intrinsic parameter matrix M, the extrinsic parameter translation matrix T and the rotation matrix R, and the radial distortion coefficient K of the binocular camera. 1 , K 2 , K 3 and the tangential distortion coefficient P 1 , P 2 .
3. The heterogeneous image registration and binocular positioning method of visible light image and infrared image according to claim 1, Features: In step S3, The specific method for stereo correction of binocular images is: Among them, (u,v) is the original coordinate on the image, (u',v') is the coordinate after the image is stereo corrected, r is a variable, K 1 , K 2 , K 3 is the radial distortion parameter; P 1 , P 2 is the tangential distortion parameter.
4. The heterogeneous image registration and binocular positioning method of visible light image and infrared image according to claim 1, Features: In step S4, Use the target detection algorithm YOLOv8 to perform target detection and semantic segmentation on the input rectified visible light and infrared images, identify the target area of interest and create a target mask contour image based on the semantic segmentation results. The specific steps include: S4-1. The visible light images and infrared images taken by the crane on site are used as data sets. CVAT is used to annotate the images and output mask data set mask images. The constructed training data set is randomly divided into training set, validation set and test set with a ratio of 3:1:
1. S4-2. Use the PyTorch framework to build the YOLOv8 network model and set the corresponding network training parameters. The network training parameters include model settings, training settings, verification settings, and test settings. S4-3. After the settings are completed, load the open source pre-trained model and start training using the GPU. After the training is completed, the YOLOv8 semantic segmentation network model with the best performance in the validation set is obtained; S4-4, inputting the visible light image and the infrared image into the trained target detection network respectively, and outputting the object recognition information, including the category of the object, the position information of the detection frame and the target mask information; The CVAT is an annotation tool for computer vision tasks.
5. The heterogeneous image registration and binocular positioning method of visible light image and infrared image according to claim 3, Features: The mask contour image of the visible light image and the infrared image constructed by YOLOv8 semantic segmentation obtains the contour point information of the target to be detected by YOLOv8 semantic segmentation and maps it to a pre-made pure black image with the same resolution as the original image, and fills the part between the contour points with a white image for polygon filling, finally forming a mask binary image of the image; The pure black image is an image with a pixel value of 0; The white image is an image with a pixel value of 255.
6. The heterogeneous image registration and binocular positioning method of visible light image and infrared image according to claim 1, Features: In step S5, Feature point extraction and matching are performed on the mask contour images of the visible light image and the infrared image after stereo correction, specifically including the following steps: S5-1. Use the ORB operator to extract feature points from the visible light mask image and the infrared mask image that have completed stereo correction, and obtain feature point sets Points_vis and Points_ir of the two mask images; S5-2, using the Brief operator to calculate the feature point descriptors of Points_vis and Points_ir, and obtain the feature point descriptors Description_vis and Description_ir of the two mask images; S5-3, after obtaining the feature points and their descriptors of the two mask images, create a Brute-Force matcher, set the matching condition to match based on the Hamming distance, match the feature points Points_vis and Points_ir of the two images and their descriptors Description_vis and Description_ir, and obtain a rough matching result; S5-4. Use the RANSAC algorithm to perform secondary filtering on the feature points that have completed the rough matching.
7. The heterogeneous image registration and binocular positioning method of visible light image and infrared image according to claim 1, Features: In step S6, The method of calculating the disparity of the matched feature points and taking the average as the disparity of the target specifically includes the following steps: S6-1. Extract the horizontal and vertical coordinates of the matching points after secondary filtering, and define the corresponding matching point coordinates as (x_vis_1, y_vis_1) and (x_ir_1, y_ir_1), (x_vis_2, y_vis_2) and (x_ir_2, y_ir_2), ..., (x_vis_n, y_vis_n) and (x_ir_n, y_ir_n); Among them, the horizontal and vertical coordinates of the matching points on the visible light image are defined as (x_vis_1, y_vis_1), (x_vis_2, y_vis_2), ..., (x_vis_n, y_vis_n), respectively; The horizontal and vertical coordinates of the corresponding matching points on the infrared image are defined as (x_ir_1, y_ir_1), (x_ir_2, y_ir_2), ..., (x_ir_n, y_ir_n); S6-2. Subtract the horizontal coordinates of the corresponding matching points to obtain the disparity of each feature point: dk=x_vis_k-x_ir_k Where k = 1, 2, ..., n; dk is the disparity of the kth group of matched feature points; S6-3, after calculating the disparities of all the matched feature points, average the disparities of all the feature points, and use the average as the final disparity of the target; Where D is the average disparity of the target position, n is the number of matched feature points, and dk is the disparity of the kth group of matched feature points.
8. The heterogeneous image registration and binocular positioning method of visible light image and infrared image according to claim 1, Features: In step S7, The reprojection matrix obtained through parallax and calibration parameters is used to calculate the three-dimensional coordinates of the target in the image in the actual space using the triangulation principle. The calculation formula is: Among them, the baseline B is the actual physical distance between the optical centers of the binocular cameras, and its specific value is obtained by calculating the second norm of the external parameter matrix T obtained in step S2. f is the focal length of the camera, which is obtained through the internal parameter matrix M; dk is the disparity of the kth group of matched feature points; (cx, cy) is the coordinate of the center point of the imaging plane in the pixel coordinate system; X represents the horizontal coordinate of the three-dimensional coordinate; Y represents the vertical coordinate of the three-dimensional coordinate; Z represents the vertical axis coordinate of the three-dimensional coordinate.
9. The heterogeneous image registration and binocular positioning method of visible light image and infrared image according to claim 4, Features: In step S4-3, The best performing YOLOv8 semantic segmentation network model is the network model with the highest mAP value; The mAP value is an evaluation indicator used to measure the performance of target detection and information retrieval systems; The mAP value is specifically calculated as follows: Prepare the dataset: including images and their corresponding annotation boxes and category information; the dataset used here is the validation dataset; Model prediction: use the target detection model to predict the images in the dataset to obtain the location and category of the detection box; Calculate the accuracy and recall rate: calculate the accuracy and recall rate of each category based on the prediction results and the true annotations; Calculate the AP value: for each category, calculate the AP value based on the area under the accuracy-recall curve; Calculate the mAP value: average the AP values of all categories to get the mAP value; The AP value is the average precision of each class; The accuracy refers to the proportion of correctly detected objects among all detected objects.
Citation Information
Patent Citations
Fire source detection, identification and early warning method for fire-fighting robot
CN114399882A
PET / CT medical image-oriented detection method
CN116758005A
Personnel identification and positioning method fusing target edge detection and scale invariant feature transformation
CN116883945A
Fruit identifying and picking method based on deep learning
CN117975143A
Cited By
Binocular distance measurement-based dual-light camera image registration fusion method, system and device, and storage medium
CN119515941A
A method, system, device and storage medium for bifocal camera image registration and fusion based on binocular ranging
CN119515941B
Three-dimensional space track identification method and system based on multi-view three-dimensional reconstruction
CN119941801A
A three-dimensional space trajectory recognition method and system based on multi-view stereo reconstruction
CN119941801B
Position monitoring method and system based on different-source image registration and binocular positioning
CN120125650A
