Ghosting detection method and device, terminal equipment and storage medium

By preprocessing and convolutional operations on the initial image of the optical waveguide lens, the distance parameters between the target objects are calculated, and the precise positioning of ghosting problems in the production of optical waveguide lenses is solved, and product quality and user satisfaction are improved.

CN119722558APending Publication Date: 2025-03-28ZHUHAI MOJIE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311261587.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-27
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

During the production of optical waveguide lenses, grating period changes due to non-parallel between surfaces or uneven stress distribution of working molds, and ghosting problems may occur. The prior art cannot accurately locate whether there is ghosting of optical waveguide lenses.

Method used

By obtaining the initial image of the object to be inspected, performing image preprocessing to obtain the target image, determining the area to be inspected, using the image convolution kernel to perform convolution operations on the area to be inspected, computing the distance parameters between the target objects in the convolution image, and obtaining ghost detection results based on the distance parameters.

Benefits of technology

It realizes accurate identification of whether there is ghosting problem in optical waveguide lenses, ensures product quality and improves user satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119722558A_ABST
    Figure CN119722558A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a ghosting detection method and device, terminal equipment and a storage medium, and belongs to the technical field of optical display. The method comprises the following steps: obtaining an initial image obtained by carrying out optical measurement on a to-be-detected object, and carrying out image preprocessing on the initial image to obtain a target image; determining a to-be-detected area from the target image; determining an image convolution kernel, and performing convolution operation on the to-be-detected area through the image convolution kernel to obtain a convolution image corresponding to the to-be-detected area; determining a first target object and a second target object in the convolution image, and calculating a distance parameter between the first target object and the second target object; and obtaining a ghosting detection result corresponding to the to-be-detected object according to the distance parameter. The method is mainly used for solving the problems that the optical waveguide lens manufactured in the prior art may have ghosting, but the optical waveguide lens cannot be accurately positioned during ghosting detection, and the ghosting is accurately identified, so that the product quality is ensured, and the user satisfaction is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of optical display technology, and in particular to a ghosting detection method, device, terminal equipment and storage medium. Background Art

[0002] With the development of the AR industry, the mainstream technical solutions in the early market were mainly glass substrate optical waveguides. However, due to the weight constraints of glass materials, they could not meet the needs of end users to wear AR glasses comfortably all day long. To solve this problem, resin diffraction optical waveguide technology came into being.

[0003] In the process of manufacturing optical waveguide lenses, due to the uneven stress distribution of the working mold, the grating period changes, which may cause ghosting problems; or in the process of manufacturing optical waveguide lenses, the non-parallelism between the surfaces may also cause the obtained optical waveguide lenses to have ghosting problems, thereby affecting the user experience.

[0004] Therefore, it is necessary to detect whether the optical waveguide lens has ghosting problems during the quality inspection process to ensure product quality and improve user satisfaction. Summary of the invention

[0005] The main purpose of the embodiments of the present invention is to provide a ghosting detection method, device, terminal equipment and storage medium, aiming to solve the problem that in the process of manufacturing the optical waveguide lens, the optical waveguide lens may have ghosting due to the non-parallelism between the surfaces or the uneven stress distribution of the working mold, which leads to the change of the grating period. However, in the prior art, it is impossible to accurately locate whether the optical waveguide lens has ghosting.

[0006] In a first aspect, an embodiment of the present invention provides a ghosting detection method, comprising:

[0007] Acquire an initial image obtained by optical measurement of the object to be inspected, and perform image preprocessing on the initial image to obtain a target image;

[0008] Determining a region to be inspected from the target image;

[0009] Determine an image convolution kernel, and perform a convolution operation on the area to be inspected by using the image convolution kernel to obtain a convolution image corresponding to the area to be inspected;

[0010] Determine a first target object and a second target object in the convolution image, and calculate a distance parameter between the first target object and the second target object;

[0011] A ghost detection result corresponding to the object to be detected is obtained according to the distance parameter.

[0012] In a second aspect, an embodiment of the present invention provides a ghosting detection device, comprising:

[0013] An image acquisition module is used to acquire an initial image obtained by optical measurement of the object to be inspected, and perform image preprocessing on the initial image to obtain a target image;

[0014] A data processing module, used for determining a region to be inspected from the target image;

[0015] A convolution processing module, used to determine an image convolution kernel, and perform a convolution operation on the area to be inspected through the image convolution kernel to obtain a convolution image corresponding to the area to be inspected;

[0016] An image processing module, used to determine a first target object and a second target object in the convolution image, and calculate a distance parameter between the first target object and the second target object;

[0017] The ghost detection module is used to obtain the ghost detection result corresponding to the object to be detected according to the distance parameter.

[0018] In a third aspect, an embodiment of the present invention further provides a terminal device, comprising a processor, a memory, a computer program stored in the memory and executable by the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein when the computer program is executed by the processor, the steps of any one of the ghosting detection methods provided in the specification of the present invention are implemented.

[0019] In a fourth aspect, an embodiment of the present invention further provides a storage medium for computer-readable storage, characterized in that the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any ghosting detection method provided in the specification of the present invention.

[0020] The embodiment of the present invention provides a ghost detection method, device, terminal equipment and storage medium, wherein the method includes obtaining an initial image obtained by optical measurement of an object to be inspected, and performing image preprocessing on the initial image to obtain a target image; determining the area to be inspected from the target image; determining an image convolution kernel, and performing a convolution operation on the area to be inspected through the image convolution kernel to obtain a convolution image corresponding to the area to be inspected; determining a first target object and a second target object in the convolution image, and calculating a distance parameter between the first target object and the second target object; and obtaining a ghost detection result corresponding to the object to be inspected according to the distance parameter. The method solves the problem that the optical waveguide lens may have ghosts due to the non-parallelism between the surfaces or the uneven stress distribution of the working mold causing the grating period to change during the production of the optical waveguide lens, but the problem that the optical waveguide lens cannot be accurately located whether there is ghosting in the prior art is solved. The accurate identification of whether the optical waveguide lens has ghosting problems is achieved, which ensures product quality and improves user satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0022] Figure 1 A schematic flow chart of a ghosting detection method provided by an embodiment of the present invention;

[0023] Figure 2 A schematic diagram of an initial image provided by an embodiment of the present invention;

[0024] Figure 3 A schematic diagram of a grayscale transformation result provided by an embodiment of the present invention;

[0025] Figure 4 A schematic diagram of an image normalization result provided by an embodiment of the present invention;

[0026] Figure 5 A schematic diagram of an image convolution result provided by an embodiment of the present invention;

[0027] Figure 6 A schematic diagram of an image inversion result provided by an embodiment of the present invention;

[0028] Figure 7 A schematic diagram of a top-hat transformation result provided by an embodiment of the present invention;

[0029] Figure 8 Another schematic diagram of an initial image provided by an embodiment of the present invention;

[0030] Fig. 9 for Figure 1 Schematic diagram of the process of sub-step S103 of the ghost detection method in FIG.

[0031] Fig.10 A schematic diagram of a convolution result of convolving a region to be inspected with a first convolution kernel provided in an embodiment of the present invention;

[0032] Fig.11 A schematic diagram of a convolution result of convolving the area to be inspected with the second convolution kernel provided in an embodiment of the present invention;

[0033] Fig.12 A schematic diagram of a convolution image corresponding to a region to be inspected provided in an embodiment of the present invention;

[0034] Fig.13 A schematic diagram of a scenario for implementing the ghosting detection method provided in this embodiment;

[0035] Fig.14 A schematic diagram of a module of a ghosting detection device provided by an embodiment of the present invention;

[0036] Fig.15 A schematic block diagram of the structure of a terminal device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0037] 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 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.

[0038] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0039] It should be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0040] The embodiment of the present invention provides a ghosting detection method, apparatus, terminal device and storage medium. The ghosting detection method can be applied to a terminal device, which can be an electronic device such as a tablet computer, a laptop computer, a desktop computer, a personal digital assistant and a wearable device. The terminal device can be a server or a server cluster.

[0041] Some embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0042] Please refer to Figure 1 , Figure 1 A schematic flow chart of a ghosting detection method provided by an embodiment of the present invention.

[0043] like Figure 1 As shown, the ghosting detection method includes steps S101 to S105.

[0044] Step S101 : acquiring an initial image obtained by optical measurement of an object to be inspected, and performing image preprocessing on the initial image to obtain a target image.

[0045] Exemplarily, optical measurement is to use an acquisition system to acquire and image a light beam or light machine after it passes through the object to be inspected, so as to obtain an initial image, and then perform ghost detection on the initial image, wherein when performing ghost detection, the ghosting degree between the target object in the initial image and the ghost object corresponding to the target object is mainly detected. However, since the position of the ghost object is projected on the edge of the target object and the ghost object is darker than the target object, the grayscale value of the target object can usually reach 30 times the grayscale value of the ghost object. At the same time, since the images acquired when the same light machine is used to detect different waveguides cannot be overexposed, in this case, some images acquired by the brightness meter have a smaller overall grayscale value. In order to reflect the ghost object and the target object in the acquired image, the acquisition system needs to acquire a 16-bit image with a pixel value range of 0 to 65535, so as to obtain the initial image.

[0046] Exemplarily, after acquiring the initial image, image preprocessing operations such as image filtering and image denoising are performed on the initial image to obtain a target image corresponding to the initial image.

[0047] In some embodiments, the initial image is subjected to image preprocessing to obtain a target image, including: performing grayscale transformation on the initial image to obtain a grayscale image; performing image normalization on the grayscale image to obtain a normalized image; and at least performing convolution processing on the normalized image to obtain a target image.

[0048] For example, Figure 2 As shown, the two circles in the figure are used as reference positions to facilitate positioning of the corresponding ghost detection targets. The five vertical lines in the figure are the ghost detection targets during ghost detection, that is, the severity of the ghosting corresponding to the initial image is judged by checking the five vertical lines in the figure.

[0049] Exemplarily, in the ghost detection process, each horizontal line in the figure includes the target object and the ghost object corresponding to the target object. In order to better separate the target object and the ghost object, the initial image is gray-scale transformed to obtain a gray-scale image. The gray-scale transformation can be implemented by nonlinear gray-scale transformation, such as exponential transformation. The formula of exponential transformation is shown in Formula 1.

[0050] G=G Exponent (Formula 1)

[0051] Among them, G is the pixel value corresponding to each position in the initial image, G represents the pixel value corresponding to the corresponding position after exponential transformation, and Exponent is the exponent, which is generally 0.25, 0.5, 2, 3, 4, etc.

[0052] For example, Figure 3 As shown, Figure 2 Taking the area containing vertical lines as an example, after grayscale transformation of this area, we can get the following Figure 3 The effect shown.

[0053] Exemplarily, a nonlinear grayscale transformation is performed on the initial image to obtain a corresponding grayscale image, and then the grayscale image is normalized to obtain a normalized image.

[0054] For example, the pixel value of the grayscale image is normalized to between 0 and 255, and the normalization formula is shown in Formula 2. The grayscale image is normalized according to Formula 2 to obtain a corresponding normalized image.

[0055] g'=G*Mult+Add (Formula 2)

[0056] in, Add=-Mult*G min , G is the pixel value corresponding to the grayscale image, g' is the pixel value corresponding to the normalized image, G max is the maximum pixel value in the grayscale image, G min is the minimum pixel value in the grayscale image.

[0057] For example, Figure 4 As shown, Figure 3 After normalization using formula 2, we can get Figure 4 The effect shown.

[0058] Exemplarily, a convolution kernel is set so as to obtain a target image by performing convolution processing on the normalized image using the convolution kernel.

[0059] In some embodiments, the at least convolution processing of the normalized image to obtain the target image includes: convolving the normalized image with a derivative of a Gaussian function to obtain convolution data; calculating the second-order derivative of the convolution data in a preset direction to obtain a first intermediate image, wherein the preset direction includes a first direction and / or a second direction; and smoothing the first intermediate image to obtain the target image.

[0060] Exemplarily, the preset direction is one or more of a first direction and a second direction, wherein the first direction is an x ​​direction and the second direction is a y direction. When the ghost detection target in the initial image is a vertical line, the preset direction is the x direction; and when the ghost detection target in the initial image is a horizontal line, the preset direction is the y direction.

[0061] Exemplarily, assuming that the ghost detection target in the current initial image is a vertical line, the preset direction is the x direction, then the normalized image is first convolved with the derivative of the Gaussian function to obtain convolution data, and then the second-order derivative of the convolution data in the x direction is calculated to obtain a first intermediate image, and then the first intermediate image is smoothed to obtain the target image.

[0062] For example, the normalized image and the derivative of the Gaussian function are convolved to obtain convolution data. At this time, sigma is taken to be 0.8, and the preset direction is the x direction. Then the second-order derivative of the convolution data in the x direction is calculated to obtain the first intermediate image. For example, derivate_gauss(normalized image, first intermediate image, 0.8, 'xx') is used to obtain the first intermediate image corresponding to the normalized image. Among them, 'xx' represents the second-order derivative along the x direction.

[0063] Exemplarily, the first intermediate image is smoothed using a smoothing algorithm to obtain a target image.

[0064] For example, the first intermediate image is convolved with the derivative of the Gaussian function, and sigma is set to 1. The first intermediate image is smoothed using the derivate_gauss(first intermediate image, target image, 1, 'none') function to obtain the target image. 'none' means that only the input image - the first intermediate image is smoothed.

[0065] For example, Figure 4 The displayed image is convolved with the derivative of the Gaussian function to obtain convolution data, the second-order derivative of the convolution data in the x direction is calculated to obtain a first intermediate image, and the first intermediate image is smoothed to obtain a target image such as Figure 5 shown.

[0066] Exemplarily, assuming that the ghost detection target in the current initial image is a horizontal line and the preset direction is the y direction, the normalized image is first convolved with the derivative of the Gaussian function to obtain convolution data, and then the second-order derivative of the convolution data in the y direction is calculated to obtain a first intermediate image, and then the first intermediate image is smoothed to obtain the target image.

[0067] For example, the normalized image and the derivative of the Gaussian function are convolved to obtain convolution data. At this time, sigma is taken as 0.8, and the preset direction is the y direction. Then the second-order derivative of the convolution data in the y direction is calculated to obtain the first intermediate image, such as using derivate_gauss(normalized image, first intermediate image, 0.8, 'yy') to obtain the first intermediate image corresponding to the normalized image. Among them, 'yy' represents the second-order derivative along the y direction.

[0068] Exemplarily, the first intermediate image is smoothed using a smoothing algorithm to obtain a target image.

[0069] For example, the first intermediate image is convolved with the derivative of the Gaussian function, and sigma is set to 1. The first intermediate image is smoothed using the derivate_gauss(first intermediate image, target image, 1, 'none') function to obtain the target image. 'none' means that only the input image - the first intermediate image is smoothed.

[0070] Exemplarily, the initial image includes a first initial image and a second initial image, wherein the ghost detection target in the first initial image is a vertical line, such as Figure 2 As shown, the ghost detection target in the second initial image is a horizontal line, such as Figure 8 As shown, the first initial image and the second initial image are normalized to obtain the first normalized image and the second normalized image respectively, and then the first normalized image is convolved with the derivative of the Gaussian function to obtain the first convolution data, and the second-order derivative of the first convolution data in the x direction is calculated and smoothed to obtain the first target image; and the second normalized image is convolved with the derivative of the Gaussian function to obtain the second convolution data, and the second-order derivative of the second convolution data in the y direction is calculated and smoothed to obtain the second target image. Thus, the target image includes the first target image and the second target image.

[0071] Optionally, the initial image may include one or more images in a preset direction, thereby obtaining a target image that corresponds one-to-one with the initial image. This application does not impose any specific restrictions, and can be set according to needs.

[0072] In some embodiments, at least performing convolution processing on the normalized image to obtain the target image includes: convolving the normalized image with a derivative of a Gaussian function to obtain convolution data; calculating the second-order derivative of the convolution data in a preset direction to obtain a first intermediate image, wherein the preset direction includes a first direction and / or a second direction; smoothing the first intermediate image to obtain a second intermediate image; inverting the second intermediate image to obtain an inverted image; and performing background removal processing on the inverted image to obtain the target image.

[0073] Exemplarily, the preset direction is one or more of a first direction and a second direction, wherein the first direction is an x ​​direction and the second direction is a y direction. When the ghost detection target in the initial image is a vertical line, the preset direction is the x direction; and when the ghost detection target in the initial image is a horizontal line, the preset direction is the y direction.

[0074] Exemplarily, assuming that the ghost detection target in the current initial image is a vertical line, the preset direction is the x direction, then the normalized image is first convolved with the derivative of the Gaussian function to obtain convolution data, and then the second-order derivative of the convolution data in the x direction is calculated to obtain a first intermediate image, and then the first intermediate image is smoothed to obtain a second intermediate image, and then the second intermediate image is inverted to obtain an inverted image.

[0075] For example, Figure 6 As shown, Figure 5 The image shown in the figure is inverted to obtain Figure 6 Image shown.

[0076] Optionally, the inverted image is normalized to 0 to 255 (ie, contrast stretching) to obtain a normalized value corresponding to each position in the inverted image, and the normalized value is used to update the pixel value of the corresponding position in the inverted image to obtain an updated inverted image.

[0077] Exemplarily, the top-hat transformation is used to perform background removal processing on the inverted image to obtain a target image corresponding to the initial image. This step can reduce the amount of computation required for subsequent image processing.

[0078] For example, an opening operation is performed on the inverted image to obtain an operation result, and the difference between the inverted image and the operation result is used as the target image corresponding to the initial image, so that the target object can support subsequent ghost detection.

[0079] For example, Figure 7 As shown, Figure 6 The image shown in the figure is transformed into the following after the top hat transformation: Figure 7 Image shown.

[0080] Step S102: determine the area to be inspected from the target image.

[0081] Exemplarily, the area to be inspected corresponding to the ghost detection target in the target image is obtained.

[0082] For example, Figure 2 The five vertical lines in the image are processed by image preprocessing to obtain the corresponding target image. Then, the target image can be detected according to the target detection algorithm to obtain five corresponding areas to be detected.

[0083] For example, set the target frame so that it covers the vertical line, and set the pixel value of the target frame to be the same as the pixel value of the area in the target image that does not contain the vertical line. Figure 2The two circles in the figure are used as reference positions to quickly obtain the pixel values ​​of the area not containing the vertical lines, and then obtain the corresponding target frame. The target frame is slid from left to right and from top to bottom in the target image, so that the position with the larger pixel difference between the target image and the target frame is determined as the area to be inspected.

[0084] Or, according to Figure 2 The two circles in the image are used as reference positions, an affine matrix is ​​set, and then an affine transformation is performed according to the affine matrix to obtain a target frame, so that the area corresponding to the target frame in the target image is used as the area to be inspected.

[0085] Step S103: determine an image convolution kernel, and perform a convolution operation on the area to be inspected using the image convolution kernel to obtain a convolution image corresponding to the area to be inspected.

[0086] Exemplarily, the image convolution kernel required for performing a convolution operation on the area to be inspected is determined, and then the image convolution kernel is used to perform a convolution operation on the area to be inspected to obtain a convolution result corresponding to each position in the area to be inspected, and the convolution results are arranged according to the distribution positions of the area to be inspected to obtain a convolution image corresponding to the area to be inspected.

[0087] In some embodiments, the image convolution kernel includes at least a first convolution kernel and a second convolution kernel, and the image convolution kernel is used to perform a convolution operation on the area to be inspected to obtain a convolution image corresponding to the area to be inspected, such as Fig. 9 As shown, step S103 includes sub-steps S1031 to S1034.

[0088] Sub-step S1031: using the first convolution kernel to perform a convolution operation on the area to be inspected to obtain a first convolution result.

[0089] Exemplarily, a plurality of image convolution kernels are set to perform convolution operations on the areas to be inspected respectively, and the image convolution kernels include at least a first convolution kernel and a second convolution kernel.

[0090] For example, when the ghost detection target in the current initial image is a vertical line, the first convolution kernel K1 is set to (0,-31,-31,-31,-31,-31,0,0,31,31,31,31,31,0,0,-1,-1,-1,-1,-1,0) T *(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)*(1 / 55), and then multiply the first convolution kernel K1 by the pixel value corresponding to the inspected area to obtain the first convolution result. If the ghost detection target in the current initial image is a horizontal line, the first convolution kernel X1 set is the transpose of the first convolution kernel K1 set when the ghost detection target is a vertical line, that is, X1 = K1 T, and then multiply the first convolution kernel X1 by the pixel value corresponding to the area to be inspected to obtain the first convolution result.

[0091] Sub-step S1032: using the second convolution kernel to perform a convolution operation on the area to be inspected to obtain a second convolution result.

[0092] Exemplarily, a second convolution result is obtained by performing a convolution operation again on the area to be inspected using a second convolution kernel.

[0093] For example, when the ghost detection target in the current initial image is a vertical line, the second convolution kernel K2 is set to (0,-1,-1,-1,-1,-1,0,0,31,31,31,31,31,0,0,-30,-30,-30,-30,-30,0) T *(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)*(1 / 55), and then multiply the second convolution kernel K2 by the pixel value corresponding to the inspected area to obtain the second convolution result. If the ghost detection target in the current initial image is a horizontal line, the second convolution kernel X2 set is the transpose of the second convolution kernel K2 set when the ghost detection target is a vertical line, that is, X2 = K2 T Then, the second convolution kernel X2 is multiplied by the pixel value corresponding to the area to be inspected to obtain the second convolution result.

[0094] Sub-step S1033: Compare the convolution values ​​at the same position in the first convolution result and the second convolution result to obtain a target convolution value at the same position.

[0095] Exemplarily, the first convolution result and the second convolution result at the same position in the area to be inspected are compared, and the minimum value between the first convolution result and the second convolution result is used as the target convolution value at the position.

[0096] For example, the first convolution result at the pixel position (x, y) in the inspection area is j1, and the second convolution result is j2, then the target convolution value at the pixel position (x, y) is min(j1, j2).

[0097] Sub-step S1034: determining a convolution image corresponding to the area to be inspected according to the target convolution value.

[0098] Exemplarily, the target convolution values ​​are arranged according to the distribution of the area to be inspected in the target image, so as to obtain a convolution image corresponding to the area to be inspected.

[0099] For example, an initial image with pixel values ​​of 0 is set according to the size of the area to be inspected, and then the target convolution values ​​are updated to the initial image in sequence according to the distribution of the area to be inspected in the target image, so that the updated initial image is used as the convolution image corresponding to the area to be inspected.

[0100] For example, Figure 2 One of the areas where the vertical line is located is taken as the inspection area, and after the first convolution kernel and the second convolution kernel are convolved respectively, the following is obtained: Fig.10 and Fig.11 The effect shown will Fig.10 and Fig.11 The convolution image is obtained by using the target convolution value as min(j1, j2). Fig.12 shown.

[0101] Step S104: determine a first target object and a second target object in the convolution image, and calculate a distance parameter between the first target object and the second target object.

[0102] Exemplarily, target segmentation is performed on the convolution image to obtain a first target object and a second target object in the convolution image, wherein the first target object and the second target object correspond to one of the target object and the ghost object in the initial image respectively.

[0103] For example, Fig.12 As shown, the convolution image is segmented using a neural network model to obtain a first target object 1 and a second target object 2 in the convolution image.

[0104] Exemplarily, after the first target object and the second target object are obtained, the minimum value of the sum of distances between pixel positions in the first target object and the second target object is calculated as the distance parameter between the first target object and the second target object.

[0105] For example, taking the first target object as the ghost object, the minimum value between each pixel position in the first target object and the pixel position of the second target object is calculated, and the pixel position corresponding to the minimum value is removed from the second target object to continue calculating the minimum value between the remaining pixel positions in the first target object and the remaining pixel positions in the second target object, and so on, wherein the minimum value corresponding to each pixel position is accumulated and the accumulated result is used as the distance parameter between the first target object and the second target object.

[0106] For example, the first target object includes pixel positions (x1, y1), (x2, y2), (x3, y3), and the second target object includes pixel positions (x4, y4), (x5, y5), (x6, y6). First, calculate the minimum distance between (x1, y1) and (x4, y4), (x5, y5), (x6, y6). Assume that the pixel position corresponding to the minimum distance is (x4, y4), and the minimum distance is s1. At this time, the distance parameter size is s1. The remaining pixel positions of the second target object include ( x5, y5), (x6, y6); calculate the minimum distance between (x2, y2) and the remaining pixel positions (x5, y5), (x6, y6) again. Assuming that the pixel position corresponding to the minimum distance is (x5, y5), and the minimum distance is s2, then the distance parameter size is s1+s2. The remaining pixel positions of the second target object include (x6, y6), then calculate the distance s3 between (x3, y3) and (x6, y6) and use it as the minimum distance value, then the distance parameter size is s1+s2+s3.

[0107] Optionally, an average of the calculated distances between the first target object and the second target object is calculated as a distance parameter between the first target object and the second target object, such as (s1+s2+s3) / 3.

[0108] Optionally, the calculated minimum value or maximum value of the distance between the first target object and the second target object is used as a distance parameter between the first target object and the second target object, such as min(s1, s2, s3) or max(s1, s2, s3).

[0109] In some embodiments, determining the first target object and the second target object in the convolution image and calculating the distance parameter between the first target object and the second target object includes: performing target segmentation on the convolution image using a threshold segmentation algorithm to obtain the first target object and the second target object corresponding to the convolution image; performing linear fitting on the first target object to obtain a first fitting result corresponding to the first target object and performing linear fitting on the second target object to obtain a second fitting result corresponding to the second target object; and calculating the distance parameter between the first target object and the second target object based on the first fitting result and the second fitting result.

[0110] Exemplarily, a threshold segmentation algorithm is used to perform target segmentation on the convolution image to obtain the first target object and the second target object corresponding to the convolution image.

[0111] Exemplarily, the position information of each pixel point in the first target object is linearly fitted using the least squares method to obtain a first fitting straight line, and the first fitting straight line is used as the first fitting result; and the position information of each pixel point in the second target object is linearly fitted using the least squares method to obtain a second fitting straight line, and the second fitting straight line is used as the second fitting result.

[0112] For example, the first fitting line is set to Y=a1*X+b1, and the distance information from the position information of each pixel point in the first target object to the fitting line is calculated, so that the fitting line corresponding to the minimum sum of the distance information is the first fitting result. At the same time, the second fitting line is set to Y=a2*X+b2, and the distance information from the position information of each pixel point in the second target object to the fitting line is calculated, so that the fitting line corresponding to the minimum sum of the distance information is the second fitting result.

[0113] Exemplarily, first line segment information corresponding to the first target object in the first fitting result is obtained, and second line segment information corresponding to the second target object in the second fitting result is obtained, and the average value, minimum value or maximum value of the distance between the first line segment information and the second line segment information is calculated to determine as the distance parameter between the first target object and the second target object.

[0114] Step S105 : obtaining a ghost detection result corresponding to the object to be detected according to the distance parameter.

[0115] Exemplarily, the target image includes multiple areas to be inspected, and the step of solving the distance parameters is performed on the areas to be inspected respectively to obtain multiple distance parameters corresponding to the target image, and then the multiple distance parameters are fused to obtain the target distance parameters finally corresponding to the initial image.

[0116] For example, Figure 2 As shown, the area to be inspected includes five vertical lines, and the distance parameters are solved for the five vertical lines respectively. After the distance parameters corresponding to the five vertical lines are obtained respectively, the distance parameters s1, s2, s3, s4, and s5 corresponding to the five vertical lines are averaged to obtain the target distance parameters corresponding to the initial image.

[0117] Optionally, different weights are assigned to multiple areas to be inspected according to the target segmentation result, thereby indicating the importance or credibility of the distance parameter between the first target object and the second target object obtained in the area to be inspected to the target distance parameter. For example, if the effect of segmenting the first target object and the second target object in the area to be inspected is poor, it indicates that the credibility of the obtained distance parameter is low, thereby reducing the influence of the distance parameter on determining the target distance parameter, thereby obtaining a more accurate target distance parameter.

[0118] Exemplarily, a mapping table of distance parameters and ghosting degrees of the object to be inspected is created, and a query is performed from the mapping table according to the target distance parameter, so as to obtain a ghosting detection result corresponding to the object to be inspected.

[0119] In some embodiments, obtaining the ghost detection result corresponding to the object to be inspected according to the distance parameter includes: obtaining a first distance parameter corresponding to the first direction and obtaining a second distance parameter corresponding to the second direction; obtaining a first ghost detection result corresponding to the object to be inspected according to the first distance parameter; obtaining a second ghost detection result corresponding to the object to be inspected according to the second distance parameter; and fusing the first ghost detection result and the second ghost detection result to determine the ghost detection result corresponding to the object to be inspected.

[0120] Exemplarily, the initial image includes a first initial image and a second initial image, wherein the first initial image is an image corresponding to the object to be inspected in the first direction, and the second initial image is an image corresponding to the object to be inspected in the second direction. A first distance parameter of the first initial image in the first direction is obtained, and a second distance parameter of the second initial image in the second direction is obtained.

[0121] The calculation method of the first distance parameter of the first initial image and the calculation method of the second distance parameter of the second initial image are the same as the method of calculating the distance parameters in the above steps S101 to S104, and will not be repeated in this application.

[0122] Exemplarily, assuming that the first direction corresponding to the first initial image is the x direction, and the second direction corresponding to the second initial image is the y direction, after obtaining the first distance parameter of the first initial image in the first direction and obtaining the second distance parameter of the second initial image in the second direction, the first distance parameter is used to query in a mapping table of distance parameters and ghosting degrees of the object to be inspected to obtain a first ghosting detection result corresponding to the object to be inspected, and the second distance parameter is used to query in a mapping table of distance parameters and ghosting degrees of the object to be inspected to obtain a second ghosting detection result corresponding to the object to be inspected.

[0123] Exemplarily, after obtaining the first ghosting detection result and the second ghosting detection result, the result with more serious ghosting among the first ghosting detection result and the second ghosting detection result is used as the ghosting detection result corresponding to the object to be detected.

[0124] Alternatively, different weights are assigned to the first ghost detection result and the second ghost detection result, and weighted summation is performed according to the different weights to obtain the ghost detection result corresponding to the object to be detected. Ghost detection is then performed on the object to be detected from multiple directions, and the ghost detection results are fused, thereby improving the accuracy of the ghost detection results.

[0125] Optionally, the present application does not impose any specific restrictions on the manner of fusing the first ghost detection result and the second ghost detection result, and the manner may be set according to actual needs.

[0126] Please refer to Fig.13 , Fig.13 A schematic diagram of a scenario for implementing the ghosting detection method provided in this embodiment, as shown in FIG. Fig.13 As shown, an initial image obtained by optical measurement of the object to be inspected is obtained, a nonlinear grayscale transformation is performed on the initial image to obtain a grayscale image, and the grayscale image is normalized to obtain a normalized image. The normalized image is convolved with the derivative of the Gaussian function to obtain convolution data, and then the second-order derivative of the convolution data in a preset direction is calculated to obtain a first intermediate image, and then the first intermediate image is smoothed to obtain a second intermediate image, and then the second intermediate image is inverted to obtain an inverted image, and then the inverted image is subjected to background removal processing to obtain a target image, and the target image is subjected to target detection to obtain a region to be inspected; multiple image convolution kernels are determined, and convolution operations are performed on the region to be inspected respectively by the multiple image convolution kernels, and the operation results are compared to obtain a convolution image corresponding to the region to be inspected, and the convolution image is segmented by threshold segmentation to obtain a first target object and a second target object, and then the distance parameter between the first target object and the second target object is calculated; thereby, a ghost detection result corresponding to the object to be inspected is obtained according to the distance parameter. When the initial image includes multiple images, the above steps are performed multiple times, and the multiple ghost detection results obtained are fused to obtain a ghost detection result corresponding to the object to be inspected. The method solves the problem that the optical waveguide lens may have ghosting due to the non-parallelism between the surfaces or the uneven stress distribution of the working mold, which leads to the change of the grating period. However, the existing technology cannot accurately locate whether the optical waveguide lens has ghosting. It realizes the accurate identification of whether the optical waveguide lens has ghosting problems, thereby ensuring product quality and improving user satisfaction.

[0127] See also Fig.14 , Fig.14A ghosting detection device 200 is provided in an embodiment of the present application. The ghosting detection device 200 includes an image acquisition module 201, a data processing module 202, a convolution processing module 203, an image processing module 204, and a ghosting detection module 205, wherein the image acquisition module 201 is used to acquire an initial image obtained by optical measurement of an object to be inspected, and perform image preprocessing on the initial image to obtain a target image; the data processing module 202 is used to determine an area to be inspected from the target image; the convolution processing module 203 is used to determine an image convolution kernel, and perform a convolution operation on the area to be inspected through the image convolution kernel to obtain a convolution image corresponding to the area to be inspected; the image processing module 204 is used to determine a first target object and a second target object in the convolution image, and calculate a distance parameter between the first target object and the second target object; the ghosting detection module 205 is used to obtain a ghosting detection result corresponding to the object to be inspected according to the distance parameter.

[0128] In some implementations, the image acquisition module 201 performs the following steps when performing image preprocessing on the initial image to obtain the target image:

[0129] Performing grayscale transformation on the initial image to obtain a grayscale image;

[0130] Normalizing the grayscale image to obtain a normalized image;

[0131] At least the normalized image is subjected to convolution processing to obtain a target image.

[0132] In some implementations, the image acquisition module 201, in the process of performing convolution processing on at least the normalized image to obtain the target image, executes:

[0133] Convolving the normalized image with a derivative of a Gaussian function to obtain convolution data;

[0134] Calculate the second-order derivative of the convolution data in a preset direction to obtain a first intermediate image, wherein the preset direction includes the first direction and / or the second direction;

[0135] The first intermediate image is smoothed to obtain a target image.

[0136] In some implementations, the image acquisition module 201 performs, during the process of performing convolution processing on at least the normalized image to obtain the target image, the following steps:

[0137] Convolving the normalized image with a derivative of a Gaussian function to obtain convolution data;

[0138] Calculate the second-order derivative of the convolution data in a preset direction to obtain a first intermediate image, wherein the preset direction includes the first direction and / or the second direction;

[0139] performing smoothing processing on the first intermediate image to obtain a second intermediate image;

[0140] Inverting the second intermediate image to obtain an inverted image;

[0141] The target image is obtained by performing background removal processing on the inverted image.

[0142] In some implementations, the image convolution kernel includes at least a first convolution kernel and a second convolution kernel, and the convolution processing module 203 performs, in the process of performing a convolution operation on the area to be inspected by using the image convolution kernel to obtain a convolution image corresponding to the area to be inspected:

[0143] Using the first convolution kernel to perform a convolution operation on the area to be inspected to obtain a first convolution result;

[0144] Using the second convolution kernel to perform a convolution operation on the area to be inspected to obtain a second convolution result;

[0145] Compare the convolution values ​​at the same position in the first convolution result and the second convolution result to obtain a target convolution value at the same position;

[0146] A convolution image corresponding to the area to be inspected is determined according to the target convolution value.

[0147] In some implementations, the image processing module 204, during the process of determining the first target object and the second target object in the convolution image and calculating the distance parameter between the first target object and the second target object, performs:

[0148] Performing target segmentation on the convolution image by using a threshold segmentation algorithm to obtain the first target object and the second target object corresponding to the convolution image;

[0149] Performing a linear fit on the first target object to obtain a first fitting result corresponding to the first target object, and performing a linear fit on the second target object to obtain a second fitting result corresponding to the second target object;

[0150] A distance parameter between the first target object and the second target object is calculated according to the first fitting result and the second fitting result.

[0151] In some implementations, the ghost detection module 205, in the process of obtaining the ghost detection result corresponding to the object to be detected according to the distance parameter, performs:

[0152] Obtaining a first distance parameter corresponding to the first direction and obtaining a second distance parameter corresponding to the second direction;

[0153] Acquire a first ghost detection result corresponding to the object to be detected according to the first distance parameter;

[0154] Acquire a second ghost detection result corresponding to the object to be detected according to the second distance parameter;

[0155] The first ghost detection result and the second ghost detection result are integrated to determine a ghost detection result corresponding to the object to be detected.

[0156] In some implementations, the ghosting detection apparatus 200 is applied to a terminal device.

[0157] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned ghosting detection method embodiment, and will not be repeated here.

[0158] See also Fig.15 , Fig.15 A schematic block diagram of the structure of a terminal device provided in an embodiment of the present invention.

[0159] like Fig.15 As shown, the terminal device 300 includes a processor 301 and a memory 302, and the processor 301 and the memory 302 are connected via a bus 303, such as an I2C (Inter-integrated Circuit) bus.

[0160] Specifically, the processor 301 is used to provide computing and control capabilities to support the operation of the entire terminal device. The processor 301 can be a central processing unit (CPU), and the processor 301 can also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0161] Specifically, the memory 302 may be a Flash chip, a read-only memory (ROM) disk, an optical disk, a USB flash drive, or a mobile hard disk.

[0162] Those skilled in the art will understand that Fig.15 The structure shown in the figure is only a block diagram of a partial structure related to the embodiment of the present invention, and does not constitute a limitation on the terminal device to which the embodiment of the present invention is applied. The specific server may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0163] The processor is used to run a computer program stored in the memory, and implement any one of the ghosting detection methods provided by the embodiments of the present invention when executing the computer program.

[0164] In one embodiment, the processor is used to run a computer program stored in the memory, and implements the following steps when executing the computer program:

[0165] Acquire an initial image obtained by optical measurement of the object to be inspected, and perform image preprocessing on the initial image to obtain a target image;

[0166] Determining a region to be inspected from the target image;

[0167] Determine an image convolution kernel, and perform a convolution operation on the area to be inspected by using the image convolution kernel to obtain a convolution image corresponding to the area to be inspected;

[0168] Determine a first target object and a second target object in the convolution image, and calculate a distance parameter between the first target object and the second target object;

[0169] A ghost detection result corresponding to the object to be detected is obtained according to the distance parameter.

[0170] In some implementations, the processor 301, during the process of performing image preprocessing on the initial image to obtain the target image, executes:

[0171] Performing grayscale transformation on the initial image to obtain a grayscale image;

[0172] Normalizing the grayscale image to obtain a normalized image;

[0173] At least the normalized image is subjected to convolution processing to obtain a target image.

[0174] In some implementations, the processor 301, in the process of performing convolution processing on at least the normalized image to obtain the target image, executes:

[0175] Convolving the normalized image with a derivative of a Gaussian function to obtain convolution data;

[0176] Calculate the second-order derivative of the convolution data in a preset direction to obtain a first intermediate image, wherein the preset direction includes the first direction and / or the second direction;

[0177] The first intermediate image is smoothed to obtain a target image.

[0178] In some implementations, the processor 301 performs, during the process of performing convolution processing on at least the normalized image to obtain the target image, the following steps:

[0179] Convolving the normalized image with a derivative of a Gaussian function to obtain convolution data;

[0180] Calculate the second-order derivative of the convolution data in a preset direction to obtain a first intermediate image, wherein the preset direction includes the first direction and / or the second direction;

[0181] performing smoothing processing on the first intermediate image to obtain a second intermediate image;

[0182] Inverting the second intermediate image to obtain an inverted image;

[0183] The target image is obtained by performing background removal processing on the inverted image.

[0184] In some implementations, the image convolution kernel includes at least a first convolution kernel and a second convolution kernel, and the processor 301 performs, during the process of performing a convolution operation on the area to be inspected by using the image convolution kernel to obtain a convolution image corresponding to the area to be inspected:

[0185] Using the first convolution kernel to perform a convolution operation on the area to be inspected to obtain a first convolution result;

[0186] Using the second convolution kernel to perform a convolution operation on the area to be inspected to obtain a second convolution result;

[0187] Compare the convolution values ​​at the same position in the first convolution result and the second convolution result to obtain a target convolution value at the same position;

[0188] A convolution image corresponding to the area to be inspected is determined according to the target convolution value.

[0189] In some implementations, the processor 301, in the process of determining the first target object and the second target object in the convolution image and calculating the distance parameter between the first target object and the second target object, executes:

[0190] Performing target segmentation on the convolution image by using a threshold segmentation algorithm to obtain the first target object and the second target object corresponding to the convolution image;

[0191] Performing a linear fit on the first target object to obtain a first fitting result corresponding to the first target object, and performing a linear fit on the second target object to obtain a second fitting result corresponding to the second target object;

[0192] A distance parameter between the first target object and the second target object is calculated according to the first fitting result and the second fitting result.

[0193] In some implementations, the processor 301, in the process of obtaining the ghost detection result corresponding to the object to be detected according to the distance parameter, executes:

[0194] Obtaining a first distance parameter corresponding to the first direction and obtaining a second distance parameter corresponding to the second direction;

[0195] Acquire a first ghost detection result corresponding to the object to be detected according to the first distance parameter;

[0196] Acquire a second ghost detection result corresponding to the object to be detected according to the second distance parameter;

[0197] The first ghost detection result and the second ghost detection result are integrated to determine a ghost detection result corresponding to the object to be detected.

[0198] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the terminal device described above can refer to the corresponding process in the aforementioned ghosting detection method embodiment, and will not be repeated here.

[0199] An embodiment of the present invention further provides a storage medium for computer-readable storage, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any ghosting detection method provided in the description of the embodiment of the present invention.

[0200] The storage medium may be an internal storage unit of the terminal device described in the foregoing embodiment, such as a hard disk or memory of the terminal device. The storage medium may also be an external storage device of the terminal device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc., equipped on the terminal device.

[0201] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware embodiment, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0202] It should be understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, article or system including the element.

[0203] The serial numbers of the embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments. The above description is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A ghosting detection method, characterized in that: The method comprises: Acquire an initial image obtained by optical measurement of the object to be inspected, and perform image preprocessing on the initial image to obtain a target image; Determining a region to be inspected from the target image; Determine an image convolution kernel, and perform a convolution operation on the area to be inspected by using the image convolution kernel to obtain a convolution image corresponding to the area to be inspected; Determine a first target object and a second target object in the convolution image, and calculate a distance parameter between the first target object and the second target object; A ghost detection result corresponding to the object to be detected is obtained according to the distance parameter.

2. The method according to claim 1, characterized in that: The performing image preprocessing on the initial image to obtain a target image includes: Performing grayscale transformation on the initial image to obtain a grayscale image; Normalizing the grayscale image to obtain a normalized image; At least the normalized image is subjected to convolution processing to obtain a target image.

3. The method according to claim 2, characterized in that The step of at least performing convolution processing on the normalized image to obtain a target image comprises: Convolving the normalized image with a derivative of a Gaussian function to obtain convolution data; Calculate the second-order derivative of the convolution data in a preset direction to obtain a first intermediate image, wherein the preset direction includes the first direction and / or the second direction; Smoothing the first intermediate image to obtain a target image 。 4. The method according to claim 2, characterized in that: The step of at least performing convolution processing on the normalized image to obtain a target image comprises: Convolving the normalized image with a derivative of a Gaussian function to obtain convolution data; Calculate the second-order derivative of the convolution data in a preset direction to obtain a first intermediate image, wherein the preset direction includes the first direction and / or the second direction; performing smoothing processing on the first intermediate image to obtain a second intermediate image; Inverting the second intermediate image to obtain an inverted image; The target image is obtained by performing background removal processing on the inverted image.

5. The method according to claim 1, characterized in that: The image convolution kernel includes at least a first convolution kernel and a second convolution kernel, and performing a convolution operation on the area to be inspected by using the image convolution kernel to obtain a convolution image corresponding to the area to be inspected includes: Using the first convolution kernel to perform a convolution operation on the area to be inspected to obtain a first convolution result; Using the second convolution kernel to perform a convolution operation on the area to be inspected to obtain a second convolution result; Compare the convolution values ​​at the same position in the first convolution result and the second convolution result to obtain a target convolution value at the same position; A convolution image corresponding to the area to be inspected is determined according to the target convolution value.

6. The method according to claim 1, characterized in that: The determining the first target object and the second target object in the convolution image, and calculating the distance parameter between the first target object and the second target object, comprises: Performing target segmentation on the convolution image by using a threshold segmentation algorithm to obtain the first target object and the second target object corresponding to the convolution image; Performing a linear fit on the first target object to obtain a first fitting result corresponding to the first target object, and performing a linear fit on the second target object to obtain a second fitting result corresponding to the second target object; A distance parameter between the first target object and the second target object is calculated according to the first fitting result and the second fitting result.

7. The method according to any one of claims 3 to 4, characterized in that: The obtaining, according to the distance parameter, a ghost detection result corresponding to the object to be detected includes: Obtaining a first distance parameter corresponding to the first direction and obtaining a second distance parameter corresponding to the second direction; Acquire a first ghost detection result corresponding to the object to be detected according to the first distance parameter; Acquire a second ghost detection result corresponding to the object to be detected according to the second distance parameter; The first ghost detection result and the second ghost detection result are integrated to determine a ghost detection result corresponding to the object to be detected.

8. A ghosting detection device, characterized in that: include: An image acquisition module is used to acquire an initial image obtained by optical measurement of the object to be inspected, and perform image preprocessing on the initial image to obtain a target image; A data processing module, used for determining a region to be inspected from the target image; A convolution processing module, used to determine an image convolution kernel, and perform a convolution operation on the area to be inspected through the image convolution kernel to obtain a convolution image corresponding to the area to be inspected; An image processing module, used to determine a first target object and a second target object in the convolution image, and calculate a distance parameter between the first target object and the second target object; The ghost detection module is used to obtain the ghost detection result corresponding to the object to be detected according to the distance parameter.

9. A terminal device, characterized in that: The terminal device includes a processor, a memory, a computer program stored in the memory and executable by the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein when the computer program is executed by the processor, the steps of the ghosting detection method according to any one of claims 1 to 7 are realized.

10. A storage medium for computer-readable storage, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the ghost detection method according to any one of claims 1 to 7.