Method, device and storage medium for positioning crosshairs of display screen images
Through deep convolutional neural network and weighted clustering analysis method, the problem of insufficient crosshair positioning accuracy in the new display screen is solved, and high-precision crosshair detection is achieved.
Patent Information
- Application Number
- CN202510734321.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-04
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2045-06-04
AI Technical Summary
The crosshairs of the new display screen are prone to local fractures, missing or adhesions during the detection process, resulting in a decrease in positioning accuracy and stability. Traditional image processing technology lacks positioning accuracy in display screens with complex structures.
The deep convolutional neural network model is used in combination with the weighted clustering analysis method, and the crosshair distortion is initially corrected through the saddle point image to generate the line detection data, and edge detection and straight line detection are used using the border information and confidence information. The intersection information is optimized by the weighted clustering algorithm to calculate the crosshair center coordinates.
It improves the positioning accuracy of crosshairs and can accurately detect crosshairs in display screens with complex structures, enhancing the stability and accuracy of detection.
Smart Images

Figure CN120259433B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of display screen detection, and in particular to a method for positioning a crosshair of a display screen image. Background Art
[0002] As display technology continues to advance, new types of displays are emerging one after another, and their structures are becoming increasingly sophisticated and complex. This makes defect detection for these new displays increasingly complex. When inspecting new displays for defects, they must first be aligned and positioned. In the active alignment process of standard display engines, crosshair technology is widely used during the installation and assembly phase as a critical reference mark. This process places extremely high demands on the display quality of the crosshairs at the predetermined locations on the new display.
[0003] However, due to display defects and screen defects in newer displays, the crosshairs may experience localized breakage, missing parts, or sticking, affecting the accuracy and stability of detection. Furthermore, the increasing number of display layers and the complex membrane structures also lead to various new types of crosshair display errors.
[0004] Current crosshair detection and positioning mainly rely on traditional image processing technologies, such as line detection and template matching based on Hough transform. These methods can achieve effective detection under display screens with simple hierarchical structures. However, on new display screens, the crosshairs are prone to partial loss or noise interference, and their positioning accuracy is significantly reduced, which reduces the accuracy of locating the crosshairs. Summary of the Invention
[0005] The present application discloses a method, device and storage medium for positioning a crosshair of a display screen image, which are used to improve the accuracy of positioning the crosshair.
[0006] In a first aspect, an embodiment of the present application provides a method for positioning a crosshair of a display screen image, comprising:
[0007] Input the designed crosshair image and chessboard image into the target display screen, and use the acquisition camera to collect the display screen image and saddle point image. There are several crosshairs on the display screen image and several saddle points on the saddle point image.
[0008] Performing preliminary distortion correction on the crosshairs of the display image through the saddle points on the saddle point image;
[0009] Perform line analysis on the display image using a deep convolutional neural network model to generate line detection data, which includes border information and confidence information.
[0010] Perform edge detection on the display screen image based on the border information in the directrix detection data, and then perform straight line detection to determine the directrix intersection information;
[0011] The weighted cluster analysis method is used to cluster the slope features in the line intersection information, generating several line categories and cluster centers of the line categories.
[0012] Generate crosshair center position information based on several line categories and cluster centers;
[0013] The center coordinates of the target standard line are calculated based on the center position information, the border information in the line detection data, and the confidence information.
[0014] Optionally, the step of performing preliminary distortion correction on the crosshairs of the display screen image using the saddle points on the saddle point image includes:
[0015] The saddle point on the saddle point image is located by adaptive multi-scale feature fusion method;
[0016] When there is a missing saddle point, a polynomial fit is performed on the determined saddle points to generate several fitting curves;
[0017] Interpolation processing and intersection calculation of missing saddle points are performed based on several fitting curves to complete the missing saddle points;
[0018] A homography matrix is generated according to all completed saddle points and the reference saddle points on the standard template, and the crosshairs of the display image are preliminarily rectified by the homography matrix.
[0019] Optionally, the step of performing edge detection on the display screen image according to the frame information in the directrix detection data, and then performing line detection to determine the directrix intersection information includes:
[0020] Performing area screening on the display screen image based on the border information in the alignment detection data;
[0021] Calculate the horizontal and vertical gradients of the display screen image after area screening to extract potential edge information;
[0022] According to the two preset thresholds and along the gradient direction, the local maximum is screened and only significant edge points are retained to remove non-critical edges;
[0023] The display screen image after edge detection is subjected to straight line detection according to Hough transform to determine the intersection point information of the directrix.
[0024] Optionally, the alignment detection data further includes type information;
[0025] After performing line analysis on the display screen image using a deep convolutional neural network model to generate line detection data, the positioning method further includes:
[0026] Performing regional annotation on the initial crosshairs on the display screen image to generate a reference crosshair frame, and associating a reference feature label of the crosshairs with the reference crosshairs frame, the reference feature label including a type feature label, a position feature label, and a confidence feature label;
[0027] The deep convolutional neural network model is trained based on the bounding box information, type information, confidence information, type feature labels, position feature labels, confidence feature labels and a preset composite loss function.
[0028] Optionally, after the step of calculating the center coordinates of the target standard line based on the center position information, the bounding box information in the guideline detection data, and the confidence information, the positioning method further includes:
[0029] Construct the ROI area for detecting the crosshairs according to the center coordinates of the target standard line;
[0030] Perform grayscale projection processing on the ROI area to generate a grayscale projection sequence;
[0031] The defect projection fluctuation law generates dynamic grayscale projection change threshold information;
[0032] A crosshair defect detection is performed on the grayscale projection sequence according to the dynamic grayscale projection change threshold information to generate a first crosshair detection result.
[0033] Optionally, after the step of constructing an ROI region for detecting the crosshairs according to the center coordinates of the target standard line, the positioning method further includes:
[0034] An image hierarchy with different resolutions is constructed on the ROI area, and a pyramid structure is used to perform multi-scale analysis on the crosshairs to generate the second crosshair detection result.
[0035] Optionally, after performing grayscale projection processing on the ROI area to generate a grayscale projection sequence, the positioning method further includes:
[0036] Grayscale projection and defect detection are performed on the grayscale projection sequence at different scales to generate third-line detection results.
[0037] In a second aspect, an embodiment of the present application provides a device for positioning a crosshair of a display screen image, comprising:
[0038] The acquisition unit is used to input the designed crosshair image and chessboard image into the target display screen, and acquire the display screen image and saddle point image through the acquisition camera. There are several crosshairs on the display screen image and several saddle points on the saddle point image.
[0039] a correction unit, configured to perform preliminary distortion correction on a crosshair of the display screen image through a saddle point on the saddle point image;
[0040] A first generating unit is configured to perform a line analysis on the display screen image through a deep convolutional neural network model to generate line detection data, where the line detection data includes border information and confidence information;
[0041] A determination unit, configured to perform edge detection on the display screen image based on the frame information in the directrix detection data, and then perform straight line detection to determine directrix intersection information;
[0042] The second generating unit is used to cluster the slope features in the line intersection information using a weighted cluster analysis method to generate a plurality of line categories and cluster centers of the line categories;
[0043] a third generating unit, configured to generate center position information of a crosshair according to a plurality of line categories and cluster centers;
[0044] The calculation unit is used to calculate the center coordinates of the target standard line based on the center position information, the frame information and the confidence information in the line detection data.
[0045] Optionally, the correction unit includes:
[0046] The saddle point on the saddle point image is located by adaptive multi-scale feature fusion method;
[0047] When there is a missing saddle point, a polynomial fit is performed on the determined saddle points to generate several fitting curves;
[0048] Interpolation processing and intersection calculation of missing saddle points are performed based on several fitting curves to complete the missing saddle points;
[0049] A homography matrix is generated according to all completed saddle points and the reference saddle points on the standard template, and the crosshairs of the display image are preliminarily rectified by the homography matrix.
[0050] Optionally, the determining unit includes:
[0051] Performing area screening on the display screen image based on the border information in the alignment detection data;
[0052] Calculate the horizontal and vertical gradients of the display screen image after area screening to extract potential edge information;
[0053] According to the two preset thresholds and along the gradient direction, the local maximum is screened and only significant edge points are retained to remove non-critical edges;
[0054] The display screen image after edge detection is subjected to straight line detection according to Hough transform to determine the intersection point information of the directrix.
[0055] Optionally, the alignment detection data further includes type information;
[0056] After the first generating unit, the positioning device further includes:
[0057] a fourth generating unit, configured to perform regional annotation on the initial crosshair on the display screen image, generate a reference crosshair frame, and associate a reference feature label of the crosshair with the reference crosshair frame, the reference feature label including a type feature label, a position feature label, and a confidence feature label;
[0058] The training unit is used to train a deep convolutional neural network model based on bounding box information, type information, confidence information, type feature labels, position feature labels, confidence feature labels, and a preset composite loss function.
[0059] Optionally, after the calculation unit, the positioning device further includes:
[0060] A detection unit, configured to construct a ROI region for detecting a crosshair according to the center coordinates of the target standard line;
[0061] a fifth generating unit, configured to perform grayscale projection processing on the ROI region to generate a grayscale projection sequence;
[0062] A sixth generating unit, configured to generate dynamic grayscale projection change threshold information based on the defect projection fluctuation rule;
[0063] The seventh generating unit is configured to perform crosshair defect detection on the grayscale projection sequence according to the dynamic grayscale projection change threshold information to generate a first crosshair detection result.
[0064] Optionally, after the second detection unit, the positioning device further includes:
[0065] The eighth generating unit is used to construct image hierarchies with different resolutions in the ROI area, perform multi-scale analysis on the crosshairs using a pyramid structure, and generate a second crosshair detection result.
[0066] Optionally, after the fifth generating unit, the positioning device further includes:
[0067] The ninth generating unit is configured to perform grayscale projection and defect detection on the grayscale projection sequence at different scales to generate a third directrix detection result.
[0068] In a third aspect, an embodiment of the present application provides a device for positioning the crosshairs of a display screen image, comprising: a processor, a memory, an input / output unit, and a bus; the processor is connected to the memory, the input / output unit, and the bus; the memory stores a program, and the processor calls the program to execute the first aspect and any optional positioning method of the first aspect.
[0069] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a program is stored. When the program is executed on a computer, it executes the first aspect and any optional positioning method of the first aspect.
[0070] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0071] This application first inputs the designed crosshair image and chessboard image into the target display screen. The display screen image and saddle point image are captured by a camera. Several crosshairs are present on the display screen image, and several saddle points are present on the saddle point image. The crosshairs in the display screen image are initially distorted using the saddle points in the saddle point image. A deep convolutional neural network model is then used to perform crosshair analysis on the display screen image, extract crosshair features from the display screen image, determine crosshair information, and generate crosshair detection data. The crosshair detection data includes border information and confidence information. Edge detection is performed on the display screen image based on the border information in the crosshair detection data, followed by line detection to determine the crosshair intersection information. A weighted cluster analysis method is used to cluster the slope features in the crosshair intersection information, generating several line categories and cluster centers for the line categories. The center position information of the crosshairs is generated based on the several line categories and cluster centers. The center coordinates of the target standard line are calculated based on the center position information, the border information in the crosshair detection data, and the confidence information.
[0072] By using a deep convolutional neural network model, the model learns the structural characteristics of different crosshair types, enabling detection even when some are missing. Furthermore, a weighted clustering analysis algorithm designed for new types of crosshair defects is incorporated, and further intersection optimization is performed. Finally, the center coordinates of the target standard line are calculated based on the center position information, bounding box information from the crosshair detection data, and confidence information, further improving the accuracy of crosshair positioning. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0074] Figure 1 A schematic diagram of an embodiment of a method for positioning a crosshair of a display screen image according to the present application;
[0075] Figure 2 A schematic diagram of an embodiment of a method for generating crosshair correction for the present application;
[0076] Figure 3 A schematic diagram of an embodiment of a method for determining intersection information of directrixes according to the present application;
[0077] Figure 4 A schematic diagram of an embodiment of a method for training a deep convolutional neural network model in this application;
[0078] Figure 5 A schematic diagram of an embodiment of a method for crosshair defect detection of the present application;
[0079] Figure 6 A schematic diagram of another embodiment of the crosshair defect detection method of the present application;
[0080] Figure 7 A schematic diagram of another embodiment of the crosshair defect detection method of the present application;
[0081] Figure 8 A schematic diagram of an embodiment of a positioning device for a crosshair of a display screen image according to the present application;
[0082] Figure 9 A schematic diagram of another embodiment of a positioning device for a crosshair of a display screen image according to the present application;
[0083] Figure 10 A schematic diagram of the saddle point position extracted by the traditional straight line fitting method;
[0084] Figure 11 A schematic diagram of the saddle point locations extracted for this application;
[0085] Figure 12 A schematic diagram of the display screen image of this application. DETAILED DESCRIPTION
[0086] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.
[0087] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.
[0088] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0089] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0090] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0091] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0092] In existing technologies, defects in new display screens, such as display defects and screen defects, can cause crosshairs to break, become missing, or become stuck, impacting detection accuracy and stability. Furthermore, the increasing number of display screen layers and the complex membrane structures can lead to various new types of crosshair display errors.
[0093] Current crosshair detection and positioning mainly rely on traditional image processing technologies, such as line detection and template matching based on Hough transform. These methods can achieve effective detection under display screens with simple hierarchical structures. However, on new display screens, the crosshairs are prone to partial loss or noise interference, and their positioning accuracy is significantly reduced, which reduces the accuracy of locating the crosshairs.
[0094] Based on this, the present application discloses a method, device and storage medium for positioning a crosshair of a display screen image, which are used to improve the accuracy of positioning the crosshair.
[0095] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0096] The method of the present application can be applied to a server, device, terminal or other device with logic processing capability, and the present application does not limit this. For the convenience of description, the following description is based on the example of the execution subject being a terminal.
[0097] See also Figure 1 The present application provides an embodiment of a method for positioning a crosshair of a display screen image, comprising:
[0098] 101. Input the designed crosshair image and chessboard image into the target display screen, and collect the display screen image and saddle point image by using the acquisition camera. There are several crosshairs on the display screen image, and there are several saddle points on the saddle point image.
[0099] In this embodiment, the terminal generates a crosshair image based on the target display's intended inspection items, and also generates a checkerboard image to correct crosshair distortion. The checkerboard image displays alternating two-color grids with a large grayscale difference to produce sufficient saddle points. The target display sequentially displays these two images, and the acquisition camera performs image capture, generating a display image and a saddle point image.
[0100] In this embodiment, the terminal collects image data containing multiple crosshairs, ensuring that the data set contains different lighting conditions, different angles, and different occlusion conditions. The data set contains a variety of crosshair sizes, directions, partial occlusions, etc., ensuring that the subsequent deep convolutional neural network model can learn sufficiently rich crosshair features.
[0101] If necessary, you can manually or machine-annotate the bounding box of each crosshair in the display image. The format of each crosshair annotation is [category, x1, y1, x2, y2], where (x1, y1) and (x2, y2) represent the coordinates of the upper left corner and lower right corner of the bounding box, respectively.
[0102] 102. Perform preliminary distortion correction on the crosshairs of the display screen image through the saddle points on the saddle point image;
[0103] Because the target display screen is easily affected by the sampling camera lens during the capture process, and the optical imaging system is inevitably affected by lens processing errors and assembly deviations during the manufacturing and installation process, the crosshairs may shift, deform, and tilt during the imaging process, adversely affecting subsequent precise positioning and detection accuracy. Furthermore, issues such as positional offset and warping of the target display screen can further cause further distortion of the crosshairs on the target display screen during the acquisition process.
[0104] In order to solve the above-mentioned distortion problem, the embodiment of the present application adopts a chessboard screen with saddle points. The chessboard screen is generated according to the structure and resolution of the target display screen. In the chessboard screen, sufficient saddle points are created by setting high-gap grayscale. A point pair set is constructed based on the correspondence between the detected saddle points and the ideal saddle point coordinates to achieve high-precision calibration, thereby effectively correcting the distortion of the crosshairs on the display screen image and improving the imaging accuracy. The specific correction steps are further described in subsequent embodiments.
[0105] 103. Perform line analysis on the display screen image using a deep convolutional neural network model to generate line detection data, which includes border information and confidence information;
[0106] In this embodiment, a deep learning object detection model (YOLOv9) is used to detect all crosshairs in the input display screen image and generate crosshair detection data, which outputs the bounding box information, confidence information, and category label of the target crosshair. By extracting the bounding box information, the center position of the crosshair can be preliminarily estimated, thereby completing coarse positioning.
[0107] The YOLOv9 model is used for target detection because of its efficient detection speed and good accuracy. The YOLOv9 model uses a deep convolutional neural network (CNN) to extract crosshair features from the input display image and predicts the target's location (boundary), category, and confidence level through regression methods.
[0108] During object detection, the YOLOv9 model outputs the bounding box coordinates and confidence score for each detected crosshair. Bounding boxes are represented in the format [x1, y1, x2, y2], where (x1, y1) represents the coordinates of the upper-left corner of the target area, and (x2, y2) represents the coordinates of the lower-right corner. The YOLOv9 model also outputs a confidence score for the target. This score is a value between 0 and 1 that indicates the YOLOv9 model's confidence in the detection result. A higher confidence score indicates a more reliable prediction of the target's existence.
[0109] 104. Perform edge detection on the display screen image based on the border information in the directrix detection data, and then perform straight line detection to determine directrix intersection information;
[0110] In this embodiment, the terminal performs edge detection on the display screen image according to the frame information in the guideline detection data, and then performs straight line detection to determine the guideline intersection information. The specific method will be described in the subsequent embodiments.
[0111] 105. Cluster the slope features in the line intersection information using a weighted cluster analysis method to generate several line categories and cluster centers of the line categories;
[0112] In this embodiment, the terminal clusters the slope features in the line intersection information using a weighted cluster analysis method to generate a number of line categories and cluster centers of the line categories.
[0113] Specifically, during the detection of the crosshair intersections, a cluster analysis method is used to optimize the straight line intersections detected by the Hough transform to improve positioning accuracy.
[0114] Traditional clustering algorithms (such as K-Means) assume that all features contribute equally. This means they're suitable for situations where feature contributions are relatively close. However, in the real-world detection of crosshairs on display screens, the increasing precision and complexity of displays leads to numerous crosshair features (including both normal crosshair design features and numerous defect features), resulting in significant differences in the importance of different features. Therefore, this application employs a weighted clustering analysis algorithm to enhance clustering effectiveness, particularly when certain crosshair features significantly influence the clustering results.
[0115] In the weighted cluster analysis method, feature weights are introduced to adjust the distance calculation so that important features have a greater impact on the clustering results. In this embodiment, the calculation formula of the designed weighted Euclidean distance is as follows:
[0116]
[0117] Where x=(x1,x2,...,xn) represents the feature vector of the data point (the data point in the intersection information of the directrix), n represents the total number of features, and c=(c1,c2,...,cn) represents the cluster center. is the weight of feature i, ensuring that important features occupy a larger proportion in the calculation process. The weight of each feature is different. The specific calculation method of the crosshair feature weight is described in the subsequent embodiment.
[0118] 106. Generate crosshair center position information according to a number of line categories and cluster centers;
[0119] A weighted K-means clustering algorithm is applied to the detected set of lines based on their slope characteristics to achieve adaptive classification. Each crosshair should ideally contain two perpendicular lines (a horizontal line and a vertical line). The slopes of the lines are clustered using the weighted K-means algorithm, dividing them into two categories. The center of each category is calculated to determine the average slope representing that category. The clustering process uses slope characteristics as the primary basis, assigning different lines to corresponding categories based on their directional properties. Finally, the central line parameters are extracted from each cluster category, and the coordinates of the intersection of the two lines are calculated to determine the center position of the crosshairs.
[0120] For each pair of horizontal and vertical lines in the clustering results, we can calculate their intersection, assuming that the equation of the horizontal line is The equation of the perpendicular line is , by solving the simultaneous equations, we can get the intersection coordinates (x, y), which are the center coordinates of the crosshairs.
[0121] 107. Calculate the center coordinates of the target standard line based on the center position information, the border information in the alignment detection data, and the confidence information.
[0122] In this embodiment, during the detection of the crosshairs, the deep learning model outputs the bounding box of each crosshair and its confidence, while the adaptive intersection detection method based on the weighted clustering algorithm extracts the intersection coordinates of each crosshair and uses it as the center point. In the embodiment of the present application, a weighted fusion strategy is used to synchronously analyze the two results to further improve the detection accuracy. Specifically, the confidence information of YOLOv9 is used as a weight parameter to perform a weighted calculation on the intersection coordinates of the crosshairs. The mathematical expression is as follows:
[0123]
[0124] in, is the center position of the crosshairs detected by YOLOv9. is the intersection position obtained by weighted clustering detection. It is the confidence value of YOLOv9, which reflects the confidence of YOLOv9 in detecting the crosshair.
[0125] If the YOLOv9 model's confidence score falls below a preset threshold, it prefers to rely on clustering-based detection results, thereby enhancing the algorithm's robustness. Finally, the outputs of the two methods are fused by weighted averaging to obtain the highly accurate center coordinates (x, y) of each crosshair.
[0126] This application first inputs the designed crosshair image and chessboard image into the target display screen. The display screen image and saddle point image are captured by a camera. Several crosshairs are present on the display screen image, and several saddle points are present on the saddle point image. The crosshairs in the display screen image are initially distorted using the saddle points in the saddle point image. A deep convolutional neural network model is then used to perform crosshair analysis on the display screen image, extract crosshair features from the display screen image, determine crosshair information, and generate crosshair detection data. The crosshair detection data includes border information and confidence information. Edge detection is performed on the display screen image based on the border information in the crosshair detection data, followed by line detection to determine the crosshair intersection information. A weighted cluster analysis method is used to cluster the slope features in the crosshair intersection information, generating several line categories and cluster centers for the line categories. The center position information of the crosshairs is generated based on the several line categories and cluster centers. The center coordinates of the target standard line are calculated based on the center position information, the border information in the crosshair detection data, and the confidence information.
[0127] By using a deep convolutional neural network model, the model learns the structural characteristics of different crosshair types, enabling detection even when some are missing. Furthermore, a weighted clustering analysis algorithm designed for new types of crosshair defects is incorporated, and further intersection optimization is performed. Finally, the center coordinates of the target standard line are calculated based on the center position information, bounding box information from the crosshair detection data, and confidence information, further improving the accuracy of crosshair positioning.
[0128] See also Figure 2 The present application provides an embodiment of a method for generating a crosshair correction, comprising:
[0129] 201. Locating saddle points on saddle point images by adaptive multi-scale feature fusion method;
[0130] Since optical imaging systems are inevitably affected by lens processing errors and assembly deviations during the manufacturing and installation process, the alignment may be offset, deformed, and tilted during the imaging process, which will adversely affect the subsequent precise positioning and detection accuracy.
[0131] In this embodiment, the terminal locates saddle points on saddle point images using an adaptive multi-scale feature fusion method. Traditional methods use a single-scale Hessian matrix that cannot adapt to the corner features (saddle point features) of checkerboard squares in a chessboard image because corner features exist at different scales. This embodiment introduces a multi-scale Hessian matrix calculation for saddle point features, enhancing adaptability to saddle point images of varying resolutions.
[0132] Define Hessian matrices of different scales:
[0133]
[0134] in: , , is the second-order partial derivative after Gaussian smoothing:
[0135]
[0136]
[0137]
[0138] Among them, I is the saddle point image, x and y are the coordinates in the saddle point image, is a standard Gaussian kernel:
[0139]
[0140] Calculating different scales The Hessian matrix eigenvalue of , taking the maximum response point as the saddle point:
[0141]
[0142] Thus the position of saddle point is tentatively determined. The embodiment of the present application calculates the eigenvalue of Hessian matrix under different scales, obtains response map (responsemaps) with this, then finds out response maximum point as " saddle point ", the eigenvalue of Hessian matrix represents the strength (curvature) of local area second order variation, and namely large eigenvalue represents that gradient changes quickly, and then can represent that image structure is remarkable (saddle point). So-called " response value " of response map is constructed in the following way:
[0143] 1. Determinant , and is the determinant The eigenvalue of .
[0144] 2. Eigenvalue combination (such as the approximate determinant used by SURF).
[0145] 3. Geometric interpretation of eigenvalues (such as Frangi filter).
[0146] Therefore, each pixel value on the "response map" is actually a certain combination of eigenvalues, that is, the response value Hessian eigenvalue.
[0147] In fact, the "maximum response point" does not refer to the only maximum value in the entire saddle point image, but the "local maximum point", which has local maxima in space and scale.
[0148] The detection process actually begins by generating a response map Ri(x,y) at each scale σ¡. A three-dimensional response space, R(x,y,σ), is then constructed. Next, this response space is searched for local maxima in the spatial (x,y) dimension, as well as local maxima along the scale (relative to the scales above and below). All points that meet these maxima are considered "candidate saddle points." Therefore, "multiple saddle points" arise from multiple local maxima in the response space, each of which corresponds to a truly significant image structure (such as the center of a checkerboard grid).
[0149] 202. When there is a missing saddle point, a polynomial fitting is performed on the determined saddle points to generate several fitting curves;
[0150] When there is a missing saddle point, the terminal performs polynomial fitting on the determined saddle points to generate several fitting curves. Specifically, first determine a set of n data points from the existing saddle points. , using a polynomial fit:
[0151]
[0152] Construct the fitting matrix equation:
[0153]
[0154]
[0155]
[0156] The terminal then solves the equation:
[0157]
[0158] in is a 3x3 matrix, is the polynomial coefficient vector to be solved. After solving, the expression of the fitting curve can be obtained.
[0159] 203. Perform interpolation processing and intersection calculation on the missing saddle points according to several fitting curves to complete the missing saddle points;
[0160] Next, the terminal interpolates and calculates the intersection of the missing saddle points based on several fitted curves to complete the missing saddle points. Specifically, the terminal determines the number of data points (missing saddle points) to be extrapolated leftward and rightward, and generates new x-values for the independent variable based on a set step size (usually the length of the checkerboard grid). The corresponding y-values are then calculated using the fitting equation constructed in the previous step, resulting in a set of uniformly distributed row and column coordinates. Based on this, the region of the two fitted curves is constructed, and the coordinates of their intersection are further solved to update the matrix data. Ultimately, all saddle points on the checkerboard grid are accurately extracted.
[0161] 204. Generate a homography matrix based on all completed saddle points and the reference saddle points on the standard template, and perform preliminary distortion correction on the crosshairs of the display screen image using the homography matrix.
[0162] The terminal generates a homography matrix based on all completed saddle points and the reference saddle points on the standard template, and uses the homography matrix to perform preliminary distortion correction on the crosshairs of the display image.
[0163] Through step 203, all saddle points in the saddle point image can be obtained and their coordinates can be determined. , assuming that the standard coordinates of the chessboard are , the relationship between the two can be expressed as:
[0164]
[0165] Where H is the perspective transformation matrix to be obtained, as shown below:
[0166]
[0167] Based on the correspondence between the determined saddle points and the ideal checkerboard points, a matching point set (i.e., the saddle point matrix and the standard point matrix) can be constructed, and this relationship can be used to perform high-precision geometric correction to effectively compensate for image distortion and improve the overall calibration accuracy.
[0168] like Figure 10 As shown in Figure 2, the saddle point position extracted by the traditional straight line fitting method has a certain deviation; Figure 11 The chessboard saddle points extracted based on the method of the present invention are shown, from which it can be clearly seen that the method used in this embodiment is significantly better than the traditional straight line fitting method in terms of saddle point positioning accuracy.
[0169] As the structure of the target display screen becomes increasingly complex, both the saddle point image and the display screen image are distorted. After distortion correction, the position of the crosshairs has been preliminarily adjusted for the display screen image. However, due to various defects and structural improvements in different types of display screens (especially improvements in the circuit area on the pixel layer), the crosshairs used for each display screen during detection are different. In this embodiment, the weight of the crosshair feature is It is determined by the structure type (structural complexity) of different detection areas of the display screen, the crosshairs, the adaptation value of the structure, and the distance between the crosshairs and the sampling center.
[0170] Assume there are 7 crosshairs on a target display, please refer to Figure 12 , Figure 12 This is the display screen image in this embodiment. Seven crosshairs are also displayed on the display screen image. The crosshairs can be marked with numbers. The crosshairs at the edge are more important. When a complex structure such as a circuit area is set below the pixel layer of the target display screen, the crosshairs on this circuit structure are more important. The lower the adaptability of the crosshair type to the structure, the higher the importance. The meaning of adaptability is that when the crosshairs are located on such structures, the higher the regional detection accuracy, the greater the adaptability design, and vice versa. It is a value greater than 0 and less than 1. Usually, the crosshair type with the largest adaptability is selected for detection. The calculation formula is as follows:
[0171]
[0172] In this embodiment, represents the structural weight of the crosshairs, Indicates the structural complexity level parameter of the area where the crosshair is located, Indicates the weight of the distance between the standard position of the crosshair and the center of the acquisition camera (the farther the distance, the greater the weight). represents the structural fitness parameter, Indicates the bottom value, which is used to prevent the crosshair's structural weight from falling below the preset threshold. It will only be used if the crosshair's structural weight is lower than the preset threshold. 、 、 They are respectively the weighted values of the structural complexity level parameter, the distance ratio value, and the structural fitness parameter, which are usually designed according to the content of the test item and will not be elaborated here.
[0173] See also Figure 3 The present application provides an embodiment of a method for determining intersection information of directrixes, comprising:
[0174] 301. Performing area screening on the display screen image according to the border information in the guideline detection data;
[0175] 302. Calculate the gradients of the display screen image in the horizontal and vertical directions after the region is screened out to extract potential edge information;
[0176] 303. Filter the local maximum value along the gradient direction according to the two preset thresholds, retain only the significant edge points, and remove non-critical edges;
[0177] 304. Perform straight line detection on the display screen image after edge detection according to Hough transform to determine the intersection point information of the directrix.
[0178] Traditional methods typically require complex calculations on the entire image, resulting in high computational overhead during crosshair centering and defect detection, which reduces detection efficiency and makes it difficult to meet high real-time requirements. To address this issue, the crosshair bounding box (border information) detected by the YOLOv9 model is used to crop the corresponding area from the display image, reducing computational overhead and performing edge detection and intersection extraction only within the region of interest.
[0179] The basic process of edge detection is as follows:
[0180] (1) Calculate the gradient of the display image: Calculate the gradient of the image in the horizontal and vertical directions to extract potential edge information.
[0181] (2) Filter local maxima along the gradient direction and retain only significant edge points to remove non-critical edges.
[0182] (3) Double threshold processing: Set two thresholds, high and low, to ensure that the detected edges are not affected by noise and that key structures are not missed.
[0183] After edge detection, line detection is performed using a designed weighted Hough transform. This method transforms the image space into a polar coordinate space, transforming the line detection problem into peak detection in parameter space. The detection results are expressed in polar coordinates, where each point corresponds to a line. By analyzing the set of detected lines, the intersection of the crosshairs can be further determined.
[0184] See also Figure 4 The present application provides an embodiment of a method for training a deep convolutional neural network model, wherein the alignment detection data further includes type information, including:
[0185] 401. Annotate the initial crosshairs on the display screen image to generate a reference crosshair frame, and associate a reference feature tag of the crosshairs with the reference crosshair frame. The reference feature tag includes a type feature tag, a position feature tag, and a confidence feature tag.
[0186] 402. Train a deep convolutional neural network model based on the bounding box information, type information, confidence information, type feature label, position feature label, and confidence feature label as well as a preset composite loss function.
[0187] In this embodiment, since the positioning detection of the crosshairs is affected by the crosshairs' defects, there will usually be a situation where multiple crosshairs are mispositioned and the type judgment is misjudged.
[0188] In this embodiment, to enhance the model's detection effectiveness, a new YOLOv9 model was constructed to detect target crosshair positioning. Because the new YOLOv9 model offers high detection speed and good accuracy, in this embodiment, the terminal uses the YOLOv9 model to extract features from the input display screen image using a deep convolutional neural network (CNN) and predict the target's location and category using regression methods. If necessary, before inputting the model for detection, the bounding box of each crosshair in the display screen image can be manually or machine-annotated. The format for each crosshair annotation is [category, x1, y1, x2, y2], where (x1, y1) and (x2, y2) represent the coordinates of the upper left and lower right corners of the bounding box, respectively. This is then analyzed with the model output.
[0189] During the training process, the model optimizes the detection results by generating multiple candidate boxes and comparing them with the real labeled boxes. Specifically, during the training process, the crosshair classification data, confidence, and position are used as multiple loss value items. Specifically, in the embodiment of the present application, the position feature is designed as a combination of the border difference loss and the intersection-over-union loss. Compared with the defective characteristics of the crosshairs, the loss value item of the position feature is more consistent with the characteristics of the crosshairs. The loss function is used to measure the error between the prediction result and the real label. The loss function L is as follows:
[0190]
[0191] in, : Classification loss, measuring the error of the model under the classification task, is the weight coefficient of classification loss. : Target loss, which measures the confidence of whether the model correctly identifies the target. is the weight coefficient of the target loss. : Bounding box regression loss, which measures the difference between the predicted bounding box and the true bounding box, is the weight coefficient of the bounding box regression loss. : Intersection-over-Union loss, used to optimize the overlap between the predicted box and the true box. The parameters before each loss value are the corresponding weight parameters. is the weight coefficient of the intersection-over-union loss.
[0192] See also Figure 5 , the present application provides an embodiment of a method for crosshair defect detection, comprising:
[0193] 501. Constructing a ROI region for detecting a crosshair according to the center coordinates of the target standard line;
[0194] Using the aforementioned method, the center coordinates (x, y) of the crosshair are extracted. Using this center point as a reference, the region of interest (ROI) is constructed by expanding the image horizontally and vertically to a certain extent. The size of the ROI can be appropriately set based on the image resolution and the actual size of the crosshair to ensure the accuracy and robustness of subsequent analysis.
[0195] 502. Perform grayscale projection processing on the ROI area to generate a grayscale projection sequence;
[0196] Horizontal grayscale projection: within the ROI area, the mean grayscale value of each horizontal scan line is calculated to construct a horizontal grayscale projection sequence. This sequence is saved and can be used to analyze the integrity of the crosshairs and possible defects.
[0197] For the i-th row, the grayscale projection value The calculation formula is:
[0198]
[0199] in:
[0200] is the grayscale value of the pixel in the ith row and xth column in the ROI area.
[0201] is the width of the ROI area, that is, the number of pixels in the horizontal range.
[0202] Indicates the horizontal scanning area of the line.
[0203] Vertical grayscale projection is similar to horizontal projection. In the ROI area, the mean grayscale value of each vertical scan line is calculated to construct a vertical grayscale projection sequence, which is then saved.
[0204] For the jth column, the grayscale projection value The calculation formula is:
[0205]
[0206] in:
[0207] is the grayscale value of the pixel in the jth column and yth row in the ROI area.
[0208] is the height of the ROI area, that is, the number of pixels in the vertical range.
[0209] Indicates the vertical scan area of the column.
[0210] 503. Generate dynamic grayscale projection change threshold information based on the defect projection fluctuation law;
[0211] 504. Perform crosshair defect detection on the grayscale projection sequence according to the dynamic grayscale projection change threshold information to generate a first crosshair detection result.
[0212] In this embodiment, the detection capability of various defects of the crosshairs is poor. When the crosshairs are broken, missing, or pixels are stuck, the existing methods are easily affected by background noise and local morphological changes during the segmentation and recognition process, resulting in limited defect detection capability and affecting the stability and robustness of the detection.
[0213] The projection sequence values obtained in step 502 are saved. Traditional grayscale projection methods typically rely on a fixed threshold to distinguish normal grayscale fluctuations from potential defect areas. To improve detection stability and adaptability, this embodiment introduces an adaptive trend threshold that dynamically adjusts the threshold for each region using the image's local mean or local standard deviation. This allows for the application of appropriate thresholds to different regions, even if the brightness distribution within the display image varies, greatly enhancing the robustness of the algorithm. During the detection process, a dynamic grayscale projection change threshold T (dynamic grayscale projection change threshold information) is first generated. This threshold is used to distinguish normal projection fluctuations from potential defect areas.
[0214] In horizontal and vertical grayscale projection, if the projection value of a certain area or If a significant drop occurs in a certain area and the drop exceeds the set threshold T, it can be determined that there may be potential abnormal points in the area.
[0215] By detecting continuous regions with grayscale values below a threshold, we can mark missing or broken parts. To avoid noise interference, during the grayscale value detection process, a sliding window technique is used to analyze the grayscale change trend within the local area, ensuring that the detected abnormal areas have structured features rather than single point noise.
[0216] See also Figure 6, the present application provides another embodiment of a method for crosshair defect detection, comprising:
[0217] 601. Construct image layers of different resolutions on the ROI area, use a pyramid structure to perform multi-scale analysis on the crosshairs, and generate a second crosshair detection result.
[0218] Considering the scale variations of the crosshairs in different scenarios, grayscale projection analysis at a single scale may not be sufficient to detect all defects. Therefore, an image pyramid is constructed to process images of different resolutions to enhance detection capabilities.
[0219] In this embodiment, an image pyramid is also used. Specifically, by constructing image layers of different resolutions, a pyramid structure is used to perform multi-scale analysis on the ROI area of the crosshair, ensuring that the algorithm can adapt to crosshairs of different sizes.
[0220] See also Figure 7 , the present application provides another embodiment of a method for crosshair defect detection, comprising:
[0221] 701. Perform grayscale projection and defect detection on the grayscale projection sequence at different scales to generate a third directrix detection result.
[0222] Considering the scale variations of the crosshairs in different scenarios, a single-scale grayscale projection analysis may not be sufficient to detect all defects. Therefore, a multi-scale analysis method is also chosen to enhance the detection capability.
[0223] Layer-by-layer grayscale projection and defect detection performs grayscale projection and defect detection at multiple scales of the display image, and fuses the detection results at each scale to improve the recognition accuracy of defect areas.
[0224] See also Figure 8 The present application provides an embodiment of a device for positioning a crosshair of a display screen image, comprising:
[0225] The acquisition unit 801 is used to input the designed crosshair image and chessboard image into the target display screen, and acquire the display screen image and saddle point image through the acquisition camera. There are several crosshairs on the display screen image and several saddle points on the saddle point image.
[0226] a correction unit 802 for performing preliminary distortion correction on the crosshairs of the display screen image using the saddle points on the saddle point image;
[0227] Optionally, the correction unit 802 includes:
[0228] The saddle point on the saddle point image is located by adaptive multi-scale feature fusion method;
[0229] When there is a missing saddle point, a polynomial fit is performed on the determined saddle points to generate several fitting curves;
[0230] Interpolation processing and intersection calculation of missing saddle points are performed based on several fitting curves to complete the missing saddle points;
[0231] A homography matrix is generated according to all completed saddle points and the reference saddle points on the standard template, and the crosshairs of the display image are preliminarily rectified by the homography matrix.
[0232] A first generating unit 803 is configured to perform line analysis on the display screen image using a deep convolutional neural network model to generate line detection data, where the line detection data includes border information and confidence information;
[0233] The fourth generating unit 804 is configured to perform region annotation on the initial crosshair on the display screen image, generate a reference crosshair frame, and associate a reference feature tag of the crosshair with the reference crosshair frame, where the reference feature tag includes a type feature tag, a position feature tag, and a confidence feature tag.
[0234] A training unit 805 is configured to train a deep convolutional neural network model based on the bounding box information, type information, confidence information, type feature labels, position feature labels, and confidence feature labels, as well as a preset composite loss function;
[0235] A determination unit 806 is configured to perform edge detection on the display screen image based on the frame information in the directrix detection data, and then perform line detection to determine directrix intersection information;
[0236] Optionally, the determining unit 806 includes:
[0237] Performing area screening on the display screen image based on the border information in the alignment detection data;
[0238] Calculate the horizontal and vertical gradients of the display screen image after area screening to extract potential edge information;
[0239] According to the two preset thresholds and along the gradient direction, the local maximum is screened and only significant edge points are retained to remove non-critical edges;
[0240] The display screen image after edge detection is subjected to straight line detection according to Hough transform to determine the intersection point information of the directrix.
[0241] The second generating unit 807 is configured to cluster the slope features in the line intersection information using a weighted cluster analysis method to generate a plurality of line categories and cluster centers of the line categories;
[0242] A third generating unit 808 is configured to generate center position information of a crosshair according to a plurality of line categories and cluster centers;
[0243] A calculation unit 809 is used to calculate the center coordinates of the target standard line based on the center position information, the frame information and the confidence information in the alignment line detection data;
[0244] A detection unit 810 is configured to construct a ROI region for detecting a crosshair according to the center coordinates of the target standard line;
[0245] A fifth generating unit 811 is configured to perform grayscale projection processing on the ROI region to generate a grayscale projection sequence;
[0246] The sixth generating unit 812 is configured to generate dynamic grayscale projection change threshold information based on the defect projection fluctuation rule;
[0247] A seventh generating unit 813 is configured to perform crosshair defect detection on the grayscale projection sequence according to the dynamic grayscale projection change threshold information to generate a first crosshair detection result;
[0248] An eighth generating unit 814 is configured to construct an image hierarchy with different resolutions in the ROI region, perform multi-scale analysis on the crosshairs using a pyramid structure, and generate a second crosshair detection result;
[0249] The ninth generating unit 815 is configured to perform grayscale projection and defect detection on the grayscale projection sequence at different scales to generate a third alignment detection result.
[0250] See also Figure 9 , the present application provides a device for positioning a crosshair of a display screen image, comprising:
[0251] Processor 901 , memory 902 , input / output unit 903 , and bus 904 .
[0252] The processor 901 is connected to the memory 902 , the input / output unit 903 , and the bus 904 .
[0253] The memory 902 stores a program, and the processor 901 calls the program to execute the following Figure 1 、 Figure 2 and Figure 3 、 Figure 4 、 Figure 5 、 Figure 6 and Figure 7 Positioning method in .
[0254] The present application provides a computer-readable storage medium, wherein a program is stored on the computer-readable storage medium, and when the program is executed on a computer, the program performs the following operations: Figure 1 、 Figure 2 and Figure 3、 Figure 4 、 Figure 5 、 Figure 6 and Figure 7 Positioning method in .
[0255] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0256] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0257] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present application.
[0258] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0259] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk, and other media that can store program code.
Claims
1. A method for positioning a crosshair of a display screen image, characterized in that: include: Inputting the designed crosshair image and chessboard image into the target display screen, and collecting the display screen image and saddle point image by using the acquisition camera, wherein the display screen image has a plurality of crosshairs and the saddle point image has a plurality of saddle points; performing preliminary distortion correction on the crosshairs of the display screen image through the saddle points on the saddle point image; The step of performing preliminary distortion correction on the crosshairs of the display screen image by using the saddle points on the saddle point image comprises: locating the saddle points on the saddle point image by using an adaptive multi-scale feature fusion method; When a saddle point is missing, polynomial fitting is performed on the determined saddle points to generate a plurality of fitting curves; interpolation processing and intersection calculation are performed on the missing saddle points according to the plurality of fitting curves to complete the missing saddle points; a homography matrix is generated based on all completed saddle points and reference saddle points on a standard template, and preliminary distortion correction is performed on the crosshairs of the display screen image using the homography matrix; Performing line analysis on the display screen image using a deep convolutional neural network model to generate line detection data, wherein the line detection data includes border information and confidence information; Performing edge detection on the display screen image according to the frame information in the alignment detection data, and then performing straight line detection to determine alignment intersection information; Clustering the slope features in the directrix intersection information using a weighted cluster analysis method to generate a number of straight line categories and cluster centers of the straight line categories; generating center position information of a crosshair according to the plurality of line categories and the cluster center; The center coordinates of the target standard line are calculated according to the center position information, the frame information in the guideline detection data, and the confidence information.
2. The positioning method according to claim 1, wherein: The step of performing edge detection on the display screen image according to the frame information in the directrix detection data, and then performing straight line detection to determine directrix intersection information comprises: Performing area screening on the display screen image according to the border information in the alignment detection data; Calculating the gradients of the display screen image in the horizontal and vertical directions after the region is screened out to extract potential edge information; According to the two preset thresholds and along the gradient direction, the local maximum is screened and only significant edge points are retained to remove non-critical edges; The display screen image after edge detection is subjected to straight line detection according to Hough transform to determine the intersection point information of the directrix.
3. The positioning method according to claim 1, wherein: The alignment detection data also includes type information; After the step of performing line analysis on the display screen image using a deep convolutional neural network model to generate line detection data, the positioning method further includes: Performing regional annotation on the initial crosshairs on the display screen image to generate a reference crosshair frame, and associating a reference feature tag of the crosshairs with the reference crosshairs frame, wherein the reference feature tag includes a type feature tag, a position feature tag, and a confidence feature tag; The deep convolutional neural network model is trained according to the border information, the type information, the confidence information, the type feature label, the position feature label and the confidence feature label and a preset composite loss function.
4. The positioning method according to any one of claims 1 to 3, characterized in that: After the step of calculating the center coordinates of the target standard line according to the center position information, the frame information in the guideline detection data, and the confidence information, the positioning method further includes: Constructing a ROI region for detecting a crosshair according to the center coordinates of the target standard line; Performing grayscale projection processing on the ROI area to generate a grayscale projection sequence; Generate dynamic grayscale projection change threshold information based on the defect projection fluctuation law; A crosshair defect detection is performed on the grayscale projection sequence according to the dynamic grayscale projection change threshold information to generate a first crosshair detection result.
5. The positioning method according to claim 4, characterized in that: After the step of constructing an ROI region for detecting a crosshair according to the center coordinates of the target standard line, the positioning method further includes: An image hierarchy with different resolutions is constructed on the ROI area, and a multi-scale analysis is performed on the crosshairs using a pyramid structure to generate a second crosshair detection result.
6. The positioning method according to claim 4, characterized in that: After performing grayscale projection processing on the ROI area to generate a grayscale projection sequence, the positioning method further includes: Grayscale projection and defect detection are performed on the grayscale projection sequence at different scales to generate a third alignment detection result.
7. A device for positioning a crosshair of a display screen image, characterized in that: include: an acquisition unit, configured to input the designed crosshair image and chessboard image into a target display screen, and acquire a display screen image and a saddle point image through an acquisition camera, wherein the display screen image has a plurality of crosshairs and the saddle point image has a plurality of saddle points; a correction unit, configured to perform preliminary distortion correction on the crosshairs of the display screen image through the saddle points on the saddle point image; The correction unit is specifically configured to: locate saddle points on the saddle point image using an adaptive multi-scale feature fusion method; when a saddle point is missing, perform polynomial fitting on the determined saddle points to generate a plurality of fitting curves; perform interpolation processing and intersection calculation on the missing saddle points according to the plurality of fitting curves to complete the missing saddle points; generate a homography matrix based on all completed saddle points and reference saddle points on a standard template, and perform preliminary distortion correction on the crosshairs of the display screen image using the homography matrix; A first generating unit is configured to perform a line analysis on the display screen image using a deep convolutional neural network model to generate line detection data, wherein the line detection data includes border information and confidence information; a determination unit, configured to perform edge detection on the display screen image based on the frame information in the directrix detection data, and then perform line detection to determine directrix intersection information; a second generating unit, configured to cluster the slope features in the directrix intersection information using a weighted clustering analysis method to generate a plurality of straight line categories and cluster centers of the straight line categories; a third generating unit, configured to generate center position information of a crosshair according to the plurality of line categories and the cluster center; A calculation unit is used to calculate the center coordinates of the target standard line based on the center position information, the frame information in the guideline detection data and the confidence information.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a program, and when the program is executed on a computer, the positioning method according to any one of claims 1 to 6 is executed.
Citation Information
Patent Citations
Sub-pixel detection method for cross-like laser image center
CN115164718A
Cross image center positioning method based on unsupervised machine learning
CN118918191A