Method and device for generating image based on linear array camera
By controlling the target object to move according to the spiral trajectory, the linear array camera collects multiple row images and quickly generates images, solving the problem of long time and low efficiency of image generation in the prior art, and achieving efficient image generation.
Patent Information
- Application Number
- CN202411720547.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-11
AI Technical Summary
In the prior art, when generating images using a linear array camera, it is necessary to adjust the object position multiple times and sing the images sequentially, resulting in a longer time and low efficiency in generating the images.
By controlling the target object to move according to the spiral trajectory, the linear array camera collects multiple row images and uses the pixel value of the image position to determine the pixel value of each pixel point, thereby achieving rapid image generation.
The time for generating images is reduced, the efficiency of image generation is improved, and the linear array camera can complete image acquisition of target objects by scanning at one time.
Smart Images

Figure CN119603403A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a method and device for generating images based on a line array camera. Background Art
[0002] Linear array cameras have the characteristics of high resolution and high sensitivity. Through line-by-line scanning, they can process objects in high-speed motion and capture the details of each line of the image. For the object to be scanned, the linear array camera can quickly capture the continuous line images of the object by controlling the movement of the object without moving the camera itself. Then, the multiple line images collected are stitched to obtain a complete image of the object.
[0003] Currently, the object is usually controlled to move in a straight line, and the linear array camera collects the image of the object line by line. However, when scanning line by line, the position of the object needs to be readjusted multiple times before scanning, resulting in a long scanning time and a long time to obtain a complete image.
[0004] In addition, the image stitching process mainly divides the image to be stitched into multiple rectangles in the x and y directions, and stitches them together by calculating the offset of each part to obtain the final image. However, this calculation process needs to be executed in sequence and stitched one by one, which results in a long image stitching time and low efficiency. Summary of the invention
[0005] In view of this, the present application provides a method and device for generating images based on a line array camera, so as to reduce the time for generating images and improve the efficiency of generating images.
[0006] In a first aspect, the present application provides a method for generating an image based on a line array camera, the method comprising:
[0007] For a first pixel point in an image to be generated, determining a target position corresponding to the first pixel point in a target object, wherein the image to be generated represents an initial image used to determine a target image of the target object, and the first pixel point represents any pixel point in the image to be generated;
[0008] Collecting multiple line images of the target object when it moves along a spiral trajectory based on a line array camera, determining an image position corresponding to the target position in the multiple line images;
[0009] Based on the pixel value of the pixel point corresponding to the image position, the pixel value of the first pixel point is determined to obtain the target image.
[0010] In a possible implementation, the image data of the line image includes angle coding values and circle center distance coding values of pixel points in the line image;
[0011] Wherein, the collecting of a plurality of line images of the target object when it moves along a spiral trajectory based on a line array camera, and determining an image position in the line array camera image corresponding to the target position in the plurality of line images, comprises:
[0012] Based on the target position, determine the current radius and current angle of the spiral line where the pixel point at the image position is located;
[0013] Based on the current radius, the current angle, the angle encoding value, and the circle center distance encoding value, determining a target row image corresponding to a pixel point at the image position and a target column in the target row image in the plurality of row images;
[0014] Based on the target row image and the target column, the image position is determined.
[0015] In a possible implementation, the angle encoding value corresponds to the row image one by one, the angle encoding value indicates the angle of rotation of the target object, and the circle center distance encoding value indicates the distance between the target pixel point in the row image and the circle center of the target object;
[0016] Wherein, determining the target row image corresponding to the pixel point at the image position and the target column in the target row image in the plurality of row images based on the current radius, the current angle, the angle code value, and the circle center distance code value includes:
[0017] Based on the current radius and the initial radius of the spiral trajectory, determining the number of turns of the spiral line where the pixel point at the image position is located;
[0018] Determine a target angle encoding value based on the number of revolutions and the current angle;
[0019] Matching the target angle code value with angle code values corresponding to the plurality of row images, and determining that the row image corresponding to the matched angle code value is the target row image;
[0020] The target column is determined based on the current radius, the circle center distance encoding value and a single pixel size of the target row image.
[0021] In a possible implementation manner, determining the target column based on the current radius, the circle center distance encoding value, and a single pixel size of the target row image includes:
[0022] Calculate the difference between the current radius and the circle center distance encoding value;
[0023] Calculate the ratio of the difference value to the size of a single pixel of the target row image as an offset;
[0024] The target column is determined based on the offset and the column number of the target pixel point in the target row image.
[0025] In a possible implementation, the spacing between adjacent spiral lines in the spiral line trajectory is a fixed value;
[0026] Wherein, determining the number of turns of the spiral line where the pixel point at the image position is located based on the current radius and the initial radius of the spiral line trajectory includes:
[0027] Calculating the difference between the initial radius and the current radius;
[0028] The number of revolutions is determined based on a ratio of the difference to the fixed value.
[0029] In a possible implementation, the size of the image to be generated is determined based on the actual spatial length represented by each pixel in the coordinate system of the image to be generated and the size of the target object;
[0030] The step of determining, for a first pixel point in the image to be generated, a target position corresponding to the first pixel point in the target object includes:
[0031] The target position is obtained by performing calculation based on the position of the first pixel point, the actual space length, and the size of the target object.
[0032] In a possible implementation, the position of the first pixel point includes a first horizontal coordinate and a first vertical coordinate, and the target position includes a second horizontal coordinate and a second vertical coordinate;
[0033] The step of calculating based on the position of the first pixel point, the actual space length, and the size of the target object to obtain the target position includes:
[0034] Calculate a first product of the first horizontal coordinate and the actual space length and a second product of the first vertical coordinate and the actual space length;
[0035] The second abscissa is determined based on a difference between the first product and the radius of the target object, and the second ordinate is determined based on a sum of the second product and the radius of the target object.
[0036] In one possible implementation, for multiple first pixel points in the image to be generated, a graphics processor is used to parallelly execute the determination of target positions corresponding to the multiple first pixel points in the target object and subsequent processes, and determine the pixel values corresponding to the multiple first pixel points respectively, so as to obtain the target image.
[0037] In a possible implementation, the target object includes a wafer;
[0038] The target object rotates at a preset rotation speed and moves laterally at a preset speed;
[0039] The starting position of the target object before moving satisfies: the edge position of the target object is located below the linear array camera;
[0040] The condition for the target object to stop moving includes: the target object moves laterally along the diameter direction until the center of the target object is located below the linear array camera.
[0041] In a second aspect, the present application provides a device for generating an image based on a line array camera, the device comprising:
[0042] A first position determination unit is used to determine, for a first pixel point in an image to be generated, a target position corresponding to the first pixel point in a target object, wherein the image to be generated represents an initial image used to determine a target image of the target object, and the first pixel point represents any pixel point in the image to be generated;
[0043] A second position determination unit, for determining an image position corresponding to the target position in the plurality of row images captured by a linear array camera when the target object moves along a spiral trajectory;
[0044] The image stitching unit is used to determine the pixel value of the first pixel point based on the pixel value of the pixel point corresponding to the image position to obtain the target image.
[0045] In a third aspect, the present application provides an electronic device, the device comprising: a memory and a processor;
[0046] The memory is used to store relevant program codes;
[0047] The processor is used to call the program code to execute the method for generating an image based on a line array camera as described in any one of the implementations of the first aspect.
[0048] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method for generating an image based on a line array camera as described in any one of the implementations of the first aspect above.
[0049] In a fifth aspect, the present application provides a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, the method for generating an image based on a line array camera as described in any one of the implementation methods of the first aspect above is implemented.
[0050] In the above implementation of the present application, in order to obtain a target image obtained by capturing a target object with a linear array camera, first, an image to be generated can be prepared, wherein the image to be generated represents an initial image used to determine the target image. For example, the image to be generated can be a blank image, and the target image is obtained by determining the pixel value of each pixel in the blank image. For a first pixel in the image to be generated, a target position corresponding to the first pixel in the target object is determined, and the first pixel represents any pixel in the image to be generated. Based on a plurality of row images captured by the linear array camera when the target object moves along a spiral trajectory, an image position corresponding to the target position in the plurality of row images is determined. Since the target position corresponds to the position of the first pixel, the pixel value of the first pixel can be determined based on the pixel value of the pixel corresponding to the image position. After determining the pixel value of each first pixel, the image to be generated is filled to obtain the target image. Through the method provided by the present application, the target object can be controlled to move along the spiral trajectory, so that the linear array camera can scan the target object through a one-time scan, thereby reducing the time for generating the target image. Furthermore, in the process of generating an image, the above process can be executed in parallel for each pixel in the image to be generated in a parallel processing manner, so that the pixel value of each pixel in the image to be generated can be quickly determined to obtain the target image, thereby reducing the time for generating an image and improving the efficiency of generating an image. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. It is obvious that the drawings described below are only some embodiments provided in the present application, and a person skilled in the art can also obtain other drawings based on these drawings.
[0052] Figure 1 A flow chart of a method for generating an image based on a line array camera provided in an embodiment of the present application;
[0053] Figure 2a A schematic diagram of a target object moving process provided in an embodiment of the present application;
[0054] Figure 2b A schematic diagram of another target object moving process provided in an embodiment of the present application;
[0055] Figure 3aA schematic diagram of an image coordinate system to be generated provided in an embodiment of the present application;
[0056] Figure 3b A schematic diagram of a target object coordinate system provided in an embodiment of the present application;
[0057] Figure 4 A schematic diagram of image data provided in an embodiment of the present application;
[0058] Figure 5 A schematic diagram of a device for generating images based on a line array camera provided in an embodiment of the present application;
[0059] Figure 6 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0060] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. The described embodiments are only exemplary implementation methods of the present application, not all implementation methods. Those skilled in the art can combine the embodiments of the present application to obtain other embodiments without creative work, and these embodiments are also within the scope of protection of the present application.
[0061] Linear array cameras have the characteristics of high resolution and high sensitivity. Through line-by-line scanning, they can process objects in high-speed motion and capture the details of each line of the image. For the object to be scanned, the linear array camera can quickly capture the continuous line images of the object by controlling the movement of the object without moving the camera itself. Then, the multiple line images collected are stitched to obtain a complete image of the object.
[0062] Currently, the object is usually controlled to move in a straight line, and the linear array camera collects the image of the object line by line. However, when scanning line by line, the position of the object needs to be readjusted multiple times before scanning, resulting in a long scanning time and a long time to obtain a complete image.
[0063] In addition, the image stitching process mainly divides the image to be stitched into multiple rectangles in the x and y directions, and stitches them together by calculating the offset of each part to obtain the final image. However, this calculation process needs to be executed in sequence and stitched one by one, which results in a long image stitching time and low efficiency.
[0064] Take an application scenario as an example. Wafers are the basic materials for manufacturing semiconductors. The quality of wafers directly affects the performance of the final manufactured semiconductors. Therefore, during the semiconductor manufacturing process, wafers need to be inspected for defects to ensure that the quality of the wafers meets the design requirements. Linear array cameras are usually used for image acquisition in the wafer inspection process because of their high resolution and high sensitivity.
[0065] During wafer inspection, the wafer is currently controlled to move along a straight line, and a linear array camera is used to capture the wafer during the movement to obtain multiple line images. The multiple line images captured by the linear array camera are then stitched together to obtain a wafer image for wafer inspection. However, when scanning line by line, the position of the wafer needs to be readjusted multiple times before scanning, resulting in a long scanning time and a long time to obtain a wafer image, which also affects the efficiency of wafer inspection in the future. In the image stitching process, the line image to be stitched is mainly divided into multiple rectangles in the x-direction and y-direction, and the offset of each part is calculated for stitching to obtain the final wafer image. This calculation process needs to be executed in sequence and stitched one by one, resulting in a long image stitching time and low efficiency.
[0066] Based on this, an embodiment of the present application provides a method for generating an image based on a line array camera, so as to reduce the time of generating an image and improve the efficiency of generating an image. In specific implementation, in order to obtain a target image obtained by capturing a target object with a line array camera, an image to be generated may be prepared first, wherein the image to be generated represents an initial image used to determine the target image. For example, the image to be generated may be a blank image, and the target image is obtained by determining the pixel value of each pixel in the blank image. For a first pixel in the image to be generated, a target position corresponding to the first pixel in the target object is determined, and the first pixel represents any pixel in the image to be generated. Based on a plurality of row images captured by the line array camera when the target object moves along a spiral trajectory, an image position corresponding to the target position in the plurality of row images is determined. Since the target position corresponds to the position of the first pixel, the pixel value of the first pixel may be determined based on the pixel value of the pixel corresponding to the image position. After the pixel value of each first pixel is determined, the image to be generated is filled, thereby obtaining the target image. Through the method provided in the embodiment of the present application, the target object can be controlled to move along the spiral trajectory, so that the linear array camera can scan the target object through a one-time scan, thereby reducing the time to generate the target image. In addition, in the process of generating the image, the above process can be performed in parallel for each pixel point in the image to be generated in a parallel processing manner, so that the pixel value of each pixel point in the image to be generated can be quickly determined to obtain the target image, thereby reducing the time to generate the image and improving the efficiency of generating the image.
[0067] In order to facilitate understanding of the technical solutions provided by the embodiments of the present application, a detailed introduction will be given below in conjunction with the drawings in the embodiments.
[0068] See also Figure 1 As shown, it is a flow chart of a method for generating an image based on a line array camera provided in an embodiment of the present application.
[0069] The method may be executed by an image processing device, for example, a graphics processing unit (GPU).
[0070] The method may include the following steps:
[0071] S101: For a first pixel point in an image to be generated, determine a target position corresponding to the first pixel point in a target object.
[0072] The image to be generated represents an initial image used to determine the target image of the target object, and the first pixel represents any pixel in the image to be generated. That is, in order to obtain the target image of the target object captured by the linear array camera, an initial image can be prepared in advance, for example, the initial image can be a blank image. By determining the pixel value of each pixel in the initial image, the initial image is filled, and the final target image can be obtained.
[0073] The image to be generated is obtained by collecting the target object, so any pixel point in the image to be generated, that is, the first pixel point, can find the target position corresponding to the first pixel point in the target object. By collecting the image of the target position, the first pixel point in the image to be generated is obtained.
[0074] S102: collecting a plurality of line images of the target object moving along the spiral trajectory using a line array camera, and determining an image position corresponding to the target position in the plurality of line images.
[0075] In an embodiment of the present application, it is necessary to control the target object to move along a spiral trajectory, so that the linear array camera can scan the image of the target object at one time without having to re-move the position of the target object multiple times. During the movement, the linear array camera captures images of the target object to obtain multiple row images. In order to determine the pixel value of the pixel point in the image to be generated, the corresponding image position of each pixel point in the multiple row images can be found. Since the row image is generated by capturing the target object and the target position corresponding to the first pixel point in the target object is determined, the image position corresponding to the target position can be determined in the multiple row images.
[0076] S103: Determine the pixel value of the first pixel point based on the pixel value of the pixel point corresponding to the image position to obtain a target image.
[0077] After determining the target position and image position corresponding to the first pixel, the pixel value of the first pixel can be determined based on the pixel value of the pixel at the image position. The above process is performed for each pixel in the image to be generated, and the pixel value of each pixel in the image to be generated can be determined, thus obtaining the target image.
[0078] In one possible implementation, for multiple first pixel points in the image to be generated, a graphics processor can be used to parallelly execute the target positions corresponding to the multiple first pixel points in the target object and subsequent processes, so that the pixel values corresponding to the multiple first pixel points can be determined through parallel tasks to obtain the target image.
[0079] For example, the graphics processor may be a GPU, which may group tasks of determining pixel values of a plurality of pixels, and assign the grouped tasks to a plurality of cores in the GPU. Each core may process its own task in parallel without affecting each other, thereby improving processing efficiency.
[0080] Through the method provided in the embodiment of the present application, the target object can be controlled to move along the spiral trajectory, so that the linear array camera can scan the target object through a one-time scan, thereby reducing the time to generate the target image. In addition, in the process of generating the image, the above process can be performed in parallel for each pixel point in the image to be generated in a parallel processing manner, so that the pixel value of each pixel point in the image to be generated can be quickly determined to obtain the target image, thereby reducing the time to generate the image and improving the efficiency of generating the image.
[0081] The specific implementation process of the above steps and the technical effects that can be further produced will be described in detail below in conjunction with the embodiments.
[0082] In a possible implementation, the target object captured by the linear array camera in the embodiment of the present application can be approximately a circular object. For example, the target object can be a wafer. In order to realize the detection of the wafer, the wafer is controlled to move along a spiral trajectory, and the image of the wafer is continuously captured by the linear array camera during the movement of the wafer, thereby obtaining multiple line images. Then, the multiple line images are spliced and fused to obtain a wafer image.
[0083] See also Figure 2a , which is a schematic diagram of a target object moving process provided in an embodiment of the present application.
[0084] Before moving, it is necessary to determine the starting position of the target object before moving. In a possible implementation, the edge position of the target object can be controlled to be located below the linear array camera. Since the shape of the target object can be approximately simplified as a circle, the edge position of the target object represents the position on the circumference. At the beginning, any position on the edge of the target object can be controlled to be located below the linear array camera. Figure 1 Of the target object shown, point A, point B, and point C all belong to the edge positions of the target object.
[0085] In order to make the moving trajectory of the target object a spiral trajectory, the target object can be controlled to rotate at a preset speed and move laterally at a preset speed, and the moving trajectory of the target object is a spiral trajectory. When the target object moves laterally, the target object can be controlled to move in a radial direction.
[0086] In a possible implementation, the target object can be placed on the moving table, and the target object can move with the moving table. For example, the target object can be placed on the moving table by adsorption. During the detection process, the moving table can be controlled to rotate at a preset speed and move laterally at a preset speed, so the moving table can also carry the target object to rotate at a preset speed and move laterally at a preset speed, and the moving trajectory of the target object is a spiral trajectory.
[0087] In a possible implementation, the motion platform may include a turntable, that is, the turntable is controlled to rotate at a preset speed and move laterally at a preset speed on the lateral moving platform, and the target object moves along with the movement of the turntable.
[0088] In a possible implementation, the motion platform may include a turntable and a transverse moving platform, wherein the relative transverse positions of the turntable and the transverse moving platform remain unchanged. During the movement process, the turntable may be controlled to rotate at a preset speed at a fixed position of the transverse moving platform, and the transverse moving platform may be controlled to move transversely at a preset speed. At this time, the turntable simultaneously follows the transverse moving platform to move transversely at a preset speed, and the trajectory of the target object following the turntable is a spiral line.
[0089] During the movement of the target object, the line array camera continuously collects images of the target object. After all images of the target object are collected, in order to avoid waste of resources, the target object can be controlled to stop moving, and the target image of the target object is determined based on the collected multiple line images.
[0090] Optionally, the condition for the target object to stop moving may be: the target object rotates at a preset rotation speed and moves laterally along the diameter direction at the same time until the center of the target object is located below the linear array camera.
[0091] For details, please refer to Figure 2b , which is a schematic diagram of another target object moving process provided in an embodiment of the present application.
[0092] In this application scenario, when the edge position point A of the target object is located below the linear array camera, the turntable is controlled to rotate counterclockwise with the target object at a preset speed, and the turntable is controlled to move left on the lateral moving table at a preset speed. At this time, the lateral movement trajectory of the target object coincides with the diameter until the center O of the target object is located below the linear array camera, at which time the target object can be controlled to stop moving.
[0093] It should be noted that the application scenario provided in the above embodiment is only an exemplary description and is not limited to the above movement mode, and it is sufficient to ensure that the target object moves along the spiral trajectory. For example, the right edge position of the target object can also be controlled to be located below the linear array camera, and the target object can be controlled to rotate at a preset speed and move rightward along the diameter direction at a preset speed. In this case, the movement trajectory of the target object is also a spiral line.
[0094] The edge of the target object is located below the linear array camera as the starting position, and the center of the target object is located below the linear array camera as the moving end position. The current radius of the spiral line where the target object is located can be expressed in the following way:
[0095]
[0096] Where r is the current radius. R is the starting radius, that is, the radius of the target object. θ is the current rotation angle. Indicates that the ratio of θ to 2π is rounded down. For example, when the ratio of θ to 2π is 2.7, the rounded down ratio is 2. Pitch indicates the spacing between adjacent spiral lines, which can be set in advance.
[0097] In a possible implementation, the movement process of the target object may be controlled by a control device, wherein the control device and the image processing device may be located in the same device or may be two independent devices, which is not limited in the embodiment of the present application.
[0098] After the line array camera acquires multiple line images of the target object, the images may be sent to the image processing device. For example, the image processing device may store the acquired multiple line images in a cache so as to process the line images later.
[0099] The following first introduces step S101 “determining a target position corresponding to a first pixel point in the image to be generated in the target object” in conjunction with the embodiment.
[0100] In order to obtain the target image, an image to be generated can be prepared in advance as an initial image for determining the target image of the target object. For example, the image to be generated can be a blank image. By determining the pixel value of each pixel in the image to be generated, the final image, i.e., the target image, is determined.
[0101] In specific implementation, the size of the target image of the target object, that is, the size of the image to be generated, can be determined first. Since the image to be generated needs to accommodate the complete target object, the size of the image to be generated can be determined according to the size of the target object and the actual space length represented by each pixel in the coordinate system of the image to be generated.
[0102] Since the target object can be approximately circular, in order to allow the image to be generated to accommodate the entire target object, the minimum size of the image to be generated can be determined to be a square. At this time, by calculating the ratio of the diameter of the target object to the actual space length represented by each pixel in the coordinate system of the image to be generated, the side length of the image to be generated can be determined, that is, the size of the image to be generated is determined.
[0103] It should be noted that in actual application scenarios, in order to reduce errors in the image stitching process, the length and width of the image to be generated can be set to be greater than the ratio, and the embodiments of the present application do not limit this. By determining the minimum size of the image to be generated, the computing resources occupied can be reduced, the computing process can be simplified, thereby improving the efficiency of determining the target image and reducing the time to determine the target image.
[0104] After determining the size of the image to be generated, for any pixel point in the image to be generated, that is, the first pixel point, the target position corresponding to the first pixel point in the target object is determined. In other words, it is determined at which position of the target object the image of the first pixel point is acquired.
[0105] In a possible implementation, since the coordinate system of the image to be generated and the coordinate system of the target object are different, the position of the first pixel point may be transformed based on a transformation relationship between the coordinate system of the image to be generated and the coordinate system of the target object to obtain the target position.
[0106] Since the position in the target object coordinate system represents the position in the actual space, when the position of the first pixel is converted, the target position can be obtained by calculation based on the position of the first pixel, the actual space length represented by each pixel in the coordinate system of the image to be generated, and the size of the target object.
[0107] For better explanation, the process of obtaining the target position is introduced by taking the position of the first pixel point including the first horizontal coordinate and the first vertical coordinate, and the target position including the second horizontal coordinate and the second vertical coordinate as an example. In specific implementation, the first product of the first horizontal coordinate and the actual space length represented by each pixel in the coordinate system of the image to be generated, and the second product of the first vertical coordinate and the actual space length represented by each pixel in the coordinate system of the image to be generated are calculated. The second horizontal coordinate is determined based on the first product and the radius of the target object, and the second vertical coordinate is determined based on the second product and the radius of the target object.
[0108] The following is an introduction based on an application scenario. Figure 3a and Figure 3b As shown, Figure 3a A schematic diagram of an image coordinate system to be generated provided in an embodiment of the present application, Figure 3b A schematic diagram of a target object coordinate system provided in an embodiment of the present application.
[0109] In the image to be generated, Figure 3a As shown, a coordinate system of the image to be generated is established, and the coordinate origin is p. Among them, the square area containing the target object composed of dotted lines and coordinate axes can be represented as the image area to be generated. In the target object, the target object coordinate system can be established with the center O of the target object as the coordinate origin. Taking the pixel point pd in the image to be generated as an example, the target position point D of the pixel point pd in the target object is determined. Taking the first pixel point pd including the first horizontal coordinate and the first vertical coordinate, and the target position point D including the second horizontal coordinate and the second vertical coordinate as an example, the first horizontal coordinate and the actual space length represented by each pixel in the coordinate system of the image to be generated are first calculated. The first product of the actual space length represented by each pixel in the coordinate system of the image to be generated, and the second product of the actual space length represented by each pixel in the coordinate system of the image to be generated are calculated. Combined with the positional relationship between the coordinate system of the image to be generated and the coordinate system of the target object, it can be known that the second horizontal coordinate can be determined based on the difference between the first product and the radius of the target object. Since the first vertical coordinate is a negative number, the second vertical coordinate can be determined based on the sum of the second product and the radius of the target object.
[0110] It should be noted that the above embodiment introduces the process of determining the target position by combining the positional relationship between the target object coordinate system and the image coordinate system to be generated in combination with an application scenario, but this embodiment is only an exemplary description and does not limit the present application in any form. The positional relationship between the target object coordinate system and the image coordinate system to be generated can also have other forms, but the principle of determining the target position is the same, and this embodiment of the present application will not be described in detail.
[0111] The following describes step S102 "capturing multiple line images of a target object moving along a spiral trajectory based on a linear array camera, and determining an image position corresponding to the target position in the multiple line images" in conjunction with an embodiment.
[0112] When the target object moves along the spiral trajectory, the linear array camera can be used to capture the target object and obtain multiple line images. The main working principle of the linear array camera includes the following: When light shines on the first row of pixels, an initial photocharge is generated. In the next clock cycle, these charges are transferred to the second row of pixels. At the same time, the first row of pixels continues to receive new photons and generate new charges. The above process continues, and each row of pixels receives new photons and accumulates charges from the previous row. When the charge reaches the last row of pixels, the accumulated signal of the last row of pixels is read out to form the final image signal, that is, the line image output by the linear array camera.
[0113] In order to ensure that the linear array camera can clearly capture the image of the target object and prevent the image from being blurred, it is necessary to control the moving speed of the target object. Specifically, it can be achieved in the following way: based on the line frequency of the linear array camera and the pixel size in the line image, determine the linear speed of the target object when it rotates. Among them, the pixel size represents the length of the actual space represented by each pixel. The line frequency can represent the charge transfer frequency in the linear array camera. Since the charge transfer speed can be obtained by the pixel size in the line image and the time to move the pixel size, and the time can be expressed as the inverse of the frequency, the charge transfer speed can be obtained by calculating the product of the pixel size in the line image and the line frequency. In order to make the image of the target object captured by the linear array camera clearer, the charge transfer speed can be synchronized with the linear speed of the target object by controlling it. That is, the product of the pixel size in the line image and the line frequency can be calculated to obtain the linear speed of the target object when it rotates.
[0114] Optionally, the line array camera can be a time delay integration (TDI) camera. The TDI camera is used to collect images of the target object. The TDI camera can significantly improve the signal strength by accumulating light signals multiple times, and capture the details of bright and dark areas at the same time, obtain images with high contrast, improve the signal-to-noise ratio of the image, and output high-quality image signals. Due to the use of time delay integration technology, the TDI camera can complete image acquisition in a short time, thereby achieving clear imaging in motion scenes.
[0115] In a possible implementation, during the movement of the target object, an encoder can be used to encode the movement of the target object (motion stage) to generate coded data. Optionally, the movement of the motion stage can be controlled by a motor, and the movement of the motor can be encoded. The encoder generates coded data of the movement of the target object and sends the coded data to an image processing device. Since the linear array camera is also collecting images of the target object during the movement of the target object, and the image processing device can obtain the row image output by the linear array camera, the image processing device can match the coded data with the row image one by one as the image data included in the row image. For example, the coded data and the row image generated at the same time can be matched.
[0116] Optionally, the coded data may include: angle coding value and circle center distance coding value, wherein the angle coding value may indicate the angle of rotation of the target object, and the circle center distance coding value may indicate the distance between the light spot of the target object and the center of the target object, that is, the current radius of the spiral line where the target object is located.
[0117] It should be noted that, under normal circumstances, the initial angle encoding value obtained by the encoder encoding the motor movement is a encoding value corresponding to [0, 2π]. That is, the angle encoding value will be reset after moving one circle along the spiral line, so it is impossible to determine how many circles the target object has rotated based on the initial angle encoding value. Based on this, the embodiment of the present application can combine the initial encoding value corresponding to each row image with its corresponding number of circles, transform the initial encoding value into an increasing sequence, and obtain the final angle encoding value. That is, the angle encoding value = the angle encoding value corresponding to 2π * the number of circles + the initial angle encoding value.
[0118] Since the coded data is usually a set of data corresponding to the light spot, and the line image includes multiple pixels, in order to establish a matching relationship between the coded data and the line image, in a possible implementation, before using the line array camera to capture the target object, the line array camera and the target object can be calibrated to determine the position correspondence between the line image of the line array camera and the target object. Specifically, after the light beam is irradiated on the target object to form a light spot, the light is reflected to the line array camera, and the line array camera generates a line image of the illuminated area of the target object. The target pixel point in the line image can be aligned with the midpoint of the light spot. Then, the coded data corresponding to the light spot can be represented as the image data of the target pixel point. For example, the target pixel point can be the middle pixel point of the line image.
[0119] After determining the target position of the first pixel point in the target object based on step S101, the target position can be understood as the position of the light spot in the target object, and then the image data of the corresponding position of the target position in the row image can be obtained, that is, the angle coding value and the center distance coding value corresponding to the pixel point at the image position.
[0120] The target position of the target object can be understood as the coordinates in the rectangular coordinate system, which can be converted into the coordinates in the polar coordinate system, that is, the current radius and the current angle, and the current radius and the current angle of the spiral line where the target position is located, that is, the current radius and the current angle of the spiral line corresponding to the pixel point at the image position. For example, if (x, y) represents the coordinates of the target position, then Current angle = arctan(y / x).
[0121] Since the line array camera outputs multiple row images, each pixel of each row image corresponds to an angle code value and a circle center distance code value. Therefore, based on the current radius, current angle, and each angle code value and circle center distance code value, the target row image and the target column in the target row image corresponding to the pixel at the image position can be determined in the multiple row images. Therefore, the image position can be determined based on the target row image and the target column.
[0122] In a possible implementation, when determining the target row image, the multiple row images of the line array camera can be sorted in the order of output by default. For example, the first row image is the first row, and the last row image acquired is the last row. Figure 4 Shown is a schematic diagram of image data provided in an embodiment of the present application.
[0123] When the target object moves, each spiral line in the spiral trajectory corresponds to an oblique line of sight. The angle code value and the center distance code value corresponding to the first spiral trajectory are the oblique solid line on the far right. As the movement progresses, the corresponding oblique line of sight moves to the left. Figure 4 It can be seen that after the current radius of the spiral line where the pixel point at the image position is located is obtained, it may correspond to multiple turns of the spiral line. Therefore, the number of turns of the spiral line where the pixel point at the image position is located can be determined based on the current radius and the initial radius of the spiral line trajectory.
[0124] In specific implementation, according to the formula for calculating the current radius provided in the above embodiment, if the spacing between adjacent spiral lines is a fixed value, the number of turns can be calculated based on the above formula. Specifically, the difference between the initial radius and the current radius is calculated. Then, based on the ratio of the difference to the fixed value, the number of turns is determined. That is, the number of turns = (initial radius R-current radius r) / pitch of adjacent spiral lines. When the ratio is a decimal, the decimal can be rounded down to obtain the number of turns.
[0125] Based on the calculated number of turns and the current angle, the corresponding target angle code value is calculated. That is, the angle code value corresponding to the current angle is first determined, and the target angle code value = the angle code value corresponding to 2π * the number of turns + the angle code value corresponding to the current angle.
[0126] Since the row image is an image obtained by capturing a certain position of the target object, the angle code value corresponding to each pixel in the row image is the same, that is, the row image and the angle code value correspond one to one. Then, the target angle code value can be matched with the angle code values corresponding to the multiple row images, so that the row image corresponding to the angle code value matching the target angle code value is determined to be the target row image.
[0127] After determining the target row image, different pixels in the target row image have different distances from the center of the target object. The current radius represents the distance between the pixel at the image position and the center of the target object. The center distance coding value corresponding to the target row image represents the distance between the target pixel in the target row image and the center of the target object. Therefore, based on the difference between the current radius and the center distance coding value, the distance between the pixel at the image position and the target pixel can be determined, thereby determining the column number where the pixel at the image position is located.
[0128] In the specific implementation, the difference between the current radius and the coded value of the center distance is first calculated. Among them, when calculating the difference, the actual length corresponding to the coded value of the center distance is first determined, and the difference between the current radius and the actual length is calculated. Then, according to the size of a single pixel in the target row image, the number of pixels corresponding to the difference can be determined, that is, the offset between the pixel point at the image position and the target pixel point. That is, the ratio of the difference to the size of a single pixel in the target row image is calculated as the offset. Since the number of columns of the target pixel point in the target row image can be known, the target column can be determined based on the offset and the number of columns of the target pixel point in the target row image.
[0129] Optionally, when the calculated offset contains a decimal, two integers on the left and right of the decimal can be determined to judge which pixel point among the pixels corresponding to the two integers is closer to the current radius, and the position of the closer pixel point is determined to be the image position.
[0130] Through the method provided in the embodiment of the present application, the target object can be controlled to move along a spiral trajectory, so that the linear array camera can scan the target object in a single scan, which can reduce the time to generate the target image. In addition, in the process of generating an image, each pixel point in the image to be generated can be processed in parallel in a parallel processing manner, and the pixel value of each pixel point in the image to be generated can be quickly determined to obtain the target image, thereby reducing the time to generate the image and improving the efficiency of generating the image.
[0131] Based on the above method embodiment, the present application embodiment also provides a device for generating images based on a line array camera. Figure 5 , which is a schematic diagram of a device for generating images based on a line array camera provided in an embodiment of the present application.
[0132] The device 500 comprises:
[0133] A first position determining unit 501 is used to determine, for a first pixel point in an image to be generated, a target position corresponding to the first pixel point in a target object, wherein the image to be generated represents an initial image used to determine a target image of the target object, and the first pixel point represents any pixel point in the image to be generated;
[0134] A second position determination unit 502 is used to determine an image position corresponding to the target position in the plurality of line images captured by a line array camera when the target object moves along a spiral trajectory;
[0135] The image stitching unit 503 is used to determine the pixel value of the first pixel point based on the pixel value of the pixel point corresponding to the image position, so as to obtain the target image.
[0136] In one possible implementation, the image data of the row image includes angle coding values and center distance coding values of pixel points in the row image; the second position determination unit 502 is specifically used to determine, based on the target position, the current radius and current angle of the spiral line where the pixel point at the image position is located; based on the current radius, the current angle, the angle coding value, and the center distance coding value, determine the target row image corresponding to the pixel point at the image position in multiple row images and the target column in the target row image; determine the image position based on the target row image and the target column.
[0137] In a possible implementation, the angle encoding value corresponds to the row image one by one, the angle encoding value indicates the angle through which the target object has been rotated, and the center-of-circle distance encoding value indicates the distance between the target pixel point in the row image and the center of the target object; the second position determination unit 502 is specifically used to determine the number of turns of the spiral line where the pixel point at the image position is located based on the current radius and the initial radius of the spiral trajectory; determine the target angle encoding value based on the number of turns and the current angle; match the target angle encoding value with the angle encoding values corresponding to multiple row images, and determine that the row image corresponding to the matching angle encoding value is the target row image; determine the target column based on the current radius, the center-of-circle distance encoding value, and the single pixel size of the target row image.
[0138] In one possible implementation, the second position determination unit 502 is specifically used to calculate the difference between the current radius and the circle center distance encoding value; calculate the ratio of the difference to the single pixel size of the target row image as an offset; and determine the target column based on the offset and the number of columns of the target pixel point in the target row image.
[0139] In a possible implementation, the spacing between adjacent spiral lines in the spiral trajectory is a fixed value; the second position determination unit 502 is specifically used to calculate the difference between the initial radius and the current radius; and determine the number of turns based on the ratio of the difference to the fixed value.
[0140] In one possible implementation, the size of the image to be generated is determined based on the actual space length represented by each pixel in the coordinate system of the image to be generated and the size of the target object; the first position determination unit 501 is specifically used to calculate based on the position of the first pixel point, the actual space length and the size of the target object to obtain the target position.
[0141] In a possible implementation, the position of the first pixel point includes a first horizontal coordinate and a first vertical coordinate, and the target position includes a second horizontal coordinate and a second vertical coordinate; the first position determination unit 501 is specifically used to calculate a first product of the first horizontal coordinate and the actual space length and a second product of the first vertical coordinate and the actual space length; determine the second horizontal coordinate based on the difference between the first product and the radius of the target object, and determine the second vertical coordinate based on the sum of the second product and the radius of the target object.
[0142] In one possible implementation, for multiple first pixel points in the image to be generated, a graphics processor is used to parallelly execute the determination of target positions corresponding to the multiple first pixel points in the target object and subsequent processes, and determine the pixel values corresponding to the multiple first pixel points respectively, so as to obtain the target image.
[0143] In a possible implementation, the target object includes a wafer; the target object rotates at a preset rotation speed and moves laterally at a preset speed; the starting position of the target object before moving satisfies: the edge position of the target object is located below the linear array camera; the condition for the target object to stop moving includes: the target object moves laterally along the diameter direction until the center of the target object is located below the linear array camera.
[0144] Based on the above method embodiment and device embodiment, the present application embodiment further provides an electronic device, which will be described below in conjunction with the accompanying drawings.
[0145] See also Figure 6 , Figure 6 A schematic diagram of an electronic device provided in an embodiment of the present application.
[0146] The device 600 includes: a memory 601 and a processor 602;
[0147] The memory 601 is used to store relevant program codes;
[0148] The processor 602 is used to call the program code to execute the method for generating an image based on a line array camera described in the above method embodiment.
[0149] In addition, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method for generating an image based on a line array camera described in the above method embodiment.
[0150] An embodiment of the present application further provides a computer program product, which includes a computer program / instruction. When the computer program / instruction is executed by a processor, the method for generating an image based on a line array camera as described in the above method embodiment is implemented.
[0151] It should be noted that the technical features of the higher-level means provided in the embodiments of the present application are clear to those skilled in the art, and the problems to be solved by the higher-level means are also clear. The means for obtaining the corresponding features can be selected by those skilled in the art according to specific implementation requirements. The means provided in this application should not be regarded as a limitation on the solution or as the only means of implementation.
[0152] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can refer to each other. In particular, for the system or device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only exemplary, in which the units or modules described as separate components may or may not be physically separated, and the components displayed as units or modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units, and some or all of the units or modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0153] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the method, device and equipment etc. of various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of the boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0154] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0155] It should also be noted that, in this application, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0156] The steps of the method or algorithm described in conjunction with the embodiments disclosed in this application can be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0157] The above description of the disclosed embodiments enables professionals and technicians in the field to implement or use the present application. Various modifications to these embodiments will be apparent to professionals and technicians in the field, and the general principles defined in this application can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown in the present application, but will conform to the widest range consistent with the principles and novel features disclosed in the present application.
Claims
1. A method for generating an image based on a line array camera, characterized in that: The method comprises: For a first pixel point in an image to be generated, determining a target position corresponding to the first pixel point in a target object, wherein the image to be generated represents an initial image used to determine a target image of the target object, and the first pixel point represents any pixel point in the image to be generated; Collecting multiple line images of the target object when it moves along a spiral trajectory based on a line array camera, determining an image position corresponding to the target position in the multiple line images; Based on the pixel value of the pixel point corresponding to the image position, the pixel value of the first pixel point is determined to obtain the target image.
2. The method according to claim 1, characterized in that The image data of the line image includes angle coding values and circle center distance coding values of pixel points in the line image; Wherein, the collecting of a plurality of line images of the target object when it moves along a spiral trajectory based on a line array camera, and determining an image position in the line array camera image corresponding to the target position in the plurality of line images, comprises: Based on the target position, determine the current radius and current angle of the spiral line where the pixel point at the image position is located; Based on the current radius, the current angle, the angle encoding value, and the circle center distance encoding value, determining a target row image corresponding to a pixel point at the image position and a target column in the target row image in the plurality of row images; Based on the target row image and the target column, the image position is determined.
3. The method according to claim 2, characterized in that The angle encoding value corresponds to the row image one by one, the angle encoding value indicates the angle of rotation of the target object, and the circle center distance encoding value indicates the distance between the target pixel point in the row image and the circle center of the target object; Wherein, determining the target row image corresponding to the pixel point at the image position and the target column in the target row image in the plurality of row images based on the current radius, the current angle, the angle code value, and the circle center distance code value includes: Based on the current radius and the initial radius of the spiral trajectory, determining the number of turns of the spiral line where the pixel point at the image position is located; Determine a target angle encoding value based on the number of revolutions and the current angle; Matching the target angle code value with angle code values corresponding to the plurality of row images, and determining that the row image corresponding to the matched angle code value is the target row image; The target column is determined based on the current radius, the circle center distance encoding value and a single pixel size of the target row image.
4. The method according to claim 3, characterized in that The determining the target column based on the current radius, the circle center distance encoding value and the single pixel size of the target row image includes: Calculate the difference between the current radius and the circle center distance encoding value; Calculate the ratio of the difference value to the size of a single pixel of the target row image as an offset; The target column is determined based on the offset and the column number of the target pixel point in the target row image.
5. The method according to claim 3, characterized in that: The spacing between adjacent spiral lines in the spiral trajectory is a fixed value; Wherein, determining the number of turns of the spiral line where the pixel point at the image position is located based on the current radius and the initial radius of the spiral line trajectory includes: Calculating the difference between the initial radius and the current radius; The number of revolutions is determined based on a ratio of the difference to the fixed value.
6. The method according to claim 1, characterized in that The size of the image to be generated is determined based on the actual space length represented by each pixel in the coordinate system of the image to be generated and the size of the target object; The step of determining, for a first pixel point in the image to be generated, a target position corresponding to the first pixel point in the target object includes: The target position is obtained by performing calculation based on the position of the first pixel point, the actual space length, and the size of the target object.
7. The method according to claim 6, characterized in that The position of the first pixel point includes a first horizontal coordinate and a first vertical coordinate, and the target position includes a second horizontal coordinate and a second vertical coordinate; The step of calculating based on the position of the first pixel point, the actual space length, and the size of the target object to obtain the target position includes: Calculate a first product of the first horizontal coordinate and the actual space length and a second product of the first vertical coordinate and the actual space length; The second abscissa is determined based on a difference between the first product and the radius of the target object, and the second ordinate is determined based on a sum of the second product and the radius of the target object.
8. The method according to claim 1, characterized in that For the multiple first pixel points in the image to be generated, a graphics processor is used to parallelly execute the target positions corresponding to the multiple first pixel points in the target object and the subsequent processes, and the pixel values corresponding to the multiple first pixel points are determined to obtain the target image.
9. The method according to any one of claims 1 to 8, characterized in that: The target object includes a wafer; The target object rotates at a preset rotation speed and moves laterally at a preset speed; The starting position of the target object before moving satisfies: the edge position of the target object is located below the linear array camera; The condition for the target object to stop moving includes: the target object moves laterally along the diameter direction until the center of the target object is located below the linear array camera.
10. A device for generating images based on a line array camera, characterized in that: The device comprises: A first position determination unit is used to determine, for a first pixel point in an image to be generated, a target position corresponding to the first pixel point in a target object, wherein the image to be generated represents an initial image used to determine a target image of the target object, and the first pixel point represents any pixel point in the image to be generated; A second position determination unit, for determining an image position corresponding to the target position in the plurality of row images captured by a linear array camera when the target object moves along a spiral trajectory; The image stitching unit is used to determine the pixel value of the first pixel point based on the pixel value of the pixel point corresponding to the image position to obtain the target image.