Digital optical axis stability detection method and system
Through digital optical axis stability detection methods and systems, the detection platform of parallel light tubes and targets is used to quickly and accurately measure the optical axis stability of photoelectric imaging products, solving the problems of time-consuming, labor-intensive and low accuracy of existing detection methods, and achieving efficient and accurate detection results.
Patent Information
- Application Number
- CN202510114666.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-24
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2045-01-24
AI Technical Summary
The existing optical axis stability detection methods are time-consuming and labor-intensive to operate, and the accuracy is related to manual judgment, which easily leads to deviations and makes it difficult to achieve fast and accurate detection.
Using digital optical axis stability detection methods and systems, the optical axis stability detection platform is formed by combining the photoelectric imaging product to be measured, parallel light tubes and targets, and the operation of the product to be tested is controlled, and the target is imaged on the specified object distance through parallel light tubes, pictures of the initial and target characteristic hole location areas are recorded, the center coordinate offset is calculated, and the optical axis stability is detected.
It realizes rapid and accurate measurement of the optical axis stability of photoelectric imaging products, improves detection efficiency, reduces manual errors, and obtains more accurate detection results.
Smart Images

Figure CN119915496A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of optical axis stability detection, and in particular relates to a digital optical axis stability detection method and system. Background Art
[0002] In actual applications, optoelectronic imaging products need to aim at various targets near and far. According to the Gaussian formula, the clearest imaging position is different for targets with different objective lenses, that is, the optical back focus needs to be adjusted to achieve the best imaging effect for targets at different object distances, thereby achieving better aiming accuracy and product experience. However, lenses with focusing functions require a more complex optical structure design to achieve the change in the relative position of the lens and the movement. During the product focusing process or after impact and vibration, the gap between the mating parts, seismic reliability and other issues often cause the optical axis to shift, resulting in a poor product aiming effect. Therefore, optical axis stability has always been one of the important indicators of optoelectronic imaging products. In the production inspection of such products, the optical axis stability detection system is a necessary test item.
[0003] The traditional test method places the product in the light path of a parallel light tube, aims at a single point or line target, and then performs focusing. The stability of the optical axis is qualitatively estimated by observing the movement of the target in the picture with the human eye, or by intercepting part of the image during the process and calculating the pixel coordinates of the target in the picture to calculate the offset difference. A more accurate method would add a two-dimensional turntable to the product fixture. When the optical axis is found to move, the angle is recorded by rotating the turntable to convert the offset angles in the horizontal and vertical directions. It can be found that the existing methods are time-consuming and labor-intensive to operate, and the accuracy is highly correlated with manual judgment, which is easy to cause deviations. Summary of the invention
[0004] Based on this, an embodiment of the present invention provides a digital optical axis stability detection method and system, which aims to quickly and accurately measure the optical axis stability of optoelectronic imaging products.
[0005] A first aspect of an embodiment of the present invention provides a digital optical axis stability detection method, which is applied to a scene with an optical axis stability detection platform, wherein the optical axis stability detection platform includes an optoelectronic imaging product to be tested, a collimator, and a target which are optically connected in sequence, wherein the target is fixed on a first carrier, and the target is moved by the first carrier, and the optoelectronic imaging product to be tested is fixed on a second carrier, and the height and angle of the optoelectronic imaging product to be tested are adjusted by the second carrier so that the optoelectronic imaging product to be tested aims at the target through the collimator, and the optoelectronic imaging product to be tested and the target are both electrically connected to a controller, and the method includes:
[0006] Step 1.1, controlling the photoelectric imaging product to be tested to work, imaging the target at a specified object distance through the collimator, and recording a first image, wherein the first image includes an initial characteristic hole position area determined according to the target;
[0007] Step 1.2, after performing a preset evaluation operation on the optoelectronic imaging product to be tested, repeat the operation in step 1.1 to record a second image, wherein the second image includes a target characteristic hole position area corresponding to the initial characteristic hole position area;
[0008] Step 1.3, respectively determine the center coordinates of the initial characteristic hole position area in the first image and the target characteristic hole position area in the second image, and calculate the offset according to the center coordinates to detect the optical axis stability.
[0009] Furthermore, there are five characteristic hole position areas in both the first image and the second image, wherein one characteristic hole position area is located in the middle area of the target, and the other four characteristic hole position areas are circumferentially arranged in the middle area.
[0010] Furthermore, the step of respectively determining the center coordinates of the initial characteristic hole position area in the first image and the target characteristic hole position area in the second image, and calculating the offset according to the center coordinates includes:
[0011] Acquire a first detection area of the first image and a second detection area of the second image, and perform grayscale processing and binarization processing on the first detection area and the second detection area in sequence to obtain corresponding first binarized images and second binarized images, respectively;
[0012] Performing contour extraction on the first binarized image and the second binarized image respectively, and determining the area of each contour, and performing contour screening according to a preset area to obtain each target contour, wherein the contour extracted from the first binarized image is the initial characteristic hole position area, and the contour extracted from the second binarized image is the target characteristic hole position area;
[0013] Determine the minimum bounding rectangle of each target contour, and obtain the center coordinates of the minimum bounding rectangle;
[0014] Calculating each center offset according to the center coordinates of the minimum bounding rectangle in the first binarized image and the center coordinates of the minimum bounding rectangle in the corresponding second binarized image;
[0015] Calculating the average center offset according to each of the center offsets;
[0016] The angle offset is calculated according to the pixel size of the movement, the focal length of the lens and the average center offset.
[0017] Furthermore, the step of determining the minimum circumscribed rectangle of each target contour includes:
[0018] Step 2.1, obtaining the coordinates of the upper left point and the lower right point on the target contour, determining a circumscribed rectangle, and determining the area of the circumscribed rectangle;
[0019] Step 2.2, rotating all point coordinates on the target contour by a preset angle, obtaining the coordinates of the upper leftmost point and the lower rightmost point on the rotated target contour, determining the corresponding circumscribed rectangle, and calculating the area of the corresponding circumscribed rectangle;
[0020] Step 2.3, determine whether the area of the circumscribed rectangle determined by the rotated target contour is smaller than the area of the circumscribed rectangle determined by the target contour before rotation, if so, execute step 2.4;
[0021] Step 2.4, then loop through steps 2.2 and 2.3 until the area of the bounding rectangle determined by the target contour after rotation is not less than the area of the bounding rectangle determined by the target contour before rotation, and define the bounding rectangle determined by the target contour before rotation as the minimum bounding rectangle.
[0022] Furthermore, in the step of calculating each center offset according to the center coordinates of the minimum bounding rectangle in the first binarized image and the corresponding center coordinates of the minimum bounding rectangle in the second binarized image, the calculation formula of the center offset is:
[0023]
[0024] Among them, Δ i represents the center offset of the i-th characteristic hole area, x centerP1_i represents the horizontal coordinate of the center point of the i-th characteristic hole area in the first binary image, x centerP2_i represents the horizontal coordinate of the center point of the i-th characteristic hole area in the second binary image, y centerP1_i represents the ordinate of the center point of the i-th characteristic hole area in the first binary image, y centerP2_i Represents the ordinate of the center point of the i-th characteristic hole area in the second binarized image.
[0025] Furthermore, in the step of calculating the angle offset according to the movement pixel size, the lens focal length and the center average offset, the angle offset is calculated as follows:
[0026] Δ θ =0.06·tan -1 (Δ pix ·a / (f′·1000))
[0027] Among them, Δ θrepresents the angular offset, Δ pix represents the average center offset, a represents the core pixel size, and f′ represents the focal length of the lens.
[0028] Further, the step of respectively determining the center coordinates of the initial characteristic hole position area in the first image and the target characteristic hole position area in the second image, and calculating the offset according to the center coordinates to detect the optical axis stability includes:
[0029] According to the distribution of each characteristic hole position area on the target, the corresponding target detection area is determined, wherein a part of each characteristic hole position area close to the middle area is taken as the target detection area;
[0030] Converting the target detection area into a grayscale image, and performing edge detection on the grayscale image to obtain an edge image;
[0031] Performing Fourier transformation on the edge image to obtain a frequency domain image;
[0032] Normalizing the frequency domain graph to obtain an MTF curve;
[0033] According to the MTF curve and the preset amplitude, the corresponding frequency is determined as the MTF value of the corresponding characteristic hole position area.
[0034] A second aspect of an embodiment of the present invention provides a digital optical axis stability detection system, which is used to implement the digital optical axis stability detection method as described in the first aspect, and the system includes:
[0035] A first recording module, used to control the operation of the photoelectric imaging product to be tested, to image the target at a specified object distance through the collimator, and to record a first picture, wherein the first picture includes an initial characteristic hole position area determined according to the target;
[0036] A second recording module, configured to perform a preset evaluation operation on the optoelectronic imaging product to be tested, and then repeat the operation in the first recording module to record a second image, wherein the second image includes a target characteristic hole position area corresponding to the initial characteristic hole position area;
[0037] The calculation module is used to respectively determine the center coordinates of the initial characteristic hole position area in the first image and the target characteristic hole position area in the second image, and calculate the offset according to the center coordinates to detect the optical axis stability.
[0038] A third aspect of the embodiments of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the digital optical axis stability detection method as described in the first aspect.
[0039] A fourth aspect of an embodiment of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the program, the digital optical axis stability detection method as described in the first aspect is implemented.
[0040] A digital optical axis stability detection method and system provided in an embodiment of the present invention comprises an optical axis stability detection platform composed of an optoelectronic imaging product to be tested, a collimator and a target, controls the operation of the optoelectronic imaging product to be tested, images the target at a specified object distance through the collimator, and records a first image, wherein the first image includes an initial characteristic hole position area determined according to the target; after performing a preset evaluation operation on the optoelectronic imaging product to be tested, the above operation is repeated to record a second image, wherein the second image includes a target characteristic hole position area corresponding to the initial characteristic hole position area; the center coordinates of the initial characteristic hole position area in the first image and the target characteristic hole position area in the second image are respectively determined, and an offset is calculated based on the center coordinates to detect the optical axis stability. The above method can greatly improve the detection efficiency and obtain accurate detection results. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is a structural schematic diagram of the optical axis stability detection platform;
[0042] Figure 2 A flowchart of a digital optical axis stability detection method provided in the first embodiment of the present invention;
[0043] Figure 3 Schematic diagram of the target;
[0044] Figure 4 This is a schematic diagram of the software interface;
[0045] Figure 5 A structural block diagram of a digital optical axis stability detection system provided in Embodiment 2 of the present invention;
[0046] Figure 6 It is a schematic diagram of the structure of an electronic device in Embodiment 3 of the present invention.
[0047] In the figure: 1. Optoelectronic imaging product to be tested; 2. Collimator; 3. Target; 4. First stage; 5. Second stage; 6. Controller.
[0048] The following specific implementation manner will be further described in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION
[0049] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.
[0050] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.
[0051] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0052] Embodiment 1
[0053] See also Figure 1 , Figure 1 It is a structural schematic diagram of an optical axis stability detection platform. Specifically, the optical axis stability detection platform includes an optoelectronic imaging product 1 to be tested, a parallel light tube 2 and a target 3 which are optically connected in sequence, wherein the target 3 is fixed on a first carrier 4, and the target 3 is moved by the first carrier 4. The optoelectronic imaging product 1 to be tested is fixed on a second carrier 5, and the height and angle of the optoelectronic imaging product 1 to be tested are adjusted by the second carrier 5 so that the optoelectronic imaging product 1 to be tested can aim at the target 3 through the parallel light tube 2. The optoelectronic imaging product 1 to be tested and the target 3 are both electrically connected to the controller 6.
[0054] It should be noted that the first stage 4 has the function of electrically controlling the moving target 3, and can adjust the relative position of the target 3 and the collimator 2 to simulate targets at different object distances. The object to be tested, that is, the photoelectric imaging product 1 to be tested, is fixed on the second stage 5 with a high-precision connection device, with extremely small clamping error, and is not limited to the use of Picatinny rails and the like. The object to be tested detects and images the target 3 through the collimator 2 and transmits the image to the controller 6, which can be a computer.
[0055] In the actual detection process, the current image is acquired after the target 3 at the first object distance is focused clearly, and then the target 3 is moved to the position of the second object distance to refocus and acquire the current image. The target 3 comparison area can be manually or automatically selected on the operating software interface of the two images, and finally the pixel offset of the target position in the two images is calculated.
[0056] See also Figure 2 , Figure 2 A flowchart of an implementation of a digital optical axis stability detection method provided in Embodiment 1 of the present invention is shown. In this embodiment, the digital optical axis stability detection method specifically includes steps S01 to S03.
[0057] Step S01, controlling the photoelectric imaging product to be tested to work, imaging the target at a specified object distance through the collimator, and recording a first image, wherein the first image includes an initial characteristic hole position area determined according to the target.
[0058] Step S02, after performing a preset evaluation operation on the optoelectronic imaging product to be tested, repeat the operation in step S01 to record a second image, wherein the second image includes a target characteristic hole position area corresponding to the initial characteristic hole position area.
[0059] It should be noted that there are five characteristic hole regions in both the first and second images, one of which is located in the middle area of the target, and the other four characteristic hole regions are circumferentially arranged in the middle area. Figure 3 , which is a schematic diagram of a target, wherein the shape of the target is a rectangle. In some other embodiments of the present invention, the shape of the target may also be a semicircle, a parallelogram, etc.
[0060] In this embodiment, the preset evaluation operations include repeated disassembly, impact or focusing of the optoelectronic imaging product to be tested.
[0061] Step S03, respectively determining the center coordinates of the initial characteristic hole position area in the first image and the target characteristic hole position area in the second image, and calculating the offset according to the center coordinates to detect the optical axis stability.
[0062] Specifically, a first detection area of the first image and a second detection area of the second image are obtained, and grayscale processing and binarization processing are performed on the first detection area and the second detection area in sequence to obtain corresponding first binarized images and second binarized images, respectively. In this embodiment, the detection area is determined according to the size information of the image. The detection area is centered on the center of the input image, and the width w is 1 / 3 of the width of the input image, and the height h is 1 / 3 of the height of the input image.
[0063] Contour extraction is performed on the first binarized image and the second binarized image respectively, and the area of each contour is determined. According to the preset area, contour screening is performed to obtain each target contour, wherein the contour extracted from the first binarized image is the initial characteristic hole position area, and the contour extracted from the second binarized image is the target characteristic hole position area. It should be noted that the contour with an area within the range of (15, 500) is set as the target contour;
[0064] Determine the minimum bounding rectangle of each target contour and obtain the center coordinates of the minimum bounding rectangle. Specifically, in step 1, obtain the coordinates of the upper left point on the target contour (x min ,y min ) and the coordinates of the lower right point (x max ,y max ), determine the circumscribed rectangle, and determine the area of the circumscribed rectangle;
[0065] Step 2: Rotate all point coordinates on the target contour by a preset angle, obtain the coordinates of the upper leftmost point and the lower rightmost point on the rotated target contour, determine the corresponding circumscribed rectangle, and calculate the area of the corresponding circumscribed rectangle, where the point position (x', y') after rotation is:
[0066] x'=x×cos(b)-y×sin(b)
[0067] y'=x×sin(b)+y×cos(b)
[0068] b is the preset angle;
[0069] Step 3, determining whether the area of the circumscribed rectangle determined by the rotated target contour is smaller than the area of the circumscribed rectangle determined by the target contour before rotation, if so, executing step 4;
[0070] Step 4, looping through steps 2 and 3 until the area of the bounding rectangle determined by the target contour after rotation is not less than the area of the bounding rectangle determined by the target contour before rotation, and defining the bounding rectangle determined by the target contour before rotation as the minimum bounding rectangle;
[0071] According to the center coordinates of the minimum bounding rectangle in the first binarized image and the center coordinates of the minimum bounding rectangle in the corresponding second binarized image, each center offset is calculated. The calculation formula of the center offset is:
[0072]
[0073] Among them, Δ i represents the center offset of the i-th characteristic hole area, x centerP1_i represents the horizontal coordinate of the center point of the i-th characteristic hole area in the first binary image, x centerP2_irepresents the horizontal coordinate of the center point of the i-th characteristic hole area in the second binary image, y centerP1_i represents the ordinate of the center point of the i-th characteristic hole area in the first binary image, y centerP2_i Indicates the vertical coordinate of the center point of the i-th characteristic hole position area in the second binary image. In this embodiment, all detected center coordinates are sorted from top to bottom and from left to right. The sorted point coordinates are the center coordinates of all detected characteristic hole position areas. At the same time, the sequence number, center point position, and detection frame are all displayed in the input image. Please refer to Figure 4 , is a schematic diagram of the software interface;
[0074] According to the offsets of each center, the average center offset is calculated;
[0075] According to the pixel size of the movement, the focal length of the lens and the average center offset, the angle offset is calculated. The calculation formula of the angle offset is:
[0076] Δ θ =0.06·tan -1 (Δ pix ·a / (f′·1000))
[0077] Among them, Δ θ represents the angular offset, Δ pix represents the average center offset, a represents the core pixel size, and f′ represents the focal length of the lens.
[0078] In other embodiments of the present invention, the step of respectively determining the center coordinates of the initial characteristic hole area in the first image and the target characteristic hole area in the second image, and calculating the offset according to the center coordinates to detect the optical axis stability includes:
[0079] According to the distribution of each characteristic hole area on the target, the corresponding target detection area is determined, wherein the part of each characteristic hole area close to the middle area is taken as the target detection area. Specifically, taking a characteristic hole area on the target as an example, the coordinate of the upper left point (x' min ,y' min ) and the coordinates of the lower right point (x' max ,y' max ), get the width rect_w and height rect_h of the minimum enclosing rectangle. The expressions of width rect_w and height rect_h are:
[0080] rect_w=x' max -x' min
[0081] rect_h=y' max -y' min
[0082] According to the order of the characteristic hole area, the positions of the other four characteristic hole areas are determined with the middle characteristic hole area as the center (two characteristic hole areas are located on the left, and the remaining two characteristic hole areas are located on the right). The target detection area of the characteristic hole area on the left and the center is (x' max ,y' max -rect_h / 2), the target detection area width is rect_w / 2, the target detection area height is rect_y / 2, and the target detection area of the characteristic hole area on the right is (x' min ,y' min +rect_h / 2) as the center, the target detection area width is rect_w / 2, and the target detection area height is rect_h / 2;
[0083] Convert the target detection area into a grayscale image, and perform edge detection on the grayscale image to obtain an edge image. In this embodiment, canny edge detection is used;
[0084] Perform Fourier transform on the edge image to obtain a frequency domain image;
[0085] Normalize the frequency domain graph to obtain the MTF curve;
[0086] According to the MTF curve and the preset amplitude, the corresponding frequency is determined as the MTF value of the corresponding characteristic hole area, wherein the preset amplitude is 0.5.
[0087] In summary, an embodiment of the present invention proposes a digital optical axis stability detection method, which comprises an optical axis stability detection platform composed of an optoelectronic imaging product to be tested, a collimator and a target, controls the operation of the optoelectronic imaging product to be tested, images the target at a specified object distance through the collimator, and records a first picture, wherein the first picture includes an initial characteristic hole position area determined according to the target; after performing a preset evaluation operation on the optoelectronic imaging product to be tested, the above operation is repeated to record a second picture, wherein the second picture includes a target characteristic hole position area corresponding to the initial characteristic hole position area; the center coordinates of the initial characteristic hole position area in the first picture and the target characteristic hole position area in the second picture are respectively determined, and the offset is calculated according to the center coordinates to detect the optical axis stability. The above method can greatly improve the detection efficiency and obtain accurate detection results.
[0088] Embodiment 2
[0089] See also Figure 5 , Figure 5It is a structural block diagram of a digital optical axis stability detection system provided in the second embodiment of the present invention. The digital optical axis stability detection system 200 is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation in hardware, or a combination of software and hardware, is also possible and conceivable.
[0090] Specifically, the digital optical axis stability detection system 200 includes: a first recording module 21, a second recording module 22 and a calculation module 23, wherein:
[0091] A first recording module 21 is used to control the operation of the photoelectric imaging product to be tested, image the target at a specified object distance through the collimator, and record a first picture, wherein the first picture includes an initial characteristic hole position area determined according to the target;
[0092] A second recording module 22 is used to repeat the operation in the first recording module after performing a preset evaluation operation on the optoelectronic imaging product to be tested, and record a second image, wherein the second image includes a target characteristic hole position area corresponding to the initial characteristic hole position area, and there are five characteristic hole position areas in both the first image and the second image, wherein one characteristic hole position area is located in the middle area of the target, and the other four characteristic hole position areas are circumferentially arranged in the middle area;
[0093] The calculation module 23 is used to respectively determine the center coordinates of the initial characteristic hole position area in the first image and the target characteristic hole position area in the second image, and calculate the offset according to the center coordinates to detect the optical axis stability.
[0094] Further, in some optional embodiments of the present invention, the calculation module 23 includes:
[0095] an acquisition unit, configured to acquire a first detection area of the first image and a second detection area of the second image, and perform grayscale processing and binarization processing on the first detection area and the second detection area in sequence to obtain corresponding first binarized images and second binarized images, respectively;
[0096] A contour extraction unit, used to perform contour extraction on the first binarized image and the second binarized image respectively, and determine the area of each contour, and perform contour screening according to a preset area to obtain each target contour, wherein the contour extracted from the first binarized image is the initial characteristic hole position area, and the contour extracted from the second binarized image is the target characteristic hole position area;
[0097] A determination unit, used to determine the minimum bounding rectangle of each target contour and obtain the center coordinates of the minimum bounding rectangle;
[0098] The first calculation unit is used to calculate each center offset according to the center coordinates of the minimum bounding rectangle in the first binarized image and the center coordinates of the minimum bounding rectangle in the corresponding second binarized image, and the calculation formula of the center offset is:
[0099]
[0100] Among them, Δ i represents the center offset of the i-th characteristic hole area, x centerP1_i represents the horizontal coordinate of the center point of the i-th characteristic hole area in the first binary image, x centerP2_i represents the horizontal coordinate of the center point of the i-th characteristic hole area in the second binary image, y centerP1_i represents the ordinate of the center point of the i-th characteristic hole region in the first binary image, y centerP2_i represents the ordinate of the center point of the i-th characteristic hole region in the second binarized image;
[0101] A second calculation unit, used for calculating an average center offset according to each of the center offsets;
[0102] The third calculation unit is used to calculate the angle offset according to the movement pixel size, the lens focal length and the center average offset. The calculation formula of the angle offset is:
[0103] Δ θ =0.06·tan -1 (Δ pix ·a / (f′·1000))
[0104] Among them, Δ θ represents the angular offset, Δ pix represents the average center offset, a represents the core pixel size, and f′ represents the focal length of the lens.
[0105] Further, in some optional embodiments of the present invention, the determining unit includes:
[0106] A first acquisition subunit is used to acquire the coordinates of the upper leftmost point and the lower rightmost point on the target contour, determine a circumscribed rectangle, and determine the area of the circumscribed rectangle;
[0107] A rotation subunit, used to rotate all point coordinates on the target contour by a preset angle, obtain the coordinates of the upper left point and the lower right point on the rotated target contour, determine the corresponding circumscribed rectangle, and calculate the area of the corresponding circumscribed rectangle;
[0108] A judging subunit, used to judge whether the area of the circumscribed rectangle determined by the rotated target contour is smaller than the area of the circumscribed rectangle determined by the target contour before the rotation;
[0109] The loop subunit is used to loop the rotation subunit and the judgment subunit when it is judged that the area of the circumscribed rectangle determined by the target contour after rotation is smaller than the area of the circumscribed rectangle determined by the target contour before rotation, until the area of the circumscribed rectangle determined by the target contour after rotation is not smaller than the area of the circumscribed rectangle determined by the target contour before rotation, and the circumscribed rectangle determined by the target contour before rotation is defined as the minimum circumscribed rectangle.
[0110] Furthermore, in some optional embodiments of the present invention, the digital optical axis stability detection system 200 further includes:
[0111] A target detection region determination module is used to determine the corresponding target detection region according to the distribution of each characteristic hole position region on the target, wherein a portion of each characteristic hole position region close to the middle region is taken as the target detection region;
[0112] A conversion module, used for converting the target detection area into a grayscale image, and performing edge detection on the grayscale image to obtain an edge image;
[0113] A Fourier transform module, used for performing Fourier transform on the edge image to obtain a frequency domain image;
[0114] A normalization processing module, used for normalizing the frequency domain graph to obtain an MTF curve;
[0115] The frequency determination module is used to determine the corresponding frequency according to the MTF curve and the preset amplitude to serve as the MTF value of the corresponding characteristic hole position area.
[0116] Embodiment 3
[0117] Another aspect of the present invention provides an electronic device, see Figure 6 , shown is an electronic device in Embodiment 3 of the present invention, including a memory 20, a processor 10, and a computer program 30 stored in the memory and executable on the processor, wherein the processor 10 implements the above-mentioned digital optical axis stability detection method when executing the computer program 30.
[0118] In some embodiments, the processor 10 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor or other data processing chip, used to run program codes or process data stored in the memory 20, such as executing access restriction programs.
[0119] Among them, the memory 20 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. The memory 20 may be an internal storage unit of an electronic device in some embodiments, such as a hard disk of the electronic device. The memory 20 may also be an external storage device of an electronic device in other embodiments, such as a plug-in hard disk equipped on the electronic device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. Further, the memory 20 may also include both an internal storage unit of the electronic device and an external storage device. The memory 20 may be used not only to store application software and various types of data of the electronic device, but also to temporarily store data that has been output or is to be output.
[0120] It should be pointed out that Figure 6 The structure shown does not constitute a limitation on the electronic device. In other embodiments, the electronic device may include fewer or more components than those shown in the figure, or combine certain components, or arrange the components differently.
[0121] The embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the digital optical axis stability detection method as described above is implemented.
[0122] Those skilled in the art will appreciate that the logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For purposes of this specification, a "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0123] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0124] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0125] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0126] The above embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention patent shall be subject to the attached claims.
Claims
1. A digital optical axis stability detection method, characterized in that: The method is applied to a scene with an optical axis stability detection platform, wherein the optical axis stability detection platform comprises an optoelectronic imaging product to be tested, a collimator and a target which are optically connected in sequence, wherein the target is fixed on a first stage, the target is moved by the first stage, the optoelectronic imaging product to be tested is fixed on a second stage, the height and angle of the optoelectronic imaging product to be tested are adjusted by the second stage so that the optoelectronic imaging product to be tested can aim at the target through the collimator, the optoelectronic imaging product to be tested and the target are both electrically connected to a controller, and the method comprises: Step 1.1, controlling the photoelectric imaging product to be tested to work, imaging the target at a specified object distance through the collimator, and recording a first image, wherein the first image includes an initial characteristic hole position area determined according to the target; Step 1.2, after performing a preset evaluation operation on the optoelectronic imaging product to be tested, repeat the operation in step 1.1 to record a second image, wherein the second image includes a target characteristic hole position area corresponding to the initial characteristic hole position area; Step 1.3, respectively determine the center coordinates of the initial characteristic hole position area in the first image and the target characteristic hole position area in the second image, and calculate the offset according to the center coordinates to detect the optical axis stability.
2. The digital optical axis stability detection method according to claim 1, characterized in that: There are five characteristic hole regions in both the first image and the second image, wherein one characteristic hole region is located in the middle region of the target, and the other four characteristic hole regions are circumferentially arranged in the middle region.
3. The digital optical axis stability detection method according to claim 2, characterized in that: The step of respectively determining the center coordinates of the initial characteristic hole position area in the first image and the target characteristic hole position area in the second image, and calculating the offset according to the center coordinates comprises: Acquire a first detection area of the first image and a second detection area of the second image, and perform grayscale processing and binarization processing on the first detection area and the second detection area in sequence to obtain corresponding first binarized images and second binarized images, respectively; Performing contour extraction on the first binarized image and the second binarized image respectively, and determining the area of each contour, and performing contour screening according to a preset area to obtain each target contour, wherein the contour extracted from the first binarized image is the initial characteristic hole position area, and the contour extracted from the second binarized image is the target characteristic hole position area; Determine the minimum bounding rectangle of each target contour, and obtain the center coordinates of the minimum bounding rectangle; Calculating each center offset according to the center coordinates of the minimum bounding rectangle in the first binarized image and the center coordinates of the minimum bounding rectangle in the corresponding second binarized image; Calculating the average center offset according to each of the center offsets; The angle offset is calculated according to the pixel size of the movement, the focal length of the lens and the average center offset.
4. The digital optical axis stability detection method according to claim 3, characterized in that: The step of determining the minimum circumscribed rectangle of each target contour comprises: Step 2.1, obtaining the coordinates of the upper left point and the lower right point on the target contour, determining a circumscribed rectangle, and determining the area of the circumscribed rectangle; Step 2.2, rotating all point coordinates on the target contour by a preset angle, obtaining the coordinates of the upper leftmost point and the lower rightmost point on the rotated target contour, determining the corresponding circumscribed rectangle, and calculating the area of the corresponding circumscribed rectangle; Step 2.3, determine whether the area of the circumscribed rectangle determined by the rotated target contour is smaller than the area of the circumscribed rectangle determined by the target contour before rotation, if so, execute step 2.4; Step 2.4, then loop through steps 2.2 and 2.3 until the area of the bounding rectangle determined by the target contour after rotation is not less than the area of the bounding rectangle determined by the target contour before rotation, and define the bounding rectangle determined by the target contour before rotation as the minimum bounding rectangle.
5. The digital optical axis stability detection method according to claim 4, characterized in that: In the step of calculating each center offset according to the center coordinates of the minimum bounding rectangle in the first binarized image and the center coordinates of the minimum bounding rectangle in the corresponding second binarized image, the calculation formula of the center offset is: Among them, Δ i represents the center offset of the i-th characteristic hole area, x centerP1_i represents the horizontal coordinate of the center point of the i-th characteristic hole area in the first binary image, x centerP2_i represents the horizontal coordinate of the center point of the i-th characteristic hole area in the second binary image, y centerP1_i represents the ordinate of the center point of the i-th characteristic hole region in the first binary image, y centerP2_i Represents the ordinate of the center point of the i-th characteristic hole area in the second binarized image.
6. The digital optical axis stability detection method according to claim 5, characterized in that: In the step of calculating the angle offset according to the movement pixel size, the lens focal length and the center average offset, the calculation formula of the angle offset is: D θ =0.06·tan -1 (D pix ·a / (f′·1000)) Among them, Δ θ represents the angular offset, Δ pix represents the average center offset, a represents the core pixel size, and f′ represents the focal length of the lens.
7. The digital optical axis stability detection method according to claim 6, characterized in that: The step of respectively determining the center coordinates of the initial characteristic hole position area in the first image and the target characteristic hole position area in the second image, and calculating the offset according to the center coordinates to detect the optical axis stability comprises: According to the distribution of each characteristic hole position area on the target, the corresponding target detection area is determined, wherein a part of each characteristic hole position area close to the middle area is taken as the target detection area; Converting the target detection area into a grayscale image, and performing edge detection on the grayscale image to obtain an edge image; Performing Fourier transformation on the edge image to obtain a frequency domain image; Normalizing the frequency domain graph to obtain an MTF curve; According to the MTF curve and the preset amplitude, the corresponding frequency is determined as the MTF value of the corresponding characteristic hole position area.
8. A digital optical axis stability detection system, characterized in that: For implementing the digital optical axis stability detection method according to any one of claims 1 to 7, the system comprises: A first recording module, used to control the operation of the photoelectric imaging product to be tested, to image the target at a specified object distance through the collimator, and to record a first picture, wherein the first picture includes an initial characteristic hole position area determined according to the target; A second recording module, configured to perform a preset evaluation operation on the optoelectronic imaging product to be tested, and then repeat the operation in the first recording module to record a second image, wherein the second image includes a target characteristic hole position area corresponding to the initial characteristic hole position area; The calculation module is used to respectively determine the center coordinates of the initial characteristic hole position area in the first image and the target characteristic hole position area in the second image, and calculate the offset according to the center coordinates to detect the optical axis stability.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the digital optical axis stability detection method as described in any one of claims 1 to 7 is implemented.
10. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and running on the processor, wherein when the processor executes the program, the digital optical axis stability detection method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
A system and method for three-dimensional laser scanning with optical position sensing
WO2024220842A2