A focal plane detection system and method
By introducing the projection light path of the focal surface detection module and the tilt marker into the autofocus system, combined with the cross-partition processing and image clarity algorithm, the problems of long focal surface detection time and slow focus speed in the case where the measured object is not characterized in the prior art are solved, and fast and efficient automatic focus is achieved.
Patent Information
- Application Number
- CN202510444225.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2045-04-10
AI Technical Summary
The existing autofocus system has a long detection time and slow focus speed when the object to be tested has no characteristics, making it difficult to achieve fast and efficient autofocus.
A focal surface detection system is adopted, including a first lens group, a spectrometer, a focal surface detection module, a second lens group and a digital camera photosensitive chip. The projection light path is formed through a conjugated lens group, a marker and an illumination condenser. The projection image of the inclined marker is used to form an inclined projection image with image characteristics on the object surface. Combined with the cross-partitioning processing and an image sharpness algorithm, the ideal focal surface is quickly positioned.
It realizes that the object to be measured can quickly shorten the focal surface detection time and improve the focus speed without characteristics, and significantly improves the efficiency and adaptability of the automatic focus system.
Smart Images

Figure CN119996829B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of optical technologies, and more particularly, to a focal plane detection system and method. Background Art
[0002] With the continuous development of optical technologies, autofocus technologies are increasingly applied in imaging systems. Autofocus systems are mainly divided into two types: active autofocus and passive autofocus. The active autofocus system aligns an infrared beam with an object, and the object reflects the light back to the camera to determine the distance relationship between the camera and the object, which is limited by the reflection and absorption capabilities of the object. The passive autofocus method is to receive the reflected light of the object to be measured. The object of the captured image needs to have certain features or the captured image needs to have certain details and multiple images need to be captured to analyze the contrast or sharpness of the image to achieve autofocus, which takes a long time. Therefore, it is necessary to find a new fast and efficient focal plane detection method to reduce the focal plane detection time, improve the autofocus speed, and enable autofocus without the need for the object to be measured to have features. Summary of the Invention
[0003] This research and development aims to provide a method for focal plane detection, which is applied to an autofocus system. This method shortens the autofocus time, improves the autofocus speed, and does not require the object to be measured to have features.
[0004] Therefore, the present invention provides a focal plane detection system, including a first lens group, a beam splitter, a focal plane detection module, a second lens group, and a digital camera photosensitive chip. The focal plane detection module includes a conjugate lens group, a marker, and an illumination condenser. Among them, the second lens group and the first lens group form a main optical path to collect image information of the object plane;
[0005] The beam splitter is arranged between the conjugate lens group and the first lens group, constituting an optical path merging node of the projection optical path and the main optical path, for guiding the projection light emitted from the conjugate lens group in the focal plane detection module into the main optical path, and projecting the pattern of the inclined marker onto the object plane through the first lens group;
[0006] The conjugate lens group is arranged between the illumination condenser and the beam splitter, and is located in the optical path of the focal plane detection module, for converging the projection light passing through the marker and guiding it to the beam splitter, and further coupling it into the main optical path through the beam splitter and projecting it onto the object plane through the first lens group;
[0007] The marker is arranged on the outgoing optical path of the illumination condenser and is arranged at an inclination angle for forming an inclined projection image with image features in the projection optical path;
[0008] The illumination condenser is used to irradiate the marker with a light source to form an optical projection, and project the image of the marker onto the object plane through the conjugate lens group and the beam splitter;
[0009] The digital camera photosensitive chip is used to receive the image signal transmitted by the main optical path and form a digital image.
[0010] The present invention also provides a focal plane detection method, based on the aforementioned focal plane detection system, including the following steps:
[0011] Projection step: The illumination condenser lens focuses and irradiates the light onto the obliquely arranged marker; the image of the marker is projected onto the object plane through the conjugate lens group and the beam splitter to form an oblique projection image;
[0012] Image acquisition step: The light reflected from the object plane is collected by the first lens group, passes through the beam splitter and is introduced into the second lens group, and finally forms an image on the digital camera photosensitive chip;
[0013] Partition processing step: Regionally segment the digital image projected onto the digital camera photosensitive chip. The multiple segmented regions are coarse equal partitions or fine equal partitions, where the coarse equal partitions are larger than the fine equal partitions; and obtain the overlapping partitions. The overlapping partitions are image sub-regions set according to a preset strategy, and the overlapping partitions spatially cover part of the coarse equal partition region and part of the fine equal partition region;
[0014] Image processing step: Evaluate the image of each overlapping partition using a preset image sharpness algorithm; draw a sharpness curve graph based on the image sharpness result to determine the sharp point. The sharp point is the position corresponding to the maximum sharpness of the projection image, and the horizontal plane where the sharp point is located is the ideal focal plane; calculate the defocus amount based on the tilt angle of the marker, the magnification of the projection optical path system formed by the focal plane detection module and the first lens group, and the horizontal distance between the sharp point and the vertex of the projection image, and adjust the lens according to the defocus amount.
[0015] Among them, the step of dividing the coarse equal partitions includes: Regionally segment the digital image. For example, the digital image can be equally divided into 5X5 small windows as a coarse equal partition.
[0016] The step of dividing the fine equal partitions includes: Regionally segment the digital image. For example, the digital image can be equally divided into 2X2 small windows as a fine equal partition.
[0017] The step of dividing the overlapping partitions includes: Regionally segment the digital image. The digital image small window can be used as an overlapping partition. This region contains part of the coarse equal partition and part of the fine equal partition.
[0018] Preferably, in the image processing step, the step of calculating the defocus amount includes:
[0019] First, calculate the tangent value of the tilt angle of the projection image relative to the horizontal plane , expressed as:
[0020]
[0021] Among them, is the tilt angle of the marker relative to the optical axis of the focal plane detection module; is the magnification of the conjugate optical path system formed by the focal plane detection module and the first lens group; is the tilt angle of the projection image relative to the horizontal plane;
[0022] Then calculate the defocus amount , expressed as:
[0023]
[0024] Among them, is the horizontal distance between the clear point and the vertex of the projection image; is the tilt angle of the projection image relative to the horizontal plane; is the defocus amount, representing the vertical distance of the ideal focal plane relative to the vertex of the projection image.
[0025] In the image processing step, evaluating the image of each overlapping partition using a preset image sharpness algorithm includes:
[0026] Input the coarse equal-partition image and the fine equal-partition image into different feature extraction paths respectively to extract the corresponding image expression features. During the image feature extraction process of the coarse equal-partition image and the fine equal-partition image, establish the position mapping relationship between the coarse equal-partition and the fine equal-partition according to the image spatial coordinates; perform weighted fusion on the two feature mappings, and determine the fusion weight according to the feature reconstruction error or structural similarity. Input the fused features into the image sharpness scoring function and draw the corresponding sharpness curve.
[0027] Preferably, perform an encoding operation on the coarse equal-partition image that includes at least three groups of two-dimensional filtering and non-linear transformation, where each group of encoding operations outputs an intermediate feature representation of a unified dimension while maintaining the global structure expression of the image;
[0028] Perform an encoding operation on the fine equal-partition image that includes at least four groups of high-resolution feature extraction units, where each group of encoding operations includes a detail enhancement mechanism and an edge stabilization mechanism;
[0029] During the feature extraction process, all output feature mappings are normalized to the same spatial resolution and channel structure for cross-region alignment and fusion; call the context features of the coarse equal-partition or the fine equal-partition according to the spatial mapping rule, and output a composite image representation suitable for subsequent sharpness analysis and focal plane positioning.
[0030] Preferably, when extracting the image features of the coarse equal-partition and the fine equal-partition, establishing the position mapping relationship between the coarse equal-partition and the fine equal-partition according to the image spatial coordinates includes the following steps:
[0031] Encode the coarse equal - partitioned image and the fine equal - partitioned image into intermediate feature representations with the same structural feature dimensions respectively;
[0032] When extracting the features of the fine equal - partitioned image, combine the feature representation of the coarse equal - partitioned area it covers as context information to enhance the stability of details and boundaries;
[0033] When extracting the features of the coarse equal - partitioned image, use the features of the edge area of the fine equal - partitioned area contained therein as an auxiliary reference to improve the accuracy of the feature expression of the coarse equal - partitioned area;
[0034] Perform weighted fusion on the two feature maps, and determine the fusion weights according to the feature reconstruction error or structural similarity.
[0035] Preferably, encoding the coarse equal - partitioned image and the fine equal - partitioned image into intermediate feature representations with the same structural feature dimensions specifically includes:
[0036] For the coarse equal - partitioned image and the fine equal - partitioned image perform feature extraction operations respectively to obtain the coarse equal - partitioned feature representation and the fine equal - partitioned feature representation , and map the two into the same feature space, expressed as:
[0037]
[0038] wherein, and respectively represent the feature encoding functions used by the image in the coarse equal - partitioned area and the fine equal - partitioned area;
[0039] Establish a position alignment relationship according to the image coordinate mapping. For any position in the fine equal - partitioned area as , its corresponding position in the coarse equal - partitioned area is , then the two satisfy:
[0040]
[0041] wherein, is the sampling step ratio of the fine equal - partitioned area relative to the coarse equal - partitioned area, represents the floor function.
[0042] Preferably, performing weighted fusion on the two feature maps, and determining the fusion weights according to the feature reconstruction error or structural similarity specifically includes:
[0043] For each sampling position in the overlapping area, by reading and The corresponding eigenvectors therein, and calculate the joint feature representation based on structural consistency weighting , which is expressed as:
[0044]
[0045] wherein, represents the eigenvector at position after the coarse equal partition image is subjected to feature extraction, represents the eigenvector extracted at position of the fine equal partition image, and respectively represent the fusion weights of the coarse equal partition and the fine equal partition, satisfying the condition ;
[0046] and are determined in reverse according to the local reconstruction error, and are expressed as:
[0047]
[0048] wherein, , respectively represent the reconstruction errors of the coarse equal partition and the fine equal partition, and the reconstruction error is calculated according to the pixel difference between the original image and the feature decoded image;
[0049] Input the feature into the image sharpness scoring function, draw the corresponding sharpness curve, and determine the position where the oblique projection image intersects the focal plane.
[0050] The beneficial effects of the present invention are as follows: A beam splitter is added to the main optical path imaging system of the present invention, a conjugate lens group is added on one side, the marker and the illumination system form a projection optical path, and then the marker is tilted, and the tilt angle is . By illuminating and projecting the marker, the projection of the marker passes through the conjugate lens group, the beam splitter and the lens group and is projected onto the object surface, so that the photosensitive chip of the main optical path digital camera obtains an image on the object surface with the characteristics of the marker. Then, the collected digital image is partitioned and digitally processed through a preset algorithm, the image sharpness is obtained through the preset algorithm, and the clear point is determined. The horizontal plane where the clear point is located is the ideal focal plane. By calculating the vertical distance between the ideal focal plane and the projection vertex, the position of the ideal focal plane is quickly obtained, the focal plane detection time is shortened, and the focusing speed is improved.
[0051] Compared with the traditional passive autofocus system that needs to collect images of multiple focal planes and compare the sharpness frame by frame, the present invention can obtain the information of the intersection points of the entire oblique projection and the focal plane through a single image acquisition; through the analysis of the peak value of the sharpness curve, it realizes the rapid positioning of the focal plane, significantly shortens the focusing time, and improves the work efficiency. The present invention projects an inclined marker pattern with image features on the object plane, enhancing the structural information of the measured object in the imaging image; even if the object itself has no obvious texture or edge features, stable sharpness evaluation can be achieved, thus completing the focusing; effectively breaking through the strong dependence of the traditional focusing system on the surface features of the object and having stronger adaptability.
[0052] The overlapping partition method is adopted, taking into account both the image information volume and the focal plane detection accuracy; especially the overlapping partition design improves the accuracy of sharpness evaluation in the boundary area through the cross-scale feature fusion mechanism; ensuring the stability and anti-interference ability of the image sharpness evaluation in the full field of view.
[0053] In the system, an auxiliary optical path is constructed through a conjugate lens group and a beam splitter, without affecting the main imaging channel; the projection system and the imaging system share some optical path components, with a more compact structure and easier integration; it is suitable for highly integrated application scenarios such as embedded optical detection modules, autofocus devices, and microscopes. The projection tilt angle and magnification parameters can be pre-calibrated, and combined with the sharpness scoring model, a focusing control closed-loop can be quickly formed; the image sharpness algorithm has flexibility. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will further illustrate the present invention in conjunction with the drawings and embodiments. The drawings in the following description are only partial 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:
[0055] Figure 1 It is a schematic structural diagram of a focal plane detection system according to a preferred embodiment of the present invention;
[0056] Figure 2 It is a sharpness curve diagram of a focal plane detection method according to a preferred embodiment of the present invention;
[0057] Figure 3 It is a schematic diagram of object plane projection of a focal plane detection method according to a preferred embodiment of the present invention;
[0058] Figure 4 It is a schematic diagram of the overlapping partition principle of a focal plane detection method according to a preferred embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0059] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention. Apparently, the described embodiments are some, rather than all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the protection scope of the present invention.
[0060] The focal plane detection system of a preferred embodiment of the present invention is as Figure 1 shown, and includes a first lens group 1 (i.e., the objective lens), a beam splitter 2, a focal plane detection module, a second lens group 6 (i.e., the tube lens), and a digital camera photosensitive chip 7. The focal plane detection module includes a conjugate lens group 3, a marker 4, and an illumination condenser 5. Among them, the second lens group 6 and the first lens group 1 form the main optical path to collect the image information of the object plane;
[0061] The beam splitter 2 is arranged between the conjugate lens group 3 and the first lens group 1, constituting the optical path merging node of the projection optical path and the main optical path, for guiding the projection light emitted from the conjugate lens group 3 in the focal plane detection module into the main optical path, and projecting the pattern of the inclined marker 4 onto the object plane through the first lens group 1;
[0062] The conjugate lens group 3 is arranged between the illumination condenser 5 and the beam splitter 2, and it is located in the optical path of the focal plane detection module, for converging the projection light passing through the marker 4 and guiding it to the beam splitter 2, and further coupling it into the main optical path through the beam splitter 2, and projecting it onto the object plane through the first lens group 1;
[0063] The marker 4 is arranged on the outgoing optical path of the illumination condenser 5 and is arranged at an inclination angle for forming an inclined projection image with image features in the projection optical path;
[0064] The illumination condenser 5 is used to irradiate the light source onto the marker 4 to form an optical projection, and after passing through the conjugate lens group 3 and the beam splitter 2, project the image of the marker 4 onto the object plane;
[0065] The digital camera photosensitive chip 7 is used to receive the image signal transmitted by the main optical path and form a digital image.
[0066] The principle of the focal plane detection method of the present invention is: in an imaging system composed of an object plane, a first lens group, a second lens group, and an image plane, a beam splitter is inserted to introduce the focal plane detection module into the imaging system. The focal plane detection module is composed of a conjugate lens group, an illumination condenser, and a marker. Among them, the optical path formed by the conjugate lens group and the first lens group has good imaging quality, and the marker plane and the marker projection imaging plane are conjugate; the marker is placed in front of the illumination condenser and is inclined, and the inclination angle is ; the marker is a reticle with certain image features.
[0067] In summary, the object plane, the image plane, and the marker are conjugate to each other.
[0068] In the main optical path imaging system of the present invention, a beam splitter is added, a conjugate lens group is added on one side, the marker and the illumination system form a projection optical path, and then the marker is tilted, and the tilt angle is . By illuminating and projecting the marker, the projection of the marker is projected onto the object plane through the conjugate lens group, the beam splitter, and the first lens group, so that the image sensor chip of the main optical path digital camera obtains an image on the object plane with the characteristics of the marker. Then, the collected digital image is partitioned and digitally processed, the image sharpness is obtained through a preset algorithm, and the clear point is determined. The horizontal plane where the clear point is located is the ideal focal plane. By calculating the vertical distance between the ideal focal plane and the projection vertex, the position of the ideal focal plane is quickly obtained, the focal plane detection time is shortened, and the focusing speed is improved.
[0069] The focal plane detection system of the preferred embodiment of the present invention is as Figures 1-4 shown, and based on the previous embodiment, it includes the following steps:
[0070] Projection step: The illumination condenser lens 5 focuses and irradiates the light onto the tilted marker 4; the image of the marker 4 is projected onto the object plane through the conjugate lens group 3 and the beam splitter 2 to form a tilted projection image;
[0071] Image acquisition step: The light reflected from the object plane is collected by the first lens group 1, passes through the beam splitter 2 and is introduced into the second lens group 6, and finally forms an image on the digital camera image sensor chip 7;
[0072] Partition processing step: The digital image projected onto the digital camera image sensor chip 7 is regionally segmented, and the multiple segmented regions are coarse equal partitions or fine equal partitions, where the coarse equal partitions are larger than the fine equal partitions; and the overlapping partitions are obtained. The overlapping partitions are image sub-regions set according to a preset strategy, and the overlapping partitions spatially cover part of the coarse equal partition region and part of the fine equal partition region; after the regional segmentation, there are both coarse equal partitions and fine equal partitions in the digital image, and the coarse equal partitions and the fine equal partitions are distributed at intervals;
[0073] Image processing step: The image of each overlapping partition is evaluated using a preset image sharpness algorithm; the sharpness curve graph is drawn according to the image sharpness result to determine the clear point, and the clear point is the position corresponding to the maximum sharpness of the projection image; based on the tilt angle of the marker, the magnification of the projection optical path system formed by the focal plane detection module and the first lens group, and the horizontal distance between the clear point and the vertex of the projection image, the defocus amount is calculated, and the lens is adjusted according to the defocus amount.
[0074] Traditional passive autofocus requires collecting images of parallel planes before and after multiple focal planes, and it takes a long time to determine the focal plane. Therefore, in this patent, the marker is tilted to obtain an image of the tilted projection. By acquiring the intersection information between the parallel planes before and after multiple focal planes and the projection image through one image acquisition, the number of image acquisitions is reduced. Moreover, there is only one intersection position between the focal plane and the tilted projection image, so the intersection position of the image is clear, and the intersection positions of other projection images with the front and back of the focal plane are out of focus. Figure 2 After analyzing the clarity of the acquired image, a clarity curve graph is drawn. The peak position S of the curve is the intersection position of the tilted projection and the focal plane. Therefore, the position where point S is located is the clear point.
[0075] In traditional passive autofocus, the clarity of the image is evaluated by analyzing the contrast or sharpness of the image by collecting the image information of the object to be measured or the object surface, and the focal plane is determined to achieve autofocus. The acquired image needs to have a certain amount of information. If the amount of information of the object surface or the object to be measured itself is too small, resulting in insufficient information in the acquired image, it is difficult to perform autofocus. The present invention introduces a focal plane detection module. The focal plane detection module projects the marker, enriching the features of the object surface and making the acquired image contain more information, so that autofocus can be achieved even if the object surface or the object to be measured itself has no features.
[0076] When performing digital image processing, the acquired image is partitioned. The acquired digital image is partitioned using a rough equal division method. This partitioning method has few sampling points, a long sampling step length, and a short sampling time. Each partition in this method has a lot of image information but insufficient focusing accuracy; if a fine equal division method is used for partitioning, this partitioning method has many sampling points, a short sampling step length, and a long sampling time. This partitioning method has high focusing accuracy but each partition cannot contain enough image information. The present invention adopts the overlapping partitioning method as Figure 4 shown ( Figure 4 where S1, S2, and S3 all represent overlapping partitions), expanding the fine equal partitions, overlapping with each other to generate overlapping partitions, so that the partitions have enough image information and sufficient focusing accuracy.
[0077] In the image processing step of this embodiment, in the image processing step, the steps for calculating the defocus amount include:
[0078] First, calculate the tangent value of the tilt angle of the projection image relative to the horizontal plane , which is expressed as:
[0079]
[0080] where, is the tilt angle of the marker 4 relative to the optical axis of the focal plane detection module; is the magnification of the conjugate optical path system formed by the focal plane detection module and the first lens group; is the tilt angle of the projected image relative to the horizontal plane.
[0081] Then calculate the defocus amount , expressed as:
[0082]
[0083] Where is the horizontal distance between the clear point and the vertex of the projected image; is the tilt angle of the projected image relative to the horizontal plane; is the defocus amount, representing the vertical distance of the ideal focal plane relative to the vertex of the projected image.
[0084] The projection of the marker is projected onto the inclined object surface through the first lens group, so that the inclined object surface has the characteristics of the marker. The light reflected by the object with the projection characteristics of the marker enters the second lens group through the first lens group and the beam splitter, and finally forms an image on the photosensitive chip of the digital camera. By analyzing the sharpness of the acquired digital image, the position with the maximum sharpness can be obtained. For example Figure 3 Observing the vertical focal plane direction, the intersection point S of the projected image and the focal plane is the clear image point. According to the tilt angle of the inclined marker and the tilt angle of the projected image relative to the horizontal plate and the magnification of the focal plane detection module, the relationship among the three is , and the tangent value of the projected image relative to the object surface can be obtained. The horizontal distance between the clear point and the vertex of the projected image can be obtained by measurement and is defined as . At this time, the defocus amount can be obtained according to the trigonometric function relationship, specifically , and then the focal plane is determined to achieve autofocus.
[0085] In this embodiment, the image sharpness evaluation algorithm adopted by the photosensitive chip 7 of the digital camera includes but is not limited to the Laplacian algorithm, wavelet transform, Fourier transform or image contrast method, and is used to quantify and evaluate the sharpness of the partitioned image regions.
[0086] In the image processing steps of this embodiment, evaluating each overlapping partitioned image using a preset image sharpness algorithm includes:
[0087] The coarse equal - partitioned image and the fine equal - partitioned image are respectively input into different feature extraction paths to extract corresponding image expression features. During the image feature extraction process of the coarse equal - partitioned image and the fine equal - partitioned image, a position mapping relationship between the coarse equal - partitioned area and the fine equal - partitioned area is established according to the image spatial coordinates; the two feature mappings are weighted and fused, and the fusion weights are determined based on the feature reconstruction error or structural similarity. The fused features are input into the image sharpness scoring function to draw the corresponding sharpness curve.
[0088] In this embodiment, an encoding operation including at least three groups of two - dimensional filtering and non - linear transformation is performed on the coarse equal - partitioned image. Each group of encoding operations outputs an intermediate feature representation of a unified dimension while maintaining the global structure expression of the image.
[0089] An encoding operation including at least four groups of high - resolution feature extraction units is performed on the fine equal - partitioned image. Each group of encoding operations includes a detail enhancement mechanism and an edge stabilization mechanism.
[0090] During the feature extraction process, all output feature maps are normalized to the same spatial resolution and channel structure for cross - region alignment and fusion; according to the spatial mapping rule, the context features of the coarse equal - partitioned area or the fine equal - partitioned area are called, and a composite image representation suitable for subsequent sharpness analysis and focal plane positioning is output.
[0091] An encoding operation is performed on the fine equal - partitioned image, which focuses on extracting high - frequency features such as edges and textures in the image. The encoding structure includes at least four groups of high - resolution feature extraction units. Each group of encoding operations includes a small - size convolution operation (preferably 3×3 in this embodiment) for capturing fine local features; the detail enhancement mechanism includes methods such as edge enhancement filters, local contrast enhancement, and local gradient boosting for enhancing edge responses; the edge stabilization mechanism includes cross - frame edge consistency constraints or noise suppression modules for enhancing the robustness of the boundary region.
[0092] To ensure that the feature representations output by the coarse equal - partitioned area and the fine equal - partitioned area can be aligned and fused, in this embodiment, all feature maps are normalized: first, all feature maps are adjusted to a unified spatial resolution (the same size as the output image of the photosensitive chip) through interpolation or de - convolution, etc.; then the number of feature channels is unified (both are 64 - dimensional or 128 - dimensional) for easy feature fusion and calculation; finally, L2 normalization is used to normalize to the [0, 1] interval to ensure the comparability of features from different sources in terms of numerical scale.
[0093] In this embodiment, when extracting the image features of the coarse equal - partitioned area and the fine equal - partitioned area, a position mapping relationship between the coarse equal - partitioned area and the fine equal - partitioned area is established according to the image spatial coordinates, including the following steps:
[0094] Encode the coarse equal - partitioned and fine equal - partitioned images into intermediate feature representations with the same structural feature dimensions respectively;
[0095] When extracting the features of the fine equal - partitioned image, combine the feature representation of the coarse equal - partitioned area it covers as context information to enhance the stability of details and boundaries;
[0096] When extracting the features of the coarse equal - partitioned image, use the features of the edge area of the fine equal - partitioned area contained therein as an auxiliary reference to improve the accuracy of the feature expression of the coarse equal - partitioned area;
[0097] Perform weighted fusion on the two feature maps, and determine the fusion weights based on the feature reconstruction error or structural similarity.
[0098] In this embodiment, encoding the coarse equal - partitioned and fine equal - partitioned images into intermediate feature representations with the same structural feature dimensions specifically includes:
[0099] For the coarse equal - partitioned image and the fine equal - partitioned image perform feature extraction operations respectively to obtain the coarse equal - partitioned feature representation and the fine equal - partitioned feature representation , and map both of them into the same feature space, expressed as:
[0100]
[0101] wherein, and respectively represent the feature encoding functions used by the image in the coarse equal - partitioned and fine equal - partitioned areas;
[0102] Establish a position alignment relationship according to the image coordinate mapping. For any position in the fine equal - partitioned area as , its corresponding position in the coarse equal - partitioned area is , then the two satisfy:
[0103]
[0104] wherein, is the sampling step - size ratio of the fine equal - partitioned area relative to the coarse equal - partitioned area, represents the floor function.
[0105] In this embodiment, performing weighted fusion on the two feature maps, and determining the fusion weights based on the feature reconstruction error or structural similarity specifically includes:
[0106] For each sampling position in the overlapping area, by reading the and corresponding feature vectors therein, and calculating the joint feature representation based on the weighted calculation of structural consistency, expressed as:
[0107]
[0108] Among them, represents the feature vector of the coarsely equally partitioned image at position after feature extraction, represents the feature vector extracted from the finely equally partitioned image at position ; and represent the fusion weights of the coarsely equally partitioned region and the finely equally partitioned region respectively, satisfying the condition ;
[0109] and are determined backward according to the local reconstruction error, expressed as:
[0110]
[0111] Among them, 、 represent the reconstruction errors of the coarsely equally partitioned region and the finely equally partitioned region respectively, and the reconstruction error is calculated based on the pixel difference between the original image and the feature decoded image;
[0112] Input the feature into the image sharpness scoring function, and draw the corresponding sharpness curve to determine the position where the tilted projection image intersects the focal plane.
[0113] By separately constructing the feature extraction paths for the coarse equal - partition and the fine equal - partition, the system can simultaneously capture the global structural features and local texture details of the image, thereby improving the resolution accuracy of the focal plane positioning while ensuring the focusing robustness. By establishing the spatial mapping relationship between the coarse and fine equal - partitions and making context references during the feature extraction process, the stability of the image boundary region is improved, and the information loss problem caused by the regional boundary segmentation is suppressed. This solution makes the features of the coarse and fine equal - partitions have consistent spatial dimensions and channel structures through feature normalization processing, ensuring the efficient fusion of images at different scales in the overlapping region and providing a unified feature input basis for clarity scoring and focal plane calculation. Using the reconstruction error or structural consistency score as the basis for the fusion weight, the dynamic adjustment of the feature weight distribution according to the actual reconstruction quality of the image is realized, enhancing the recognition accuracy of the focal plane intersection of the projected image in the overlapping partition. By fusing the feature - driven image scoring results, the present invention can output a continuous clarity change curve, and combined with the inclination angle of the projected image and the horizontal displacement of the clear point, accurately calculate the focal plane deviation and realize automatic focusing control. Relying on the structural projection mechanism of the inclined marker pattern, even in the background with no texture or low contrast, effective image features can be introduced to ensure that the system can complete the focal plane detection and focusing operations, improving the universality of the system. The feature encoding, spatial mapping, and fusion strategy involved in this solution are all computationally - implementable processes that can be modularized and are suitable for embedding and running in edge - computing devices, imaging terminals, or intelligent focusing modules.
[0114] Compared with the traditional passive autofocus system that needs to collect multiple focal - plane images and compare the clarity frame by frame, the present invention can obtain the information of the entire intersection of the oblique projection and the focal plane through one - time image acquisition; through the analysis of the peak value of the clarity curve, rapid focal - plane positioning is realized, significantly shortening the focusing time and improving the work efficiency. By projecting an inclined marker pattern with image features on the object surface, the present invention enhances the structural information of the measured object in the imaging image; even if the object itself has no obvious texture or edge features, stable clarity evaluation can be achieved, thereby completing the focusing; effectively breaking through the strong dependence of the traditional focusing system on the object surface features and having stronger adaptability.
[0115] Adopting the partition method of overlapping partitions takes into account both the image information volume and the focal - plane detection accuracy; especially the overlapping - partition design improves the accuracy of clarity evaluation in the boundary region through the cross - scale feature fusion mechanism; ensuring the stability and anti - interference ability of the image clarity evaluation in the entire field of view.
[0116] In the system, an auxiliary optical path is constructed by a conjugate lens group and a beam splitter, which does not affect the main imaging channel; the projection system and the imaging system share some optical path components, making the structure more compact and easier to integrate; it is suitable for highly integrated application scenarios such as embedded optical detection modules, autofocus devices, and micro imagers. The image sharpness is obtained through a preset algorithm, and the clear point is determined. The horizontal plane where the clear point is located is the ideal focal plane. By calculating the vertical distance between the ideal focal plane and the projection vertex, the position of the ideal focal plane is quickly obtained, shortening the focal plane detection time and improving the focusing speed. Both the projection angle and the magnification parameter can be pre-calibrated. Combining with the sharpness scoring model, a focusing control closed-loop can be quickly formed.
[0117] It should be understood that those of ordinary skill in the art can make improvements or transformations according to the above description, and all such improvements and transformations should fall within the protection scope of the appended claims of the present invention.
Claims
1. A focal plane detection system, characterized in that: The invention comprises a first lens group (1), a beam splitter (2), a focal plane detection module, a second lens group (6) and a digital camera photosensitive chip (7), wherein the focal plane detection module comprises a conjugate lens group (3), a marker (4) and an illumination condenser (5), wherein: The second lens group (6) and the first lens group (1) form a main optical path to collect image information of the object surface; The beam splitter (2) is arranged between the conjugate lens group (3) and the first lens group (1), forming a light path merging node of the projection light path and the main light path, and is used to guide the projection light emitted from the focal plane detection module through the conjugate lens group (3) into the main light path, and project the pattern of the tilt marker (4) onto the object surface through the first lens group (1); The conjugate lens group (3) is arranged between the illumination condenser (5) and the beam splitter (2), and is located in the optical path of the focal plane detection module, and is used to converge the projection light passing through the marker (4) and guide it to the beam splitter (2), and further couple it into the main optical path through the beam splitter (2), and project it onto the object surface through the first lens group (1); The marker (4) is arranged on the outgoing light path of the illumination condenser (5) and is inclined at an angle Arranged to form an oblique projection image having image characteristics in a projection light path; The illumination condenser (5) is used to irradiate the light source onto the marker (4) to form an optical projection, and project the image of the marker (4) onto the object surface through the conjugate lens group (3) and the beam splitter (2); The digital camera photosensitive chip (7) is used to receive the image signal transmitted by the main light path and form a digital image; Performing regional segmentation on a digital image projected onto a digital camera photosensitive chip (7), wherein the multiple segmented regions are coarse equal partitions or fine equal partitions, wherein the coarse equal partitions are larger than the fine equal partitions; and obtaining overlapping partitions, wherein the overlapping partitions are image sub-regions set according to a preset strategy, and the overlapping partitions spatially cover part of the coarse equal partition regions and part of the fine equal partition regions; The image of each overlapping partition is evaluated using a preset image clarity algorithm; a clarity curve is drawn based on the image clarity results to determine the clarity point, where the clarity point is the position corresponding to the maximum clarity of the projected image, and the horizontal plane where the clarity point is located is the ideal focal plane; based on the inclination angle of the marker, the magnification of the projection optical path system composed of the focal plane detection module and the first lens group, and the horizontal distance between the clarity point and the vertex of the projected image, the defocus amount is calculated, and the lens is adjusted according to the defocus amount.
2. A focal plane detection method, based on the focal plane detection system according to claim 1, characterized in that: The following steps are involved: Projection step: focusing the light by the illumination condenser (5) to illuminate the inclined marker (4); projecting the image of the marker (4) onto the object surface through the conjugate lens group (3) and the beam splitter (2) to form an inclined projection image; Image acquisition step: light reflected from the object surface is collected by the first lens group (1), guided into the second lens group (6) through the beam splitter (2), and finally imaged on the digital camera photosensitive chip (7); Partition processing step: performing regional segmentation on the digital image projected onto the digital camera photosensitive chip (7), wherein the multiple segmented regions are coarse equal partitions or fine equal partitions, wherein the coarse equal partition is larger than the fine equal partition; and obtaining overlapping partitions, wherein the overlapping partitions are image sub-regions set according to a preset strategy, and the overlapping partitions spatially cover part of the coarse equal partition region and part of the fine equal partition region; Image processing steps: use a preset image clarity algorithm to evaluate each overlapping partitioned image; draw a clarity curve based on the image clarity results to determine the clarity point, where the clarity point is the position corresponding to the maximum clarity of the projected image, and the horizontal plane where the clarity point is located is the ideal focal plane; based on the inclination angle of the marker, the magnification of the projection optical path system composed of the focal plane detection module and the first lens group, and the horizontal distance between the clarity point and the vertex of the projected image, calculate the defocus amount and adjust the lens according to the defocus amount.
3. The focal plane detection method according to claim 2, characterized in that: In the image processing step, the step of calculating the defocus amount includes: First, calculate the tangent of the inclination angle of the projected image relative to the horizontal plane , expressed as: ; in, is the tilt angle of the marker (4) relative to the optical axis of the focal plane detection module; is the magnification of the conjugate optical path system formed by the focal plane detection module and the first lens group; is the inclination angle of the projected image relative to the horizontal plane; Then calculate the defocus , expressed as: ; in, is the horizontal distance between the clear point and the vertex of the projected image; is the inclination angle of the projected image relative to the horizontal plane; is the defocus value, which represents the vertical distance of the ideal focal plane relative to the vertex of the projected image.
4. The focal plane detection method according to claim 2, characterized in that: The image clarity evaluation algorithm used by the digital camera photosensitive chip (7) includes but is not limited to the Laplacian algorithm, wavelet transform, Fourier transform or image contrast method, which is used to quantify and evaluate the clarity of the partitioned image area.
5. The focal plane detection method according to claim 2, characterized in that: In the image processing step, the image of each overlapping partition is evaluated using a preset image clarity algorithm including: The coarse equally partitioned image and the fine equally partitioned image are respectively input into different feature extraction pathways to extract the corresponding image expression features. In the process of extracting the features of the coarse equally partitioned image and the fine equally partitioned image, the position mapping relationship between the coarse equally partitioned image and the fine equally partitioned image is established according to the image space coordinates. The two feature maps are weightedly fused, and the fusion weight is determined according to the feature reconstruction error or structural similarity. The fused features are input into the image clarity scoring function to draw the corresponding clarity curve.
6. The focal plane detection method according to claim 5, characterized in that: Performing encoding operations including at least three groups of two-dimensional filtering and nonlinear transformation on the coarse equally partitioned image, wherein each group of encoding operations outputs an intermediate feature representation of uniform dimension while maintaining the global structure expression of the image; Performing a coding operation including at least four groups of high-resolution feature extraction units on the finely divided image, wherein each group of coding operations includes a detail enhancement mechanism and an edge stabilization mechanism; During the feature extraction process, all output feature maps are normalized to the same spatial resolution and channel structure for cross-region alignment and fusion; the context features of coarse or fine equal partitions are called according to the spatial mapping rules.
7. The focal plane detection method according to claim 5, characterized in that: When extracting the image features of the coarse and fine equal partitions, a position mapping relationship between the coarse and fine equal partitions is established according to the image space coordinates, including the following steps: Encode the coarse and fine equally partitioned images into intermediate feature representations with the same structural feature dimensions respectively; When extracting fine equally partitioned image features, the coarse equally partitioned features covered by them are combined as context information to enhance details and boundary stability; When extracting the features of the coarse equally partitioned image, the features of the edge areas of the fine equally partitioned areas contained therein are used as auxiliary references to improve the accuracy of the expression of the coarse equally partitioned features.
8. The focal plane detection method according to claim 7, characterized in that: The coarse and fine partition images are respectively encoded into intermediate feature representations with the same structural feature dimensions, including: Roughly partition the image and fine-scaled images Perform feature extraction operations separately to obtain coarse equal partition feature representation and fine-scale partition feature representation , and uniformly map both into the same feature space, expressed as: ; in, and Respectively represent the feature encoding functions used in the coarse and fine partitioning of the image; According to the image coordinate mapping, the position alignment relationship is established. Any position in the fine partition is , and its corresponding rough equal partition position is , then both satisfy: ; in, is the ratio of the sampling step length of the fine partition to the coarse partition, Represents the floor function.
9. The focal plane detection method according to claim 7, characterized in that: The two feature maps are weightedly fused, and the fusion weight is determined based on the feature reconstruction error or structural similarity, including: For each sampling position in the overlap region, by reading and The corresponding feature vectors in , and the joint feature representation is calculated based on the structural consistency weight. , expressed as: ; in, It means that the roughly divided image is extracted after feature extraction at position The eigenvector at Indicates that the finely divided image is at position The feature vector extracted at and Respectively represent the fusion weights of the coarse and fine partitions, satisfying the conditions ; and Determined in reverse based on the local reconstruction error, it is expressed as: ; in, , They represent the reconstruction errors of the coarse and fine partitions, respectively. The reconstruction errors are calculated based on the pixel differences between the original image and the feature decoded image. The characteristics Input the image clarity scoring function and draw the corresponding clarity curve.
Citation Information
Patent Citations
Large field of view image sharpening device and method based on focal plane Hartmann wavefront sensor
CN110146180A
Dual-camera parallel confocal differential microscopic 3D topography measurement device and method
CN110849289A