Focal plane detection system and method
By introducing a focal surface detection module into the autofocus system, the projected image of the tilt mark is used to detect the focus surface, and the problems of long and slow focus time 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
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-04-10
AI Technical Summary
The existing automatic focus system takes a long time and has a slow focus speed when the object to be tested has no characteristics.
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, and the focal surface detection is performed using the projected image of the inclined marker.
It realizes fast and efficient focal surface detection, shortens focus time, improves focus speed, and automatically focuses without object features.
Smart Images

Figure CN119996829A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of optical technology, and more specifically, to a focal plane detection system and method. Background Art
[0002] With the continuous development of optical technology, autofocus technology is increasingly used in imaging systems. Autofocus systems are mainly divided into two types: active focus and passive focus. The active focus system aims an infrared beam at an object, and the object reflects the light back to the camera to determine the distance between the camera and the object, which is limited by the reflection and absorption capacity of the object. The passive focus method is to receive the reflection 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 focus plane detection method to reduce the focus plane detection time, improve the focusing speed, and the method that the object to be measured can be automatically focused without having features. Summary of the invention
[0003] This research and development aims to provide a method for focal plane detection, which is applied to the autofocus system. This method shortens the focusing time, improves the focusing speed, and the object under test does not need to have features.
[0004] Therefore, the present invention provides a focal plane detection system, comprising a first lens group, a beam splitter, a focal plane detection module, a second lens group and a digital camera photosensitive chip, and the focal plane detection module comprises a conjugate lens group, a marker and an illumination condenser, wherein the second lens group and the first lens group form a main light path to collect image information of the object surface;
[0005] The beam splitter is arranged between the conjugate lens group and the first lens group, 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 into the main light path, and project the pattern of the tilt marker onto the object surface 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, and is used to converge the projection light passing through the marker and guide it to the beam splitter, and further couple it into the main optical path through the beam splitter, and project it onto the object plane through the first lens group;
[0007] The marker is arranged on the outgoing light path of the illumination condenser and is inclined at an angle Arranged to form an oblique projection image having image characteristics in a projection light path;
[0008] The illumination condenser is used to irradiate the light source onto the marker to form an optical projection, and project the image of the marker onto the object surface 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 light 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, comprising the following steps:
[0011] Projection step: the illumination condenser focuses the light onto the obliquely set marker; the image of the marker is projected onto the object surface via a conjugate lens group and a beam splitter to form an oblique projection image;
[0012] Image acquisition step: the light reflected from the object surface is collected by the first lens group, introduced into the second lens group through the beam splitter, and finally imaged on the photosensitive chip of the digital camera;
[0013] Partition processing step: perform regional segmentation on the digital image projected onto the photosensitive chip of the digital camera, 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 obtain 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 area and part of the fine equal partition area;
[0014] 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, 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.
[0015] The step of dividing the rough equal partitions includes: performing region segmentation on the digital image, for example, dividing the digital image into 5X5 small windows as a rough equal partition.
[0016] The step of dividing the digital image into fine equal partitions includes: performing region segmentation on the digital image, for example, the digital image can be divided into 2X2 small windows as a fine equal partition.
[0017] The step of dividing the overlapping partitions includes: performing regional division on the digital image, and the small window of the digital image can be used as an overlapping partition. The region includes both the coarse equal partition and the fine equal partition.
[0018] Preferably, in the image processing step, the step of calculating the defocus amount includes:
[0019] First, calculate the tangent of the inclination angle of the projected image relative to the horizontal plane , expressed as:
[0020]
[0021] in, is the inclination 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 inclination angle of the projected image relative to the horizontal plane;
[0022] Then calculate the defocus , expressed as:
[0023]
[0024] 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.
[0025] In the image processing step, the image of each overlapping partition is evaluated using a preset image clarity algorithm including:
[0026] 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.
[0027] Preferably, a coding operation including at least three groups of two-dimensional filtering and nonlinear transformation is performed on the coarse equally partitioned image, wherein each group of coding operations outputs an intermediate feature representation of uniform dimension while maintaining the global structure expression of the image;
[0028] 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;
[0029] During the feature extraction process, all output feature maps are standardized to the same spatial resolution and channel structure for cross-region alignment and fusion; the contextual features of coarse or fine equal partitions are called according to the spatial mapping rules, and a composite image representation suitable for subsequent clarity analysis and focus positioning is output.
[0030] Preferably, when extracting the image features of the coarse and fine equally divided areas, a position mapping relationship between the coarse and fine equally divided areas is established according to the image space coordinates, including the following steps:
[0031] Encode the coarse and fine equally partitioned images into intermediate feature representations with the same structural feature dimensions respectively;
[0032] 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;
[0033] When extracting the features of the coarse equal-division image, the features of the edge area of the fine equal-division contained in it are used as auxiliary references to improve the accuracy of the expression of the coarse equal-division features.
[0034] The two feature maps are weightedly fused, and the fusion weight is determined based on the feature reconstruction error or structural similarity.
[0035] Preferably, the coarse equally partitioned images and the fine equally partitioned images are respectively encoded into intermediate feature representations having the same structural feature dimension, specifically including:
[0036] 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:
[0037]
[0038] in, and Respectively represent the feature encoding functions used in the coarse and fine partitioning of the image;
[0039] 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:
[0040]
[0041] in, is the ratio of the sampling step length of the fine partition to the coarse partition, represents the sampling position in the finely divided image, Indicates the corresponding mapping position of the fine equal-area image in the coarse equal-area.
[0042] Preferably, two feature maps are weightedly fused, and the fusion weight is determined based on feature reconstruction error or structural similarity, specifically including:
[0043] 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:
[0044]
[0045] 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 ;
[0046] and Determined in reverse based on the local reconstruction error, it is expressed as:
[0047]
[0048] 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.
[0049] The characteristics Input the image clarity scoring function and draw the corresponding clarity curve to determine the position where the oblique projection image intersects the focal plane.
[0050] The beneficial effect of the present invention is that: the present invention adds a beam splitter to the main optical path imaging system, adds a conjugate lens group on one side, the marker and the lighting 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 surface through the conjugate lens group, the beam splitter and the lens group, so that the photosensitive chip of the main light path digital camera obtains the image on the object surface with the characteristics of the marker, and then the acquired digital image is partitioned and processed by the preset algorithm. The image clarity is obtained by the preset algorithm, and the clear point is determined. The horizontal plane where the clear point is located is the ideal focal plane. The vertical distance between the ideal focal plane and the projection vertex is obtained by calculation, and the ideal focal plane position 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 multiple focal plane images and compare the clarity frame by frame, the present invention can obtain the information of the intersection of the entire oblique projection and the focal plane through a single image acquisition; through the peak analysis of the clarity curve, the focal plane can be quickly located, which significantly shortens the focusing time and improves work efficiency. The present invention enhances the structural information of the object under test in the imaging image by projecting an inclined marker pattern with image features on the object surface; even if the object itself has no obvious texture or edge features, stable clarity evaluation can be achieved to complete the focus; it effectively breaks through the limitation of the traditional focusing system's strong dependence on the surface features of the object, and has stronger adaptability.
[0052] The overlapping partitioning method is adopted to take into account both the amount of image information and the focus detection accuracy; in particular, the overlapping partitioning design improves the accuracy of boundary area clarity assessment through a cross-scale feature fusion mechanism, ensuring that the image clarity assessment is stable and anti-interference in the full field of view.
[0053] The system uses a conjugate lens group and a beam splitter to construct an auxiliary optical path without affecting the main imaging channel; the projection system and the imaging system share some optical path components, making the structure more compact and easy to integrate; it is suitable for highly integrated application scenarios such as embedded optical detection modules, automatic focusing devices, and microscopic imagers. The projection tilt angle and magnification parameters can be pre-calibrated, and combined with the clarity scoring model, a focus control closed loop can be quickly formed; the image clarity algorithm is flexible. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the present invention will be further described below in conjunction with the accompanying drawings and embodiments. The drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work:
[0055] Figure 1 It is a structural schematic diagram of a focal plane detection system of a preferred embodiment of the present invention;
[0056] Figure 2 is a clarity curve diagram of a focal plane detection method of 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 of a preferred embodiment of the present invention;
[0058] Figure 4 It is a schematic diagram of the overlapping partitioning principle of a focal plane detection method according to a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0059] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the following will be described clearly and completely in combination with the technical solution in the embodiments of the present invention. Obviously, the described embodiments are partial embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the protection scope of the present invention.
[0060] The focal plane detection system of the preferred embodiment of the present invention is as follows Figure 1 As shown, it includes a first lens group 1 (i.e., an objective lens), a beam splitter 2, a focal plane detection module, a second lens group 6 (i.e., a tube lens), and a digital camera photosensitive chip 7, and the focal plane detection module includes 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 light path to collect image information of the object surface;
[0061] The beam splitter 2 is disposed 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;
[0062] 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;
[0063] The marker 4 is arranged on the outgoing light path of the illumination condenser 5 and is tilted at an angle Arranged to form an oblique projection image having image characteristics in a projection light path;
[0064] The illumination condenser 5 is used to irradiate the light source onto the marker 4 to form an optical projection, and the image of the marker 4 is projected onto the object surface through the conjugate lens group 3 and the beam splitter 2;
[0065] The digital camera photosensitive chip 7 is used to receive the image signal transmitted by the main light path and form a digital image.
[0066] The principle of the focal plane detection method of the present invention is: insert a beam splitter into an imaging system composed of an object plane, a first lens group, a second lens group, and an image plane, and introduce a 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 object plane and the marker projection imaging plane are conjugate; the marker is placed in front of the illumination condenser and tilted, and the tilt angle is ; The marker is a differentiation plate with certain image characteristics.
[0067] In summary, the object plane, image plane and marker are conjugate to each other.
[0068] The present invention adds a beam splitter to the main optical path imaging system, adds a conjugate lens group on one side, and the marker and the lighting system form a projection optical path. 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 surface through the conjugate lens group, the beam splitter and the first lens group, so that the image on the object surface obtained by the photosensitive chip of the main light path digital camera has the characteristics of the marker, and then the acquired digital image is partitioned and digital image processing is performed, the image clarity 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, and the vertical distance between the ideal focal plane and the projection vertex is obtained by calculation, the ideal focal plane position 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 follows Figure 1-4 As shown, based on the previous embodiment, the following steps are included:
[0070] Projection step: the illumination condenser 5 focuses the light to illuminate the obliquely arranged marker 4; the image of the marker 4 is projected onto the object surface through the conjugate lens group 3 and the beam splitter 2 to form an oblique projection image;
[0071] Image acquisition step: the light reflected from the object surface is collected by the first lens group 1, passed through the beam splitter 2 and introduced into the second lens group 6, and finally imaged on the digital camera photosensitive chip 7;
[0072] Partition processing step: perform regional segmentation on the digital image projected onto the digital camera photosensitive chip 7, wherein the multiple regions segmented are coarse equal partitions or fine equal partitions, wherein the coarse equal partition is larger than the fine equal partition; and obtain 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 area and part of the fine equal partition area; after the regional segmentation, the digital image has both coarse equal partitions and fine equal partitions, and the coarse equal partitions and the fine equal partitions are distributed at intervals;
[0073] 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, which is the position corresponding to the maximum clarity of the projected image; calculate the defocus amount 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, and adjust the lens according to the defocus amount.
[0074] Traditional passive autofocus requires collecting multiple parallel plane images before and after the focal plane, and it takes a long time to determine the focal plane. Therefore, in this patent, the marker is tilted to obtain the tilted projected image, and the intersection information of multiple parallel planes before and after the focal plane and the projection image is obtained through one image acquisition, thereby reducing the number of image acquisition times. In addition, there is only one intersection position between the focal plane and the tilted projection image, so the image intersection position is clear, and the intersection positions of other projection images with the focal plane before and after are all in a defocused state. Figure 2 The clarity curve is drawn after the clarity analysis of the collected image. The peak position S of the curve is the intersection of the inclined projection and the focal plane, so the position of point S is the clarity point.
[0075] Traditional passive autofocus evaluates clarity by collecting image information of the object or object surface, analyzing the contrast or sharpness of the image, and determining the focal plane to achieve autofocus. The collected image needs to have a certain amount of information. If the object surface or the object to be measured itself has too little information, resulting in insufficient information in the collected image, it will be difficult to achieve autofocus. The present invention introduces a focal plane detection module. The focal plane detection module enriches the features of the object surface by projecting a marker, allowing the collected image to contain more information. Even if the object surface or the object to be measured itself has no features, autofocus can be achieved.
[0076] When performing digital image processing, the acquired image is partitioned. The acquired digital image is partitioned, and the partitioning is performed by a coarse equal division method. This partitioning method has a small number of sampling points, a long sampling step, and a short sampling time. This method has a lot of image information in each partition, but the focusing accuracy is insufficient; if the partitioning method is fine equal division, this partitioning method has a large number of sampling points, a short sampling step, and a long sampling time. This partitioning method has high focusing accuracy, but each partition cannot contain enough image information. The present invention adopts Figure 4 The overlapping partitioning method shown ( Figure 4 In the figure, S1, S2 and S3 all represent overlapping partitions), and the fine partitions are expanded and overlapped with each other to produce overlapping partitions, so that the partitions have sufficient image information and sufficient focusing accuracy.
[0077] In the image processing step of this embodiment, in the image processing step, the step of calculating the defocus amount includes:
[0078] First, calculate the tangent of the inclination angle of the projected image relative to the horizontal plane , expressed as:
[0079]
[0080] in, is the inclination 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; It is the inclination angle of the projected image relative to the horizontal plane.
[0081] Then calculate the defocus , expressed as:
[0082]
[0083] 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.
[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 features of the marker. The light reflected by the object with the projection features of the marker enters the second lens group through the first lens group and the beam splitter, and is finally imaged onto the photosensitive chip of the digital camera. The clarity analysis of the collected digital image can obtain the position with the highest clarity, such as Figure 3 Observe the vertical focal plane direction, the intersection point S of the projected image and the focal plane is a clear image point, according to the tilt angle of the tilt marker The tilt angle of the projected image relative to the horizontal plane The relationship between the magnification of the focal plane detection module is: , we can get the tangent value of the projected image relative to the object plane The horizontal distance between the sharp point and the vertex of the projected image can be obtained by measurement and is defined as At this time, the defocus value can be obtained according to the trigonometric function relationship , specifically , and then determine the focal plane to achieve autofocus.
[0085] In this embodiment, 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.
[0086] In the image processing step of this embodiment, evaluating the image of each overlapping partition using a preset image clarity algorithm includes:
[0087] 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.
[0088] In this embodiment, a coding operation including at least three groups of two-dimensional filtering and nonlinear transformation is performed on the coarse equally partitioned image, wherein each group of coding operations outputs an intermediate feature representation of uniform dimension while maintaining the global structure expression of the image;
[0089] 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;
[0090] During the feature extraction process, all output feature maps are standardized to the same spatial resolution and channel structure for cross-region alignment and fusion; the contextual features of coarse or fine equal partitions are called according to the spatial mapping rules, and a composite image representation suitable for subsequent clarity analysis and focus positioning is output.
[0091] Performing encoding operations on fine and equally partitioned images, focusing 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, a detail enhancement mechanism and an edge stabilization mechanism, wherein the small-size convolution operation (preferably 3×3 in this embodiment) is used to capture fine local features; the detail enhancement mechanism includes edge enhancement filters, local contrast enhancement, local gradient enhancement and other methods to enhance edge response; the edge stabilization mechanism includes cross-frame edge consistency constraints or noise suppression modules to enhance the robustness of the boundary area;
[0092] To ensure that the feature representations output by the coarse and fine partitions can be aligned and fused, this embodiment standardizes all feature maps: first, all feature maps are adjusted to a uniform spatial resolution (consistent with the image size output by the photosensitive chip) through interpolation or deconvolution; then the number of feature channels is unified (all 64 dimensions or 128 dimensions) to facilitate feature fusion and calculation; finally, L2 normalization is used and normalized to the interval [0,1] to ensure the comparability of features from different sources on a numerical scale.
[0093] In this embodiment, when extracting the image features of the coarse and fine equally divided areas, a position mapping relationship between the coarse and fine equally divided areas is established according to the image space coordinates, including the following steps:
[0094] Encode the coarse and fine equally partitioned images into intermediate feature representations with the same structural feature dimensions respectively;
[0095] 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;
[0096] When extracting the features of the coarse equal-division image, the features of the edge area of the fine equal-division contained in it are used as auxiliary references to improve the accuracy of the expression of the coarse equal-division features.
[0097] The two feature maps are weightedly fused, and the fusion weight is determined based on the feature reconstruction error or structural similarity.
[0098] In this embodiment, the coarse equally partitioned images and the fine equally partitioned images are respectively encoded into intermediate feature representations having the same structural feature dimension, specifically including:
[0099] 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:
[0100]
[0101] in, and Respectively represent the feature encoding functions used in the coarse and fine partitioning of the image;
[0102] 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:
[0103]
[0104] in, is the ratio of the sampling step length of the fine partition to the coarse partition, represents the sampling position in the finely divided image, Indicates the corresponding mapping position of the fine equal-area image in the coarse equal-area.
[0105] In this embodiment, two feature maps are weightedly fused, and the fusion weight is determined based on feature reconstruction error or structural similarity, specifically including:
[0106] 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:
[0107]
[0108] 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 ;
[0109] and Determined in reverse based on the local reconstruction error, it is expressed as:
[0110]
[0111] 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.
[0112] The characteristics Input the image clarity scoring function and draw the corresponding clarity curve to determine the position where the oblique projection image intersects the focal plane.
[0113] The present invention constructs feature extraction pathways for coarse and fine partitions respectively, so that the system can simultaneously capture the global structural features and local texture details of the image, thereby ensuring the robustness of focus while improving the resolution accuracy of focal plane positioning. By establishing a spatial mapping relationship between coarse and fine partitions and performing contextual references during the feature extraction process, the stability of the image boundary area is improved, and the information loss problem caused by the segmentation of the regional boundary is suppressed. This solution uses feature standardization processing to make the coarse and fine partition features have consistent spatial dimensions and channel structures, ensuring the efficient fusion of images of different scales in overlapping areas, and providing a unified feature input basis for clarity scoring and focal plane calculation. Using reconstruction error or structural consistency scoring as the basis for fusion weights, it is possible to dynamically adjust the feature weight distribution according to the actual reconstruction quality of the image, and enhance the recognition accuracy of the intersection of the focal plane of the projection image in the overlapping partitions. By fusing the image scoring results driven by features, the present invention can output a continuous change curve of clarity, and accurately calculate the focal plane deviation by combining the inclination of the projection image and the horizontal displacement of the clear point, thereby realizing automatic focusing control. The present invention relies on the structural projection mechanism of the tilted marker pattern, and can introduce effective image features even in a textureless or low-contrast background, ensuring that the system can complete focal plane detection and focusing operations, and improving the universality of the system. The feature encoding, spatial mapping, and fusion strategies involved in this solution are all computational processes that can be implemented modularly, and are suitable for embedded operation 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 intersection of the entire oblique projection and the focal plane through a single image acquisition; through the peak analysis of the clarity curve, the focal plane can be quickly located, which significantly shortens the focusing time and improves work efficiency. The present invention enhances the structural information of the object under test in the imaging image by projecting an inclined marker pattern with image features on the object surface; even if the object itself has no obvious texture or edge features, stable clarity evaluation can be achieved to complete the focus; it effectively breaks through the limitation of the traditional focusing system's strong dependence on the surface features of the object, and has stronger adaptability.
[0115] The overlapping partitioning method is adopted to take into account both the amount of image information and the focus detection accuracy; in particular, the overlapping partitioning design improves the accuracy of boundary area clarity assessment through a cross-scale feature fusion mechanism, ensuring that the image clarity assessment is stable and anti-interference in the full 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, and the structure is more compact and easy to integrate; it is suitable for highly integrated application scenarios such as embedded optical detection modules, automatic focusing devices, and microscopic imagers. The image clarity 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. The vertical distance between the ideal focal plane and the projection vertex is obtained by calculation, and the ideal focal plane position is quickly obtained, which shortens the focal plane detection time and improves the focusing speed. The projection angle and magnification parameters can be pre-calibrated, and combined with the clarity scoring model, a focus control closed loop can be quickly formed.
[0117] It should be understood that those skilled in the art can make improvements or changes based on the above description, and all these improvements and changes should fall within the scope of protection 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.
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 sampling position in the finely divided image, Indicates the corresponding mapping position of the fine equal-area image in the coarse equal-area.
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
Multichannel conjugate narrowband differential microscopy automatic focusing device and method
CN111220069A
Parallel light beam debugging detection tool and parallel light beam debugging detection method
CN116296272A
Cited By
Dynamic focusing method and system based on light spot image and medium
CN120762189A