Device and method for acquiring actual focusing plane of Sammer optical system

By designing the actual focus plane acquisition device of the Sham optical system, the adjustment of the slider and laser, combined with the image processing algorithm, the problem of the inability to accurately determine the focus plane under the unknown fixed focus lens is solved, and the acquisition of the position of the focus plane is achieved more accurate and closer to the real focus plane.

CN120065606APending Publication Date: 2025-05-30GUILIN UNIV OF ELECTRONIC TECH +2
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510169151.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-17
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

The prior art cannot accurately determine the actual position of the focus plane in the case of unknown lens plane position and object focal length of the fixed focus lens, resulting in the inability to find the most realistic and accurate focus plane.

Method used

A device for the actual focus plane acquisition of the Sham optical system is designed, including a fixed aluminum plate, a moving fixed plate, a laser, a reducer motor and a camera. Through the adjustment of the slider and laser, the number of light bar pixels is analyzed in combination with an image processing algorithm to determine the position of the focus plane.

Benefits of technology

In the case of unknown fixed-focus lenses, we can objectively find the better, more accurate and closer to the real focus plane position through quantitative analysis, avoiding the limitations of traditional manual adjustment and subjective judgment of the human eye.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120065606A_ABST
    Figure CN120065606A_ABST
Patent Text Reader

Abstract

The invention, which relates to the technical field of visual imaging, discloses a device and a method for obtaining an actual focusing plane of a Sammer optical system, comprising: a fixed aluminum plate, the side surface of which is provided with a linear slide rail; the movable fixing plate slides on the sliding rail through a sliding block and is driven by a telescopic electric cylinder to do linear reciprocating motion along the sliding rail; the laser is rotationally connected to the movable fixing plate through a laser fixing seat and is used for obtaining a focusing plane by emitting laser; the gear motor is fixedly connected to one side, away from the laser, of the movable fixing plate, is in transmission connection with the laser fixing seat and is used for controlling the laser to rotate; the camera is fixedly connected to the side face of the fixed aluminum plate, a lens is obliquely arranged, the lens and the camera form a Sammer optical system, and an image is captured through a prime lens. According to the device and the method, the real focusing plane position can be found under the condition that the lens plane position and the object space focal length of the prime lens are unknown, and the focusing plane position closer to the reality can be accurately obtained through quantitative analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of visual imaging, and particularly relates to a device and method for obtaining the actual focal plane of a Scheimpflug optical system. Background Art

[0002] The inside of a fixed-focus lens consists of many groups of lenses. However, for the sake of a simple expression of the imaging model, these lenses are equivalent to a group of lenses. The equivalent parameters should include the object and image space focal lengths and the position of the optical center. As Figure 1 shown, with these three parameters, the object-image relationship can be obtained. An industrial camera collects the light passing through the lens via a photosensitive chip, and this photosensitive chip is called the target plane, as Figure 2 shown.

[0003] The Scheimpflug's law was discovered by an Austrian officer Scheimpflug and is a method for increasing the presented depth of field H. When the subject plane, the lens plane (the plane extended by the center point of the lens perpendicular to the optical axis), and the imaging plane (the target plane of the camera) intersect at a line (Scheimpflug line), all the scenes on the subject plane will be presented in a clear state, but there are countless such subject planes.

[0004] The Hinge's law can be regarded as an application of the classical thin lens Gaussian formula under the Scheimpflug's law configuration. The PTF (parallel to film) plane refers to an imaginary plane passing through the object space focal plane of the lens and parallel to the imaging plane. The Hinge's law states that the PTF plane, the focal plane, and the front focal plane of the lens should intersect at the same straight line, i.e., the Hinge line. Combining the Scheimpflug's law and the Hinge's law, the positions of the A and B axes can be determined respectively, that is, the optimal and unique focal plane is determined, as Figure 3 shown.

[0005] The Chinese invention patent with the publication number CN113189603A proposes a method and system for designing the parameters of a structured light depth camera, which can be used to determine the theoretical position of the focal plane. However, all of this is based on the known lens plane (the position of the lens optical center) and the object space focal length f2 of the fixed-focus lens. Usually, the manufacturer of the lens does not provide these two parameters, namely the lens plane and the object space focal length. Therefore, in this case, the actual position of the focal plane cannot be determined by the above method and system.

[0006] Since there is currently no similar device and method to obtain an accurate and actual focal plane, and the prior art only manually adjusts the position of the object to be measured and judges whether it is in focus by the human eye identifying the clarity of the object, it is impossible to find the most real and accurate focal plane. Therefore, it is necessary to propose a device and method for obtaining the actual focal plane of a Scheimpflug optical system to find the actual position of the focal plane. Summary of the Invention

[0007] The object of the present invention is to provide a device and method for obtaining the actual focal plane of a Sham optical system, which is used to find the real focal plane when the lens plane position (optical center position) and object focal length of a fixed-focus lens are unknown.

[0008] To achieve the above object, on the one hand, the present invention provides a device for obtaining an actual focal plane of a Sham optical system, comprising:

[0009] A fixed aluminum plate is used as a basic support body, and a linear slide rail is arranged on its side;

[0010] The movable fixed plate slides on the slide rail through the slider, and is driven by the telescopic electric cylinder to move linearly back and forth along the slide rail;

[0011] A laser, rotatably connected to the movable fixed plate via a laser fixing seat, and used to obtain a focal plane by emitting laser;

[0012] A reduction motor, fixedly connected to a side of the movable fixed plate away from the laser, and drivingly connected to the laser fixing seat, for controlling the rotation of the laser;

[0013] The camera is fixed on the side of the fixed aluminum plate and captures images through a fixed-focus lens.

[0014] The above structure aims to propose a device for acquiring the actual focusing plane of the Sham optical system, whose working principle is to adjust the position of the laser plane by moving the slider and rotating the laser, and to capture the image through the camera, and to analyze the number of light bar pixels in the image through the image processing algorithm, so as to determine the position of the focusing plane.

[0015] Optionally, the device further comprises an incremental encoder, which is axially connected to the rear side of the laser fixing seat and is used to measure the rotation angle of the laser fixing seat.

[0016] Optionally, the device also includes a linear encoder and a linear encoder pull head, wherein the linear encoder is fixedly mounted on the movable fixed plate, the linear encoder is connected to the linear encoder pull head along the direction of the slide rail, and the linear encoder pull head is hinged on the fixed aluminum plate; as the movable fixed plate moves, the linear encoder pull head can extend from or retract from the linear encoder.

[0017] Optionally, a slewing bearing is fixed on the movable fixed plate, the outer ring of the slewing bearing is fixedly connected to the movable fixed plate, the inner ring of the slewing bearing is fixedly connected to a driven large gear, the laser fixing seat is fixedly connected to the center of the outer end surface of the driven large gear, the output shaft of the reduction motor is fixedly connected to a driving pinion, and the driving pinion is meshed with the driven large gear.

[0018] Optionally, the reduction ratio formed by the driving pinion and the driven large gear is 1:3.

[0019] Optionally, a camera target surface for photosensitivity is provided inside the camera. The fixed-focus lens is connected to the camera through a lens connection base, and the lens connection base arranges the camera target surface and the fixed-focus lens at a preset angle.

[0020] Optionally, the telescopic electric cylinder is fixedly installed on the side of the fixed aluminum plate, and its output end is connected to the moving fixing plate through a connecting column.

[0021] Optionally, a limit block for positioning the initial position is provided at the end of the slide rail.

[0022] On the other hand, the present invention provides a method for obtaining the actual focal plane of a Scheimpflug optical system, using the device for obtaining the actual focal plane of a Scheimpflug optical system described in any one of the above. This method includes the following steps:

[0023] S1. Fix the positions of the camera and the fixed-focus lens, establish a coordinate system at the lower left corner of the fixed-focus lens, determine the model of the fixed-focus lens, obtain a unique focal plane, and set the initial angle α = α 0 ;

[0024] S2. The slider linearly moves from point D1 to point D2, and an image is collected every small distance ds. The number of light strip pixels of each image is obtained through an image processing algorithm. Select the i-th image with the least number of light strip pixels, denoted as N min , at this time, L2 coincides with L0, and record the distance L1 = X OA + i * ds of the slider from the origin when taking the i-th image. This position is point D3;

[0025] S3. The slider returns from point D2 to point D3, removes the object block, makes the laser irradiate on the stage surface, collects an image, and obtains the number of light strip pixels of the image through an image processing algorithm, denoted as N. Obtain the total number of light strip pixels N 1 = N + N min ;

[0026] S4. Change the included angle α of the laser to α = α 0 + n * da. Initially, n = 1 and da = 1°;

[0027] S5. Repeat steps S2 - S4. Each time it is repeated, n is incremented by 1. The total pixel numbers obtained each time are N 1 , N 2 , N 3 , N 4 ……, and the updated distance L each time is L 1 , L2 、L 3 、L 4 ……, α is α 1 、α 2 、α 3 、α 4 ……;

[0028] S6. Find the N with the smallest number of pixels s , the corresponding distance L is L s , the corresponding angle α is α S , at this time, L2 coincides with L0, L3 coincides with L1, and at this time the focal plane is the optical plane of the laser, and thus the position of the focal plane is determined.

[0029] Furthermore, the image processing algorithm includes the following steps:

[0030] S31. Convert a certain picture into a grayscale image through the linear weighted average method, where the formula one is:

[0031] I (u,v) = 0.299 * R (u,v) + 0.587 * G (u,v + 0.114 * B (u,v)

[0032] In the formula, R represents the value of the red channel corresponding to the pixel in the u-th row and v-th column, G represents the value of the green channel corresponding to the pixel in the u-th row and v-th column, and B represents the value of the blue channel corresponding to the pixel in the u-th row and v-th column;

[0033] S32. Traverse the first column of the image, and determine the center point P of the light strip in the first column according to formula two and formula three 1 , where the formula two is:

[0034]

[0035] The formula three is:

[0036] P 1 = (P1 u , 1);

[0037] S33. Traverse the last column of the image, and determine the center point P of the light strip in the last column according to formula four and formula five 2 , where the formula four is:

[0038]

[0039] The formula five is:

[0040] P 2 = (P 2 , V):

[0041] S34. Determine the search direction S 0 , S 0 Determined according to Formula 6, and Formula 6 is:

[0042]

[0043] S35. Determine the search. According to the characteristics of the light bar feature that it is wide in the middle and narrow at both ends, the number of light bar pixels in the middle column of the image must be greater than that of the rest. Traverse the middle column of the image, set a threshold, and count the number of pixels greater than the threshold to obtain the number of pixels on the light bar of this column, denoted as N max ;

[0044] S36. Along the search direction S 0 , offset N / 2 up and down respectively max to set the parallelogram RIO area. The length of the RIO area is the length of the image, that is, V columns, and the height of the RIO area is the width of N pixels max pixels wide;

[0045] S37. Traverse the pixels in the RIO area, and according to the threshold set in step S35, count the number of pixels greater than the threshold to obtain the number of pixels belonging to the light bar.

[0046] Compared with the prior art, the present invention discloses at least the following beneficial effects:

[0047] The present invention provides a device and method for obtaining the actual focal plane of a Scheimpflug optical system. Without knowing the lens plane position (optical center position) and the object-side focal length f of a fixed-focus lens, the device and method are used to find the true focal plane position. Different from the traditional method of manually adjusting the position of the object to be measured and subjectively distinguishing whether it is in focus by the human eye, the device and method of the present invention can objectively obtain a better, more accurate, and closer-to-real focal plane position through quantitative analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0049] Figure 1 Schematic diagram of the fixed-focus lens and key optical point positions;

[0050] Figure 2 Schematic diagram of the structure of the Scheimpflug optical system;

[0051] Figure 3Imaging models for the Scheimpflug's law and the hinge law;

[0052] Figure 4 Schematic structural diagram of the device according to the embodiment of the present invention;

[0053] Figure 5 Partial cross-sectional view of the device according to the embodiment of the present invention from a top-down perspective;

[0054] Figure 6 Schematic principle diagram of the device according to the embodiment of the present invention;

[0055] Figure 7 Schematic diagram of the laser and the laser plane emitted by it in the device according to the embodiment of the present invention;

[0056] Figure 8 Light stripe diagram of the device according to the embodiment of the present invention in an out-of-focus state;

[0057] Figure 9 Light stripe diagram of the device according to the embodiment of the present invention in a focused state;

[0058] Figure 10 Light stripe diagram of the device according to the embodiment of the present invention in a semi-focused state;

[0059] Figure 11 Process of using the device according to the embodiment of the present invention to find the most accurate focusing plane Figure 1 ;

[0060] Figure 12 Process of using the device according to the embodiment of the present invention to find the most accurate focusing plane Figure 2 ;

[0061] Figure 13 Light stripe diagram after grayscale conversion and setting the RIO area;

[0062] Figure 14 Flowchart of the method according to the embodiment of the present invention;

[0063] Figure 15 Flowchart of the operation of the image processing algorithm in the method according to the embodiment of the present invention.

[0064] In the figure: 1. Fixed aluminum plate; 2. Linear encoder pull head; 3. Pull head fixed flange; 4. Telescopic electric cylinder; 5. Limit block; 6. Linear encoder; 7. Slide block; 8. Slewing bearing; 9. Reduction motor; 10. Slide rail; 11. Driving pinion; 12. Driven gear; 13. Laser fixing seat; 14. Laser; 15. Moving fixing plate; 16. Fixed-focus lens; 17. Lens connecting seat; 18. Camera target surface; 19. Camera; 20. Connecting column; 21. Incremental encoder; 22. Encoder connecting shaft; 23. Block; 24. Carriage; 25. Focus plane; 26. Light plane; 100. Fixed-focus lens one; 101. Object-side focus; 102. Optical center; 103. Image-side focus; 200. Connecting seat one; 300. Camera target surface one; 400. Camera one; 500. Laser one; 501. Optimal shooting main plane; 502. Target surface; 503. Lens plane; 504. Object-side focal plane; 505. PTF plane. Detailed implementation manners

[0065] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0066] Referring to Figures 1 to 3 as shown, Figure 2 shows a partial structure of a traditional industrial camera of a structure, including camera one 400, camera target surface one 300, connecting seat one 200 and fixed-focus lens one 100. The photosensitive chip of the traditional industrial camera collects the light passing through the fixed-focus lens one 100, and this photosensitive chip is called the target surface, that is, Figure 2 the camera target surface one 300 in it. The fixed-focus lens one 100 is composed of many groups of lenses inside. For the sake of simple expression of the imaging model, these lenses are equivalent to a group of lenses. The equivalent parameters include the object-side focus 101, the optical center 102 and the image-side focus 103, and the positions of the three are as Figure 1 shown.

[0067] The hinge law can be regarded as an application of the classical thin lens Gaussian formula under the Scheimpflug configuration. The PTF (parallel to film) plane refers to an imaginary plane passing through the object-side focal plane of the lens and parallel to the imaging plane. The hinge law states that the PTF plane, the focus plane and the front focal plane of the lens should intersect at the same straight line, that is, the Hinge line. As Figure 3 shown, combining the Scheimpflug law and the hinge law, the positions of the A and B axes can be determined respectively, that is, the optimal and unique focus plane is determined. In Figure 3Among them, 500 is Laser 1, 501 represents the optimal shooting main plane, 502 represents the target plane; 503 represents the lens plane, 504 represents the object focal plane, and 505 represents the PTF plane.

[0068] From the above structure and schematic diagram, it can be seen that currently, to find the most real and accurate focusing plane, it is necessary to manually adjust the position of the object to be measured and rely on the human eye to identify the clarity of the object to determine the focus. Therefore, it is necessary to propose a technical means to obtain the real position of the focusing plane through a device and method when the key parameters of the Scheimpflug optical system are unknown.

[0069] To make the above objects, features, and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0070] Refer to Figures 4 to 13 As shown in the figure, an embodiment of the present invention provides a device for obtaining the actual focusing plane of a Scheimpflug optical system, including: a fixed aluminum plate 1, a linear encoder pull head 2, a pull head fixed flange 3, a telescopic electric cylinder 4, a limit block 5, a linear encoder 6, a slider 7, a slewing bearing 8, a reduction motor 9, a slide rail 10, a driving pinion 11, a driven gear 12, a laser fixed seat 13, a laser 14, a moving fixing plate 15, a fixed-focus lens 16, a lens connecting seat 17, a camera target surface 18, a camera 19, a connecting column 20, an incremental encoder 21, and an encoder connecting shaft 22.

[0071] As Figure 4As shown in the figure, the fixed-focus lens 16 is connected to the lens mount 17 by threads. The lens mount 17 arranges the camera target surface 18 and the fixed-focus lens 16 at an angle θ. The lens mount 17 is fixed to the fixed aluminum plate 1 by screws. The camera target surface 18 is located inside the camera 19, and the camera 19 is fixed to the fixed aluminum plate 1. The two slide rails 10 are parallel to each other and fixed to the fixed aluminum plate 1 by screws. The two limit blocks 5 are fixed to the fixed aluminum plate 1 to limit the initial position of the moving fixing plate 15. The pull head fixing flange 3 is connected to the fixed aluminum plate 1 by screws. The fixed part of the telescopic electric cylinder 4 is connected to the fixed aluminum plate 1 by a pin. The two sliders 7 can slide on the slide rails 10. The moving fixing plate 15 is fixed to the two sliders 7 by screws. The outer ring of the slewing bearing 8 is fixed to the moving fixing plate 15. The driven large gear 12 is fixed to the inner ring of the slewing bearing 8. The laser fixing seat 13 is fixed to the driven large gear 12. The laser 14 is fixed to the laser fixing seat 13 by clamping. The reduction motor 9 is fixed to the moving fixing plate 15. The driving small gear 11 is fixed to the shaft end of the reduction motor 9. The driving small gear 11 meshes with the driven large gear 12. The reduction motor 9 drives the driving small gear 11 to rotate, thereby realizing the rotation of the driven large gear 12, and further driving the entire laser 14 to rotate. The reduction ratio formed by the driving small gear 11 and the driven large gear 12 is 1:3, so higher rotation control accuracy can be obtained. The telescopic part of the telescopic electric cylinder 4 is hinged to the moving fixing plate 15 through the connecting column 20, thereby driving the moving fixing plate 15 to move left and right. The linear encoder 6 is fixed to the moving fixing plate 15. The linear encoder pull head 2 is hinged to the pull head fixing flange 3. As the moving fixing plate 15 moves, the linear encoder pull head 2 can extend or retract from the linear encoder 6. According to the length of the extended or retracted linear encoder pull head 2, the actual moving distance of the moving fixing plate 15 can be obtained.

[0072] As Figure 5 shown, the incremental encoder 21 is fixed to the moving fixing plate 15. The large end of the encoder connecting shaft 22 is fixed to the laser fixing seat 13. The small end of the encoder connecting shaft 22 is embedded in the incremental encoder 21. When the laser fixing seat 13 rotates, it will drive the encoder connecting shaft 22 to rotate. At this time, the incremental encoder 21 can detect the true rotation angle of the encoder connecting shaft 22.

[0073] The working principle of the device in the embodiment of the present invention is as Figure 6 shown. In the figure, the focal plane 25 is the focal plane to be searched. The slewing bearing 8 and the laser fixing seat 13 together form a rotating pair, and the slider 7 and the slide rail 10 together form a sliding pair. Since the focal plane 25 is virtual and invisible, a visible laser plane is considered to find this plane. The laser 14 and the light plane emitted by it are as Figure 7 shown.

[0074] The origin coordinate system is established at the lower left corner of the lens. After the positions of the fixed-focus lens 16 and the camera 19 are fixed and the included angle θ between the two is also fixed, a definite focusing plane 25 can be formed. The slider 7 can slide on the slide rail 10. The laser fixing base 13 is fixed on the slider 7, and the laser 14 is fixed on the laser fixing base 13 and can rotate relative to the moving fixing plate 15. The object block 23 is placed on the stage 24, and the line laser emitted by the laser 14 can irradiate on the object block 23. When the object block 23 is removed, the laser 14 can irradiate on the stage 24. When the optical plane 26 is intercepted by the object block 23 at L2, the imaging of L2 on the camera target surface 18 is as Figure 8 shown. The white divergent light strip is L2, and the characteristic of this light strip is divergent and wide, that is, the proportion of white pixel points is relatively large. The reason for this characteristic of the light strip is that L2 is not on the focusing plane 25 and is out of focus at this time.

[0075] Move the slider 7 to the right, thereby driving the laser 14 to move to the right, and L2 can be made to coincide with L0. At this time, the imaging of L2 on the camera target surface 18 is as Figure 9 shown. The obtained light strip is concentrated and narrow, and the proportion of white pixel points is relatively small. The reason for this characteristic of the light strip is that L2 is on the focusing plane 25 and is in focus at this time.

[0076] As Figure 10 shown, the light strip image in the semi-in-focus state shows a gradually narrowing trend. During the process of L2 approaching L0, the light strip gradually narrows, and when L2 coincides with L0, the light strip is the narrowest.

[0077] According to the change characteristics of the number of pixels of the light strip in different focusing situations described above, the focusing state can be judged by the number of pixels of the light strip. Therefore, the most accurate focusing plane 25 can be found through the device of this embodiment. Place the object block 23 and let the line laser of the laser 14 irradiate on the object block 23. When L2 coincides with L0, the number of pixels of the light strip is the least, and vice versa; remove the object block 23 and let the line laser of the laser 14 irradiate on the stage 24. When L3 coincides with L1, the number of pixels of the light strip is the least, and vice versa; when and only when L2 coincides with L0 and L3 coincides with L1 at the same time, the sum of the number of pixels of the light strips in the two pictures is the least. At this time, the optical plane 26 coincides with the focusing plane 25, that is, the position of the optical plane 26 is the position of the focusing plane 25, and vice versa. Based on this, the actual focusing plane acquisition device of the Scheimpflug optical system with the above structure can adjust the plane position through the combination of the sliding pair and the rotating pair and obtain the true translation distance and rotation angle.

[0078] Refer to Figure 14 and Figure 15As shown in the figure, an embodiment of the present invention provides a method for obtaining the actual focal plane of a Scheimpflug optical system. Using the device for obtaining the actual focal plane of the Scheimpflug optical system described in the above embodiment, the method includes the following steps:

[0079] S1. Fix the positions of the camera and the fixed-focus lens. Establish a coordinate system at the lower left corner of the fixed-focus lens, determine the model of the fixed-focus lens. At this time, a unique focal plane can be obtained, and set the initial angle α = α 0 ;

[0080] S2. The slider moves from point D1 to point D2. Take an image every small distance ds. Obtain the number of light bar pixels in each image through an image processing algorithm. It is found that the number of light bar pixels in the i-th image is the least, denoted as N min , at this time L2 coincides with L0, and record the distance L1 = X of the slider from the origin when taking the i-th image OA +i*ds, and this position is point D3;

[0081] S3. The slider returns from point D2 to point D3, remove the object block. At this time, the laser irradiates on the stage surface, take an image, and obtain the number of light bar pixels in the image through an image processing algorithm, denoted as N, and obtain the total number of light bar pixels N in the two images 1 =N+N min ;

[0082] S4. Change the included angle α of the laser to α 0 +n*da, initially n = 1, da = 1°;

[0083] S5. Repeat steps S2 - S4, add 1 to n each time it is repeated. The total number of pixels obtained each time is N 1 , N 2 , N 3 , N 4 ……, the updated distance L each time is L 1 , L 2 , L 3 , L 4 ……, α is α 1 , α 2 , α 3 , α 4 ……;

[0084] S6. Find the N with the smallest number of pixels s , the corresponding distance L is L s , the corresponding angle α is α S , at this time L2 coincides with L0, L3 coincides with L1, and at this time the focal plane is the light plane of the laser, and thus the position of the focal plane is determined.

[0085] Further optimization solution, the image processing algorithm is an algorithm for quickly counting the number of light strip pixels in an image according to the characteristics of the light strip. The image processing algorithm includes the following steps:

[0086] S31. Convert a certain picture into a grayscale image through the linear weighted average method using Formula 1, where Formula 1 is:

[0087] I (u,v) = 0.299 * R (u,v) + 0.587 * G (u,v) + 0.114 * B (u,v)

[0088] In the formula, R represents the value of the red channel corresponding to the pixel at the u-th row and v-th column, G represents the value of the green channel corresponding to the pixel at the u-th row and v-th column, B represents the value of the blue channel corresponding to the pixel at the u-th row and v-th column, and u and v respectively represent that the picture has u rows and v columns of pixels;

[0089] S32. Traverse the first column of the image, and determine the center point P of the light strip in the first column according to Formula 2 and Formula 3 1 , where Formula 2 is:

[0090]

[0091] Formula 3 is:

[0092] P 1 = (P1 u , 1);

[0093] S33. Traverse the last column of the image, and determine the center point P of the light strip in the last column according to Formula 4 and Formula 5 2 , where Formula 4 is:

[0094]

[0095] Formula 5 is:

[0096] P 2 = (P2 u , V);

[0097] S34. Determine the search direction S 0 , S 0 is determined according to Formula 6, and Formula 6 is:

[0098]

[0099] S35. Determine that according to the characteristics of the light strip feature, which is wider in the middle and narrower at both ends, the number of light strip pixels in the middle column of the image must be greater than that of the rest. Traverse the middle column of the image, set a threshold, and count the number of pixels greater than the threshold to obtain the number of pixels on the light strip of this column, denoted as N. max ;

[0100] S36. Along the search direction S 0 , offset N max / 2 up and down to set the parallelogram RIO area. The length of the RIO area is the length of the image, that is, V columns, and the height of the RIO area is N max pixel widths;

[0101] The light strip after grayscale conversion and setting the RIO area is as Figure 13 shown. The white highlighted border is the set RIO area;

[0102] S37. Traverse the pixels in the RIO area, and according to the threshold set in step S35, count the number of pixels greater than the threshold to obtain the number of pixels belonging to the light strip.

[0103] The method of the present invention does not need to traverse all the pixels of the entire image. Only by traversing the pixels in the first column, the middle column, the last column of the image and the RIO area can the number of pixels of the light strip be counted, which greatly improves the running speed.

[0104] The details not described in the present invention are all conventional technical means well known to those skilled in the art.

[0105] In the description of the present invention, it should be understood that the orientation or positional relationship indicated by the terms "longitudinal", "transverse", "up", "down", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present invention, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation to the present invention.

[0106] The above-described embodiments are only used to describe the preferred embodiments of the present invention, and do not limit the scope of the present invention. Without departing from the design spirit of the present invention, various deformations and improvements made by those of ordinary skill in the art to the technical solutions of the present invention should fall within the protection scope determined by the claims of the present invention.

Claims

1. A device for obtaining the actual focal plane of a Sham optical system, characterized in that: include: A fixed aluminum plate is used as a basic support body, and a linear slide rail is arranged on its side; The movable fixed plate slides on the slide rail through the slider, and is driven by the telescopic electric cylinder to move linearly back and forth along the slide rail; A laser, rotatably connected to the movable fixed plate via a laser fixing seat, and used to obtain a focal plane by emitting laser; A reduction motor, fixedly connected to a side of the movable fixed plate away from the laser, and drivingly connected to the laser fixing seat, for controlling the rotation of the laser; The camera is fixed on the side of the fixed aluminum plate and captures images through a fixed-focus lens.

2. The device for acquiring the actual focal plane of a Sham optical system according to claim 1, characterized in that: It also includes an incremental encoder, which is axially connected to the rear side of the laser fixing seat and is used to measure the rotation angle of the laser fixing seat.

3. The device for acquiring the actual focusing plane of a Sham optical system according to claim 1 or 2, characterized in that: It also includes a linear encoder and a linear encoder pull head, wherein the linear encoder is fixedly mounted on the movable fixed plate, the linear encoder is connected to the linear encoder pull head along the direction of the slide rail, and the linear encoder pull head is hinged on the fixed aluminum plate; as the movable fixed plate moves, the linear encoder pull head can be extended from or retracted into the linear encoder.

4. The device for acquiring the actual focusing plane of a Sham optical system according to claim 1, characterized in that: A slewing bearing is fixed on the movable fixed plate, the outer ring of the slewing bearing is fixedly connected to the movable fixed plate, the inner ring of the slewing bearing is fixedly connected to a driven large gear, the laser fixing seat is fixedly connected to the center of the outer end surface of the driven large gear, the output shaft of the reduction motor is fixedly connected to a driving pinion, and the driving pinion is meshed with the driven large gear.

5. The device for acquiring the actual focal plane of a Sham optical system according to claim 4, characterized in that: The reduction ratio formed by the driven small gear and the driven large gear is 1:

3.

6. The device for acquiring the actual focusing plane of a Sham optical system according to claim 1, characterized in that: The camera has a camera target surface for photosensitization, and the fixed-focus lens is connected to the camera via a lens connecting seat, and the lens connecting seat arranges the camera target surface and the fixed-focus lens at a preset angle.

7. The device for acquiring the actual focusing plane of a Sham optical system according to claim 1, characterized in that: The telescopic electric cylinder is fixedly mounted on the side of the fixed aluminum plate, and its output end is connected to the movable fixed plate through a connecting column.

8. The device for acquiring the actual focal plane of a Sham optical system according to claim 1, characterized in that: A limit block for positioning an initial position is provided at the end of the slide rail.

9. A method for acquiring an actual focal plane of a Sham optical system, using the device for acquiring an actual focal plane of a Sham optical system according to any one of claims 1 to 8, characterized in that: The following steps are involved: S1. Fix the positions of the camera and the fixed-focus lens, establish the coordinate system at the lower left corner of the fixed-focus lens, determine the model of the fixed-focus lens, obtain a unique focusing plane, and set the initial angle α=α0; S2, the slider moves linearly from point D1 to point D2, and an image is collected every small distance ds. The number of light bar pixels in each image is obtained through the image processing algorithm, and the i-th image with the least number of light bar pixels is selected and counted as N min , at this time L2 coincides with L0, and the distance between the slider and the origin when taking the i-th image is recorded, L1 = X OA +i*ds, the position is point D3; S3, the slider returns from point D2 to point D3, the object is removed, the laser is irradiated on the stage, an image is collected, and the number of light bar pixels in the image is obtained by the image processing algorithm, which is counted as N, and the total number of light bar pixels in the two images is obtained as N1=N+N min ; S4, changing the angle of the laser to α=α0+n*da, where n=1 and da=1° at the initial stage; S5, repeat steps S2-S4, each time n is repeated, n is increased by 1, the total number of pixels obtained each time is N1, N2, N3, N4..., the distance L after each update is L1, L2, L3, L4..., α is α1, α2, α3, α4...; S6. Find the N with the smallest number of pixels s , the corresponding distance L is L s , the corresponding angle α is α S At this time, L2 coincides with L0, and L3 coincides with L1. At this time, the focal plane is the light plane of the laser, and the position of the focal plane is determined.

10. The method for acquiring the actual focal plane of a Sham optical system according to claim 9, characterized in that: The image processing algorithm comprises the following steps: S31. Convert a certain image into a grayscale image by using a linear weighted average method according to Formula 1, where Formula 1 is: I (u,v) =0.299*R (u,v) +0.587*G (u,v) +0.114*B (u,v) Where R represents the value of the red channel corresponding to the pixel in the u-th row and v-th column, G represents the value of the green channel corresponding to the pixel in the u-th row and v-th column, B represents the value of the blue channel corresponding to the pixel in the u-th row and v-th column, and u and v represent that the pixel in the image has u rows and v columns respectively; S32, traverse the first column of the image, and determine the center point P1 of the light strip in the first column according to Formula 2 and Formula 3, where Formula 2 is: Formula three is: P1=(P1 u ,1); S33, traverse the last column of the image, and determine the center point P2 of the light strip in the last column according to Formula 4 and Formula 5, where Formula 4 is: Formula 5 is: P2=(P2 u ,IN); S34, determine the search direction S0, S0 is determined according to formula 6, formula 6 is: S35. Determine the search. According to the characteristics of the light strips, which are wide in the middle and narrow at both ends, the number of light strip pixels in the middle column of the image must be greater than that in the rest of the image. Traverse the middle column of the image, set a threshold, and count the number of pixels greater than the threshold to obtain the number of pixels on this column of light strips, which is counted as N. max ; S36, along the search direction S0, shift up and down by N max / 2 Set the parallelogram RIO area. The length of the RIO area is the length of the image, that is, V columns, and the height of the RIO area is N max pixels width; S37, traverse the pixels in the RIO area, and according to the threshold set in step S35, count the number of pixels greater than the threshold to obtain the number of pixels belonging to the light strip.

Citation Information

Patent Citations

  • Structured light depth camera parameter design method and system

    CN113189603A