Focusing method and device of linear array camera and automatic optical detection equipment
By determining the sharpness characteristic value of the image and the camera position in the online array camera, and focusing using the mapping relationship in the database, the image inaccuracy problem caused by the concave and convex deformation of the glass substrate is solved, and the accuracy of substrate defect detection is improved.
Patent Information
- Application Number
- CN202111073801.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-14
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2041-09-14
AI Technical Summary
Due to the inconsistency and convex deformation of the glass substrate at the same position, the images acquired by the TDI camera are inaccurate and the substrate defects cannot be effectively detected.
By determining the position and clarity feature values of the linear array camera when the image is currently acquired, the corresponding second position is obtained from the database, and based on the difference between the second position and the reference focus position, the focus position of the linear array camera is determined. Consequently focus.
It realizes the acquisition of clear images on different glass substrates, solves the accuracy of substrate defect detection, and improves the detection accuracy of AOI equipment.
Smart Images

Figure CN113777040B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of optical detection technology, and in particular to a focusing method and device for a linear array camera and automatic optical detection equipment. Background Art
[0002] AOI (Automatic Optical Inspection) is a widely used measurement method in the panel and microelectronics industries, among which AOI equipment is widely used in the panel and microelectronics industries. AOI equipment can be used to detect whether the surface image of the substrate meets the requirements, whether there are bad spots caused by destructive substances, and determine the exact location of bad spots caused by destructive substances. For example, the AOI equipment can be used to directly take a picture of the substrate to obtain a clear image, and the image can be analyzed to detect whether there are bad spots on the substrate.
[0003] The key component of AOI equipment is its linear scan camera (TDI camera, referred to as linear camera). When the linear camera scans and obtains a grayscale image, the clarity of the image determines the accuracy of obtaining substrate defects. The clarity of the image obtained by the TDI linear scan camera is determined by the camera focus.
[0004] The concave-convex deformation of different glass substrates at the same position is inconsistent, which causes the TDI camera to focus or lose focus on different glass substrates at the same position, and the resolution of the acquired images is also inconsistent. Some images are clear, and some are blurry. When the acquired images are periodically compared and analyzed to confirm substrate defects, the blurred images cannot be effectively identified and processed, resulting in the inability to effectively detect substrate defects, affecting the yield and quality of substrate products. Summary of the invention
[0005] The embodiments of the present disclosure provide a focusing method and device for a linear array camera and automatic optical inspection equipment, which can solve the technical problem in the prior art that the image obtained by the TDI camera is inaccurate due to the inconsistent concave-convex deformation of the glass substrate at the same position, and thus the substrate defects cannot be effectively detected.
[0006] According to one of the solutions of the present disclosure, a focusing method for a line scan camera is provided, comprising:
[0007] Determining a first position of the line array camera when currently acquiring a first image and a clarity characteristic value of the first image;
[0008] Acquire a second position of the line array camera corresponding to the clarity characteristic value from a database;
[0009] The focus position of the line array camera is determined based on the difference between the second position and a reference focus position and the first position, wherein the reference focus position is obtained from the database.
[0010] In some embodiments, determining the clarity feature value of the first image includes: determining the clarity feature value of the first image by using a gradient function algorithm or a wavelet transform algorithm.
[0011] In some embodiments, acquiring the second position of the line array camera corresponding to the clarity characteristic value from a database comprises:
[0012] Acquire a second image based on the clarity feature value from a database;
[0013] A second position of the line camera is determined based on the second image.
[0014] In some embodiments, determining the focus position of the line array camera based on the difference between the second position and the reference focus position and the first position includes:
[0015] Acquire a difference between the second position and a reference focus position;
[0016] If the difference is positive, the position after moving the difference in the first direction based on the first position is determined as the focus position; if the difference is negative, the position after moving the difference in the second direction based on the first position is determined as the focus position, wherein the first direction is opposite to the second direction.
[0017] In some embodiments, the reference focus position is determined in advance through training, and the training method includes:
[0018] determining a test location on the target object;
[0019] Moving the linear camera at the test position along a preset direction according to a preset step length, and photographing the target object after moving to a corresponding position to obtain a grayscale image;
[0020] Analyzing each of the obtained grayscale images to calculate the clarity feature value of the grayscale image;
[0021] The position corresponding to the grayscale image having the largest clarity characteristic value among the clarity characteristic values is determined as the reference focus position.
[0022] In some embodiments, the method further comprises:
[0023] A mapping relationship between images corresponding to different clarity feature values in the database and the position of the line array camera is determined based on the reference focus position.
[0024] In some embodiments, after determining the focus position of the line array camera, the method further includes:
[0025] The focus of the linear camera is adjusted to the focus position for shooting.
[0026] According to one of the solutions of the present disclosure, a focusing device for a line array camera is also provided, comprising:
[0027] A first determination module is configured to determine a first position of the line array camera when currently acquiring a first image and a clarity feature value of the first image;
[0028] An acquisition module, configured to acquire a second position of the line array camera corresponding to the clarity characteristic value from a database;
[0029] The second determination module is configured to determine the focus position of the line array camera based on the difference between the second position and a reference focus position and the first position, wherein the reference focus position is obtained from the database.
[0030] In some embodiments, the second determining module is further configured to:
[0031] Acquire a difference between the second position and a reference focus position;
[0032] If the difference is positive, the position after moving the difference in the first direction based on the first position is determined as the focus position; if the difference is negative, the position after moving the difference in the second direction based on the first position is determined as the focus position, wherein the first direction is opposite to the second direction.
[0033] According to one of the solutions of the present disclosure, there is also provided an automatic optical inspection device, comprising a linear camera and a focusing device of the above-mentioned linear array camera.
[0034] The focusing method, device and automatic optical inspection equipment of the line array camera provided by various embodiments of the present disclosure obtain the first position of the line array camera when currently capturing the first image and the clarity characteristic value of the captured first image, obtain the second image from the database based on the clarity characteristic value, and determine the second position of the line array camera corresponding to the second image when capturing the second image, and determine the focus position of the line array camera that can capture a clear image based on the difference between the second position and the reference focus position and the first position when currently capturing the first image, so as to perform focusing, and a clear image can be captured, solving the technical problem in the prior art that the image captured by the TDI line array camera is blurred due to the concave-convex deformation (warping) of the glass substrate, and the defects of the glass substrate cannot be accurately detected, thereby improving the detection accuracy of the AOI equipment. In addition, the focusing method provided by the embodiment of the present disclosure is convenient and fast to focus, and as long as the first position of the line array camera when capturing the first image is obtained, automatic focusing can be achieved according to the corresponding relationship between the second position and the reference focus position in the database. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 Shows the focus mode of the existing AOI TDI camera when operating;
[0036] Figure 2 A flow chart showing a focusing method of a line scan camera according to an embodiment of the present disclosure;
[0037] Figure 3 A focusing schematic diagram showing a focusing method for a line scan camera according to an embodiment of the present disclosure;
[0038] Figure 4 A schematic diagram showing training for determining a reference focus position according to an embodiment of the present disclosure;
[0039] Figure 5 A structural diagram showing a focusing device of a line scan camera according to an embodiment of the present disclosure;
[0040] Figure 6 A schematic structural diagram of an automatic optical inspection device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0041] Various aspects and features of the present disclosure are described herein with reference to the drawings.
[0042] It should be understood that various modifications may be made to the embodiments of the present application. Therefore, the above description should not be considered as limiting, but only as an example of an embodiment. Other modifications within the scope and spirit of the present disclosure will occur to those skilled in the art.
[0043] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the general description of the present disclosure given above and the detailed description of the embodiments given below, serve to explain the principles of the present disclosure.
[0044] These and other characteristics of the present disclosure will become apparent from the following description of a preferred form of embodiment given as a non-limiting example, with reference to the attached drawings.
[0045] It should also be understood that although the disclosure has been described with reference to certain specific examples, those skilled in the art will be able to readily implement many other equivalent forms of the disclosure.
[0046] The above and other aspects, features and advantages of the present disclosure will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.
[0047] Specific embodiments of the present disclosure are described hereinafter with reference to the accompanying drawings; however, it should be understood that the embodiments claimed are merely examples of the present disclosure, which may be implemented in a variety of ways. Well-known and / or repeated functions and structures are not described in detail to avoid obscuring the present disclosure with unnecessary or redundant details. Therefore, the specific structural and functional details claimed herein are not intended to be limiting, but merely serve as a basis and representative basis for the claims to teach those skilled in the art to use the present disclosure in a variety of ways with substantially any suitable detailed structure.
[0048] Figure 1 The focus mode of the existing AOI TDI camera when operating is shown in FIG. Figure 1 As shown in the figure, the AOI TDI camera focuses and captures images through the following steps:
[0049] (1) First, a glass substrate is selected, and the glass substrate is moved along the X-axis, and the TDI camera is moved along the Y-axis. When the TDI camera scans all positions of the glass substrate, the test of the glass substrate is determined to be completed. The test after the TDI camera scans all positions of the glass substrate once is determined as one test.
[0050] (2) Repeat the above steps to test the selected glass substrate multiple times;
[0051] (3) After multiple glass substrate tests are completed, the images of the same position on the glass substrate acquired by the TDI camera multiple times are analyzed, the image with the highest resolution is selected from the images of the same position acquired multiple times, and the position of the TDI camera on the Z axis corresponding to the image with the highest resolution is recorded;
[0052] (4) The Z-axis positions of the TDI camera corresponding to different positions on the glass substrate are input into the Z-axis controller of the TDI camera.
[0053] (5) When testing other glass substrates, the position of the TDI camera on the Z axis input into the TDI camera Z axis controller is determined as the focus position;
[0054] (6) Focusing the camera lens on the focus position and capturing images, thereby testing other glass substrates.
[0055] Since the degrees of concave-convex deformation of different glass substrates at the same position are inconsistent, the focal points of different glass substrates at the same position are different. If the above-mentioned focusing mode is used for focusing (the focusing position of the next glass substrate is determined based on the focusing position of the previous glass substrate), the different glass substrates will be out of focus, and the obtained image resolution (image clarity) will be poor, thus affecting the effective detection of glass substrate defects.
[0056] In order to solve the above technical problems, an embodiment of the present disclosure provides a focusing method for a line array camera. Figure 2 A flow chart of a focusing method of a line scan camera according to an embodiment of the present disclosure is shown. Figure 3 FIG. 2 is a schematic diagram showing a focusing method of a line array camera according to an embodiment of the present disclosure. Figure 2 and Figure 3 As shown, the focusing method of the line array camera provided by the embodiment of the present disclosure specifically includes the following steps:
[0057] S101: Determine the first position Z of the linear array camera when currently acquiring the first image 11 and a clarity characteristic value of the first image.
[0058] In the rectangular coordinate system scanned by the line array camera, the vertical movement direction of the line array camera is usually determined as the Z-axis direction, the movement direction of the target object to be detected (such as a glass substrate) is determined as the X-axis direction, and the direction of the line array camera scanning line (the horizontal movement direction of the line array camera) is determined as the Y-axis direction.
[0059] The first position Z of the linear array camera when it currently captures the first image 11 It refers to the initial position of the linear camera on the Z axis. The first image currently acquired is the image acquired for the first time when the linear array camera scans. 11 After the first image is acquired, a clarity feature value of the first image is calculated. The clarity feature value is a parameter used to measure the clarity of an image. The larger the clarity feature value, the clearer the image; the smaller the clarity feature value, the blurrier the image.
[0060] Specifically, a gradient function algorithm or a wavelet transform algorithm may be used to calculate the clarity feature value of the first image collected for the first time.
[0061] When the gradient function algorithm is used to calculate the clarity feature value of the first image, an energy gradient function is used to calculate the edge gradient value of the first image by the difference between adjacent points. The edge gradient value can be represented as the clarity feature value of the first image.
[0062] When the focus of the linear array camera is better, the edge of the captured image is sharper, so there should be a larger gradient function value. In this application, the clarity feature value of the image can be determined by judging the gradient function value. The larger the calculated gradient function value is, the clearer the captured image can be determined.
[0063] When the wavelet transform algorithm is used to calculate the clarity feature value of the first image, the wavelet transform is used to obtain the high-frequency component of the first image, and then the clarity of the first image is determined. When the wavelet transform algorithm is used, the clarity of the image is mainly determined by the amount of high-frequency components in the image. The greater the high-frequency coefficient energy after wavelet decomposition, the clearer the collected image.
[0064] S102: Acquire the second position Z of the line array camera corresponding to the clarity characteristic value from the database j .
[0065] The database stores pre-collected reference images and corresponding parameters. In this embodiment, the database stores the definition feature values of each collected reference image and the position Z of the linear camera on the Z axis when collecting each reference image. i (i=1, 2, 3…j…).
[0066] Step S102 specifically includes the following steps:
[0067] S1021: Acquire a second image based on the clarity feature value from a database;
[0068] S1022: Determine a second position Z of the line array camera based on the second image j .
[0069] After obtaining the clarity feature value of the first image, a second image matching (same or similar) the clarity feature value can be searched from the reference images stored in the database, and then the second position Z of the linear array camera when the second image is acquired can be found. j .
[0070] In a specific implementation, the second image having the same clarity feature value as the first image is preferentially searched. When there is no image having the same clarity feature value as the first image in the database, the second image can be selected from images having a clarity feature value close to that of the first image.
[0071] It can be understood that each reference image in the database corresponds to a clarity feature value and a corresponding position of the line array camera, that is, the clarity feature values of images collected by the line array camera at different positions are different. The database stores the mapping relationship between the reference images corresponding to different clarity feature values and the positions of the line array cameras.
[0072] S103: Based on the second position Z j With reference focus position Z c The difference between the first position Z 11 , determine the focus position of the linear array camera, wherein the reference focus position Z c Obtained from the database.
[0073] Reference focus position Z c The reference focus position Z is the focus position that can obtain the best definition image, that is, the best focus position. c is the position of the line array camera corresponding to the image with the maximum clarity eigenvalue in the above database.
[0074] Based on the definition feature value of the first image, the corresponding second image is found from the database, and the second position Z of the linear array camera corresponding to the second image is obtained. j After that, we can directly use the second position Z j With the reference focus position Z c The difference between the two determines the focusing distance and focusing direction that can be adjusted to the optimal acquisition state, and then the first position Z of the linear array camera to collect the first image is determined. 11 , determine the focus position of the line array camera for focusing, so that a clear image can be directly obtained during the next image acquisition.
[0075] Specifically, step S103 includes the following steps:
[0076] S1031: Acquire the second position Z j With reference focus position Z c The difference between
[0077] S1032: If the difference is positive, at the first position Z 11 Based on the difference, the position after moving the difference in the first direction is determined as the focus position; if the difference is negative, at the first position Z 11 The position after moving the difference in the second direction based on the first direction is determined as the focus position, wherein the first direction is opposite to the second direction.
[0078] Calculate the second position Z j With reference focus position Z c The difference between Zk , where Z k =Z c -Z j ; If Z k is positive, it can be determined that along the Z axis, the second position Z j Higher than the reference focus position Z for obtaining a clear image c Therefore, it is necessary to move the linear array camera from the second position Z j Move Z Down k To the reference focus position Z c To obtain an image with the best clarity, at the same time, due to the second position Z j This reference position is consistent with the initially determined first position Z 11 Correspondingly, therefore, it can be determined that the linear array camera is moved from the initially determined first position Z 11 Move Z Down k The focus position of the linear array camera can be determined. k When it is negative, it can be determined that the second position Z along the Z axis j Below the reference focus position Z for obtaining a clear image c Therefore, the linear array camera needs to be moved upward by Z k To the reference focus position Z c (i.e. move to Figure 3 Middle Z 12 Similarly, due to the second position Z j This reference position is consistent with the initially determined first position Z 11 Correspondingly, therefore, it can be determined that the linear array camera is moved from the initially determined first position Z 11 Move Z Up k To Z 12 The focus position of the line scan camera can be determined.
[0079] The focusing method provided by the embodiment of the present disclosure obtains the first position of the linear array camera when currently capturing the first image and the clarity characteristic value of the captured first image, obtains the second image from the database based on the clarity characteristic value, and determines the second position of the linear array camera corresponding to the capture of the second image, and determines the focus position of the linear array camera that can capture a clear image based on the difference between the second position and the reference focus position and the first position when the first image is currently captured, thereby focusing, and a clear image can be captured, solving the technical problem in the prior art that the image captured by the TDI linear array camera is blurred due to the concave-convex deformation (warping) of the glass substrate, and the defects of the glass substrate cannot be accurately detected, thereby improving the detection accuracy of the AOI equipment. In addition, the focusing method provided by the embodiment of the present disclosure is convenient and fast to focus, and as long as the first position of the linear array camera when capturing the first image is obtained, automatic focusing can be achieved according to the corresponding relationship between the second position and the reference focus position in the database.
[0080] In some embodiments, after determining the focus position of the line array camera, the method further includes:
[0081] S104: adjusting the focus of the linear camera to the focus position for shooting.
[0082] That is, after determining the focus position, the linear camera is moved to the focus position to complete the focus adjustment, and then the target object can be directly photographed to acquire a clear image to detect the target object.
[0083] In this embodiment, the reference focus position Z c Determined in advance through training, Figure 4 FIG. 4 shows a schematic diagram of training for determining a reference focus position according to an embodiment of the present disclosure. Figure 4 As shown, the training method includes:
[0084] S201: Determine a test position on a target object;
[0085] S202: moving the linear camera at the test position along a preset direction according to a preset step length, and photographing the target object after moving to a corresponding position to obtain a grayscale image;
[0086] S203: Analyze each of the obtained grayscale images and calculate the clarity feature value of the grayscale image;
[0087] S204: Determine the position corresponding to the grayscale image with the largest clarity characteristic value among the clarity characteristic values as the reference focus position Z c .
[0088] In this embodiment, the target object is a glass substrate as a detection object, and a test position is selected on the glass substrate as a position to be photographed.
[0089] TDI cameras usually adjust the height of the TDI camera lens by extending and retracting the telescopic parts. In this embodiment, the position of the TDI camera in the fully retracted state on the Z axis is determined as the starting position Z0, and its coordinates are (0, 0); then the motor drives the TDI camera to move along the Z axis with Z0 as the starting point according to the preset step length. For example, in this embodiment, the initial position Z0 is relatively high, and the TDI camera moves from the initial position to the end position from top to bottom. While the TDI camera moves, the TDI camera shoots the above-mentioned test position to obtain a grayscale image, and records the position Z of the TDI camera on the Z axis when each grayscale image is collected. i (i=1,2,3……), its coordinates are (0,Z i ).
[0090] In a specific implementation, the linear camera can move in a single direction (upward or downward along the Z axis) at the test position according to a preset step length, or can move back and forth along a preset direction. i is positive; when moving downward along the Z axis, Z i When moving in a single direction, each position is different, and the clarity characteristic value of the collected grayscale image is also different. When moving back and forth, the linear camera may shoot multiple times at the same position. Therefore, based on the multiple grayscale images shot at the same position, the final clarity characteristic value of the grayscale image shot at the position can be determined to improve the subsequent reference focus position Z c Determine the accuracy.
[0091] After obtaining the grayscale images collected by the TDI camera at different positions, the collected grayscale images are analyzed, and the clarity feature values of each grayscale image are calculated using the above-mentioned gradient function algorithm or wavelet transform algorithm. The height position corresponding to the image with the largest clarity feature value (best clarity) is determined as the reference focus position Z of the TDI camera. c .
[0092] To ensure the reference focus position Z c To determine the accuracy, steps S201-S204 are repeated for training until the reference focus position Z is c The clarity (clarity feature value) of the corresponding image meets the preset clarity threshold.
[0093] When the clarity of the image is less than the preset clarity threshold, training can be continued by changing the test position, changing the moving direction of the TDI camera, changing the step size and other parameters until the clarity of the image is less than the preset clarity threshold (for example, 99%), thereby ensuring that the image with the best clarity can be obtained by focusing at the reference position.
[0094] In a specific implementation, the preset step size can be determined according to actual needs. For example, the preset step size can be 0.01um. The smaller the step size, the more images are collected and the positions of the linear array camera are acquired. c The determination accuracy is higher, and a more accurate reference focus position Z can be obtained. c .
[0095] In some embodiments, the method further comprises:
[0096] S205: Based on the reference focus position Z c A mapping relationship between images corresponding to different definition feature values in the database and the position of the line array camera is determined.
[0097] In determining the reference focus position Z c After that, the reference focus position Z c The corresponding training image group (grayscale image group) is stored in the database as a reference image for subsequent focus adjustment. In the training image group, the image corresponding to each clarity feature value corresponds to the position of each line array camera.
[0098] Exemplarily, the reference focus position Z c is determined from a set of grayscale images in a single training, with reference to the focus position Z c From the heights 0, Z1, Z2…Z corresponding to the grayscale images with different clarity eigenvalues j …Z i Medium screening, Z j With Z c The distance between the two is the focusing distance for obtaining the best clear image.
[0099] After the definition characteristic value of the first image currently collected is calculated in step S101, the second position Z of the line array camera corresponding to the definition characteristic value can be obtained from the database. j , and then calculate the second position Z j With reference focus position Z c The focus distance and focus direction are obtained by the difference between 11 Focusing can be achieved so that a clear image that meets the preset clarity threshold can be directly obtained during the next image acquisition.
[0100] Figure 5 FIG. 2 is a schematic diagram showing the structure of a focusing device of a line array camera according to an embodiment of the present disclosure. Figure 5 As shown, an embodiment of the present disclosure also provides a focusing device for a linear array camera, including:
[0101] A first determination module 501 is configured to determine a first position of the line array camera when currently acquiring a first image and a clarity feature value of the first image;
[0102] An acquisition module 502 is configured to acquire a second position of the line array camera corresponding to the clarity characteristic value from a database;
[0103] The second determination module 503 is configured to determine the focus position of the line array camera based on the difference between the second position and a reference focus position and the first position, wherein the reference focus position is obtained from the database.
[0104] In some embodiments, the first determination module 501 is specifically configured to determine the clarity feature value of the first image by using a gradient function algorithm or a wavelet transform algorithm.
[0105] In some embodiments, the acquisition module 502 is specifically configured as follows:
[0106] Acquire a second image based on the clarity feature value from a database;
[0107] A second position of the line camera is determined based on the second image.
[0108] In some embodiments, the second determination module 503 is specifically configured as follows:
[0109] Acquire a difference between the second position and a reference focus position;
[0110] If the difference is positive, the position after moving the difference in the first direction based on the first position is determined as the focus position; if the difference is negative, the position after moving the difference in the second direction based on the first position is determined as the focus position, wherein the first direction is opposite to the second direction.
[0111] In some embodiments, the focusing device of the line array camera further includes a training module, and the training module is configured as follows:
[0112] determining a test location on the target object;
[0113] Moving the linear camera at the test position along a preset direction according to a preset step length, and photographing the target object after moving to a corresponding position to obtain a grayscale image;
[0114] Analyzing each of the obtained grayscale images to calculate the clarity feature value of the grayscale image;
[0115] The position corresponding to the grayscale image having the largest clarity characteristic value among the clarity characteristic values is determined as the reference focus position.
[0116] The training module is further configured as follows:
[0117] A mapping relationship between images corresponding to different clarity feature values in the database and the position of the line array camera is determined based on the reference focus position.
[0118] In some embodiments, the focusing device of the linear array camera further includes a focusing module configured to adjust the focus of the linear camera to the focusing position for shooting.
[0119] The focusing device of the line scan camera provided in the embodiment of the present disclosure corresponds to the focusing method of the line scan camera in the above-mentioned embodiment. Based on the above-mentioned focusing method of the line scan camera, those skilled in the art can understand the specific implementation manner and various variations of the focusing device of the line scan camera in the embodiment of the present disclosure. Any optional items in the embodiment of the focusing method of the line scan camera are also applicable to the focusing device of the line scan camera, which will not be described in detail here.
[0120] The disclosed embodiment also provides an automatic optical inspection device, including a linear camera and a focusing device of the above-mentioned linear array camera.
[0121] Figure 6 FIG. 1 is a schematic diagram of the structure of another automatic optical inspection device according to an embodiment of the present application. Figure 6 As shown, an embodiment of the present application provides an automatic optical detection device, comprising:
[0122] Memory 601, in which computer program instructions are stored;
[0123] The processor 602 implements the above-mentioned focusing method of the line array camera when executing the computer program instructions.
[0124] The memory 601 may include a volatile memory (e.g., a random-access memory (RAM), which may include a volatile RAM, a magnetic RAM, a ferroelectric RAM, and any other suitable form), and may also include a non-volatile memory (e.g., a disk memory, a flash memory, an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a memristor-based non-volatile solid-state memory, etc.). The second storage area is preferably a non-volatile memory.
[0125] Processor 602 can be a general-purpose processor, including a central processing unit CPU, a network processor (NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0126] The embodiment of the present application further provides a computer-readable storage medium on which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, the above-mentioned focusing method of the line array camera is implemented.
[0127] The above embodiments are only exemplary embodiments of the present disclosure and are not intended to limit the present disclosure. The protection scope of the present disclosure is defined by the claims. Those skilled in the art may make various modifications or equivalent substitutions to the present disclosure within the essence and protection scope of the present disclosure, and such modifications or equivalent substitutions shall also be deemed to fall within the protection scope of the present disclosure.
Claims
1. A focusing method for a linear array camera, comprising: Determining a first position of the line array camera when currently acquiring a first image and a clarity characteristic value of the first image; Acquire a second position of the line array camera corresponding to the clarity characteristic value from a database; Determining a focus position of the line array camera based on a difference between the second position and a reference focus position and the first position, wherein the reference focus position is obtained from the database; Wherein, determining the clarity feature value of the first image includes: determining the clarity feature value of the first image by using a gradient function algorithm or a wavelet transform algorithm.
2. The method according to claim 1, wherein: The step of acquiring the second position of the line array camera corresponding to the clarity characteristic value from a database comprises: Acquire a second image based on the clarity feature value from a database; A second position of the line camera is determined based on the second image.
3. The method according to claim 1, wherein: The step of determining the focus position of the line array camera based on the difference between the second position and the reference focus position and the first position comprises: Acquire a difference between the second position and a reference focus position; If the difference is positive, the position after moving the difference in the first direction based on the first position is determined as the focus position; if the difference is negative, the position after moving the difference in the second direction based on the first position is determined as the focus position, wherein the first direction is opposite to the second direction.
4. The method according to claim 3, wherein: The reference focus position is determined in advance by training, and the training method includes: determining a test location on the target object; Moving the linear array camera at the test position along a preset direction according to a preset step length, and photographing the target object after moving to a corresponding position to obtain a grayscale image; Analyzing each of the obtained grayscale images to calculate the clarity feature value of the grayscale image; The position corresponding to the grayscale image having the largest clarity characteristic value among the clarity characteristic values is determined as the reference focus position.
5. The method according to claim 4, wherein: The method further comprises: A mapping relationship between images corresponding to different clarity feature values in the database and the position of the line array camera is determined based on the reference focus position.
6. The method according to any one of claims 1 to 5, wherein: After determining the focus position of the line array camera, the method further includes: The focus of the line array camera is adjusted to the focus position for shooting.
7. A focusing device for a linear array camera, comprising: A first determination module is configured to determine a first position of the line array camera when currently acquiring a first image and a clarity feature value of the first image; An acquisition module, configured to acquire a second position of the line array camera corresponding to the clarity characteristic value from a database; a second determination module, configured to determine a focus position of the line array camera based on a difference between the second position and a reference focus position and the first position, wherein the reference focus position is obtained from the database; Wherein, the second determination module is specifically configured as follows: Acquire a difference between the second position and a reference focus position; If the difference is positive, the position after moving the difference in the first direction based on the first position is determined as the focus position; if the difference is negative, the position after moving the difference in the second direction based on the first position is determined as the focus position, wherein the first direction is opposite to the second direction.
8. An automatic optical inspection device, comprising a line scan camera and the focusing device of the line scan camera according to claim 7.
Citation Information
Patent Citations
Focusing step length determining method and device, storage medium and electronic device
CN112449117A
Solid focusing method and system thereof
JP2015072444A