Method and system for testing optical center deviation of zoom camera
By setting a calibration plate below the camera and capturing images at different magnifications, the distance deviation between the lens light center and the CCD sensor center is solved, and the image position offset in a high-power zoom camera is improved, and the optical performance of the camera is improved.
Patent Information
- Application Number
- CN202411802608.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-02-18
AI Technical Summary
During the assembly process of a high-power zoom camera, the lens center is inconsistent with the center of the CCD sensor due to process deviation, resulting in image position offset and affecting the image acquisition effect.
By setting the calibration plate below the camera, the center of the camera coincides with the center of the field of view, the standard circle on the calibration plate is used to collect images at different magnifications, perform threshold segmentation, circular area extraction and superposition, calculate the center of the circle and fit the straight line , obtain the maximum pixel offset of the optical center and the distance deviation of the lens optical center relative to the center of the CCD sensor.
The distance deviation between the optical center of the lens group and the center of the CCD sensor is calculated, which facilitates deviation compensation during camera assembly and lens processing, and improves the optical performance of the camera.
Smart Images

Figure CN119469685A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of camera compensation, and in particular to a method and system for testing optical center deviation of a variable magnification and zoom camera. Background Art
[0002] During the assembly process of a high-magnification zoom camera, due to factors such as deviations in the manufacturing process of the camera lens or deviations in the assembly process of the camera, the optical center of the lens and the center of the CCD sensor are not on the same axis, resulting in the position of the object in the captured image being offset when the zoom camera performs high and low magnification imaging while maintaining a constant relative position with the object being photographed, thus affecting the imaging effect. Summary of the invention
[0003] The technical problem to be solved by the embodiments of the present application is to avoid the position of the object in the captured image from being offset during high and low magnification imaging, thereby affecting the imaging effect. The purpose of the embodiments of the present invention is to provide a method for calculating the distance deviation between the optical center of the lens group and the center of the CCD sensor, thereby facilitating deviation compensation and improvement during camera assembly and lens processing, thereby improving the optical performance of the camera.
[0004] A first aspect of the present invention provides a method for testing the optical center deviation of a variable magnification and zoom camera, the method comprising: A calibration plate is arranged under the camera so that the center of the calibration plate coincides with the center of the camera field of view; the camera field of view is the field of view when the camera is fixed and its magnification is adjusted to the maximum; the calibration plate includes a predetermined number of standard circles; The camera is switched from high magnification to low magnification in a predetermined step-by-step manner, and first images at corresponding magnifications are respectively acquired to generate a first image sequence; wherein each first image corresponds to a magnification; Perform threshold segmentation on each first image, extract circular areas located at four corners of each first image, and generate a second image sequence; Superimposing the circular areas at the four corners corresponding to each second image in the second image sequence to generate a third image; Calculate the center of the circular area in the third image, and sequentially connect the centers of circles at the same position with different magnifications and fit them into a straight line; fit the centers of all circular areas into a straight line, and obtain the coordinates of the intersections between the straight lines; Based on the intersection coordinates and the center coordinates of the first image, the maximum pixel offset of the optical center within the corresponding magnification range of the first image and the distance deviation of the lens optical center relative to the center of the CCD sensor are determined.
[0005] Further, determining the maximum pixel offset of the optical center within the corresponding magnification range of the first image based on the intersection coordinates and the center coordinates of the first image includes: Calculate the mean value of all intersection coordinates to obtain the mean intersection coordinates; calculate the center coordinates of the first image; Subtract the mean intersection coordinates from the center coordinates of the first image to obtain the maximum pixel offset of the optical center within this magnification range; Multiply the maximum pixel offset by the physical size of each pixel of the CCD sensor to obtain the physical size offset of the lens optical center relative to the center of the CCD sensor within this magnification range.
[0006] Furthermore, the calibration plate includes N*N standard circles; The threshold segmentation of each first image, extracting the circular regions located at the four corners of each first image, and generating a second image sequence, includes: Perform image gray-scale threshold segmentation on the first image based on the OTSU algorithm, and perform screening to determine the circular regions corresponding to the standard circles; Sort the circular regions in ascending order according to the column coordinates corresponding to each region; then sort them in ascending order according to the row coordinates, so as to extract the M*M circular regions at the four corners and generate a second image; where M < N / 2; N represents the number of horizontal and vertical circles in the standard circle array of the calibration plate; M represents the number of horizontal and vertical circles in the circular region array at the four corners.
[0007] Furthermore, the calculation of the centers of the circular regions in the third image, and connecting the centers of the circles at the same position with different magnifications in sequence and fitting them into a straight line, includes: Obtain the center coordinates of the circles of the circular regions at the same position under different magnifications, connect the center coordinates one by one into a line, and then fit them into a straight line using the weighted least squares method.
[0008] The second aspect of the present invention provides a test system for the optical center deviation of a varifocal zoom camera, and the system includes a setting module, a collection module, a segmentation module, a superposition module, a fitting module, and a determination module; The setting module is used to set the calibration plate under the camera so that the center of the calibration plate coincides with the center of the camera field of view; the camera field of view is the field of view when the camera is fixed and its magnification is adjusted to the maximum; the calibration plate includes a predetermined number of standard circles; The collection module is used to switch the camera step by step from high magnification to low magnification, and respectively collect the first images at the corresponding magnifications to generate a first image sequence; where each first image corresponds to a magnification; The segmentation module is used to perform threshold segmentation on each first image, extract the circular regions located at the four corners of each first image, and generate a second image sequence; The superimposing module is used to superimpose the circular regions at the four corners corresponding to each second image in the second image sequence to generate a third image; The fitting module is used to calculate the centers of the circular regions in the third image, connect the centers of the circles at the same position with different magnifications in sequence and fit them into a straight line; fit the centers of all circular regions into straight lines to obtain the intersection coordinates between the straight lines; The determining module is used to determine the maximum pixel offset of the optical center within the magnification range corresponding to the first image and the distance deviation of the lens optical center relative to the center of the CCD sensor based on the intersection coordinates and the center coordinates of the first image.
[0009] Further, in the determining module, determining the maximum pixel offset of the optical center within the magnification range corresponding to the first image based on the intersection coordinates and the center coordinates of the first image includes: Perform a mean value calculation on all intersection coordinates to obtain the intersection mean coordinates; calculate the center coordinates of the first image; Subtract the intersection mean coordinates from the center coordinates of the first image to obtain the maximum pixel offset of the optical center within this magnification range; Multiply the maximum pixel offset by the physical size of each pixel of the CCD sensor to obtain the physical size offset of the lens optical center relative to the center of the CCD sensor within this magnification range.
[0010] Further, the calibration plate includes N*N standard circles; In the segmentation module, performing threshold segmentation on each first image, extracting the circular regions located at the four corners of each first image, and generating a second image sequence includes: Perform image gray-level threshold segmentation on the first image based on the OTSU algorithm and perform screening to determine the circular regions corresponding to the standard circles; Sort the circular regions in ascending order according to the column coordinates corresponding to each region; then sort them in ascending order according to the row coordinates to extract the M*M circular regions at the four corners and generate a second image; where M < N / 2; N represents the number of horizontal and vertical circles in the standard circle array of the calibration plate; M represents the number of horizontal and vertical circles in the circular region array at the four corners.
[0011] Further, in the fitting module, calculating the centers of the circular regions in the third image, connecting the centers of the circles at the same position with different magnifications in sequence and fitting them into a straight line includes: Obtain the center coordinates of the circles of each circular region at the same position under different magnifications, connect the center coordinates one by one into a line, and then fit them into a straight line using the weighted least squares method.
[0012] In addition, the third aspect of the present invention provides an electronic device, which includes: one or more processors, and a memory, wherein the memory is used to store one or more computer programs; the computer program is configured to be executed by the one or more processors, and the program includes steps for executing the test method for the optical center deviation of a variable magnification and zoom camera as described in the first aspect.
[0013] In addition, a fourth aspect of the present invention provides a storage medium storing a computer program; the program is loaded and executed by a processor to implement the steps of the test method for the optical center deviation of a variable magnification and zoom camera as described in the first aspect above.
[0014] In the scheme of the present invention, a calibration plate is arranged below the camera so that the center of the calibration plate coincides with the center of the camera field of view; the camera field of view is the field of view when the camera is fixed and its magnification is adjusted to the maximum; the calibration plate includes a predetermined number of standard circles; the camera is switched from high magnification to low magnification in a predetermined step-by-step manner, and first images at corresponding magnifications are respectively acquired to generate a first image sequence; wherein each first image corresponds to a magnification; each first image is threshold segmented, the circular areas at the four corners of each first image are extracted, and a second image sequence is generated; the circular areas at the four corners corresponding to each second image in the second image sequence are superimposed to generate a third image; the center of the circular area in the third image is calculated, and the centers of circles at the same position with different magnifications are sequentially connected and fitted into straight lines; the centers of all circular areas are fitted into straight lines, and the coordinates of the intersections between the straight lines are obtained; based on the intersection coordinates and the center coordinates of the first image, the maximum pixel offset of the optical center within the corresponding magnification range of the first image and the distance deviation of the lens optical center relative to the center of the CCD sensor are determined. Compared with the prior art, the embodiments of the present application have the following main beneficial effects: by calculating the distance deviation between the optical center of the lens group and the center of the CCD sensor, it is convenient to compensate and improve the deviation during camera assembly and lens processing, thereby improving the optical performance of the camera. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0016] Figure 1 It is a schematic diagram of the center offset of the prior art disclosed in the embodiment of the present invention; Figure 2 It is a flow chart of a method for testing optical center deviation of a variable magnification and zoom camera disclosed in an embodiment of the present invention; Figure 3 It is a schematic diagram of the coincidence of the center of the calibration plate and the center of the camera field of view disclosed in an embodiment of the present invention; Figure 4 is a schematic diagram of four zoom images disclosed in an embodiment of the present invention; Figure 5 The embodiment of the present invention discloses Figure 4 Schematic diagram of the circular area extraction of the corresponding four zoom images; Figure 6 is a schematic diagram of a circular area after sorting disclosed in an embodiment of the present invention; Figure 7 is a schematic diagram after filtering the circular areas at four corners according to an embodiment of the present invention; Figure 8 It is a schematic diagram of circles of different sizes segmented from all images disclosed in the embodiments of the present invention being grouped together; Fig. 9 (a) is a schematic diagram of different circles of a circular area disclosed in an embodiment of the present invention at different magnifications; Fig. 9 (b) is disclosed in the embodiment of the present invention Fig. 9 (a) Schematic diagram of the corresponding fitted straight line; Fig.10 It is a schematic diagram of circles of different magnifications disclosed in an embodiment of the present invention connected and fitted into an optimal straight line; Fig.11 It is a schematic diagram of the intersection mean coordinates and the image center coordinates disclosed in an embodiment of the present invention. DETAILED DESCRIPTION
[0017] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of this application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of this application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0018] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0019] It should be noted that the “plurality” mentioned in this article refers to two or more.
[0020] The implementation details of the technical solution of the embodiment of the present application are described in detail below: like Figure 1 The figure is a schematic diagram of the center offset of the prior art of this example. In the field of view with a large magnification, the center of the square object is aligned with the center of the camera image. When the magnification is reduced, the center of the object and the center of the camera image are offset. The red circle is the center of the object, and the white circle is the center of the image (the center of the CCD sensor).
[0021] This embodiment is a testing method for the optical center deviation of a zoom camera, which calculates the distance deviation between the optical center of the lens group and the center of the CCD sensor, thereby facilitating deviation compensation and improvement during camera assembly and lens processing, thereby improving the optical performance of the camera.
[0022] A first aspect of this embodiment provides a method for testing the optical center deviation of a zoom camera. Figure 2 , is a flow chart of a method for testing the optical center deviation of a zoom camera according to this embodiment. The method comprises: S201, setting a calibration plate under the camera so that the center of the calibration plate coincides with the center of the camera field of view; the camera field of view is the field of view when the camera is fixed and its magnification is adjusted to the maximum; the calibration plate includes a predetermined number of standard circles; Specifically, in this embodiment, the high-power camera is fixed and the magnification is adjusted to the maximum. A calibration plate with N*N standard circles is taken, and a 7*7 calibration plate is taken as an example. It is placed under the camera so that the center of the calibration plate coincides with the center of the camera field of view (image center). Figure 3 The diagram is a schematic diagram showing the coincidence of the center of the calibration plate and the center of the camera field of view in this embodiment.
[0023] S202, switching the camera from high magnification to low magnification in a predetermined stepwise manner, and respectively acquiring first images at corresponding magnifications to generate a first image sequence; wherein each first image corresponds to a magnification; Specifically, in this embodiment, the camera is switched from high magnification to low magnification in a certain step-by-step manner, and images at corresponding magnifications (i.e., the first image) are collected. The relative position of the camera and the calibration plate is always kept unchanged during the switching process. Figure 4 Shown is a schematic diagram of four zoom images according to this embodiment.
[0024] S203, performing threshold segmentation on each first image, extracting circular areas located at four corners of each first image, and generating a second image sequence; Threshold segmenting each first image, extracting the circular regions located at the four corners of each first image, and generating a second image sequence, including: Performing image grayscale threshold segmentation on the first image based on the OTSU algorithm, and performing screening to determine the circular region corresponding to the standard circle; Sorting the circular regions in ascending order according to the column coordinates corresponding to each region; then sorting in ascending order according to the row coordinates, so as to extract the M*M circular regions at the four corners and generate a second image; where M < N / 2; N represents the number of horizontal and vertical circles in the standard circle array of the calibration board; M represents the number of horizontal and vertical circles in the circular region array at the four corners.
[0025] Specifically, in this embodiment, threshold segmenting the above four zoom images, and extracting the 3*3 circular regions at the four corners. As Figure 5 shown in this embodiment for Figure 4 the corresponding extraction of circular regions of the four zoom images. Among them, the red circular regions are the 3*3 circular regions extracted at the four corners.
[0026] Regarding performing image grayscale threshold segmentation on the first image based on the OTSU algorithm. In this embodiment, taking one of the images as an example, the contrast between the black part and the white part in the image is relatively high. Using the OTSU algorithm to perform image grayscale threshold segmentation on the image or using the absolute threshold segmentation algorithm to segment the pixel part with a gray value lower than a certain gray threshold in the image (the gray range of each pixel in the grayscale image is 0~255). For example, the highest gray value of the black part in the image is 30 and the lowest gray value is 0, then the pixels between the gray values of 0~30 are segmented out, which is the black part in the image. At this time, the segmented black region includes the circular region, the black square region, and the black font region. Since the pixel area and radius or diameter length of each circle in the circular region are basically unchanged, the black region is screened for the regions whose pixel area and radius or diameter length meet a certain range, and then the circular regions can be screened out.
[0027] After screening out the circular regions, since the circular regions are arranged neatly in a matrix, use the sorting algorithm to sort the circular regions in ascending order according to the column coordinates of each region, and then sort in ascending order according to the row coordinates to obtain the sorting order. As Figure 6 shown in this example for the schematic diagram of the sorted circular regions. Then screen the circular regions corresponding to the sorting order, as Figure 7 shown in this example for the schematic diagram after screening the circular regions at the four corners. Figure 7 The red region in
[0028] is the circular region screened at the four corners. Figure 5The present embodiment shown is Figure 4 The corresponding circular area extraction of the four zoom images.
[0029] S204, superimposing the circular areas at the four corners corresponding to each second image in the second image sequence to generate a third image; Specifically, in this embodiment, circles of different sizes segmented from all images are grouped together, such as Figure 8 shown.
[0030] S205, calculating the center of the circular area in the third image, and sequentially connecting the centers of circles at the same position with different magnifications and fitting them into a straight line; fitting the centers of all circular areas into a straight line, and obtaining the coordinates of the intersections between the straight lines; Further, the calculating the center of the circular area in the third image, and sequentially connecting the centers of circles at the same position with different magnifications and fitting them into a straight line, comprises: The center coordinates of the circles of the circular areas at the same position under different magnifications are obtained, the center coordinates are connected into lines one by one, and then fitted into a straight line using the weighted least square method.
[0031] Specifically, in this embodiment, a morphological algorithm is used to find the smallest outer circle of each circular area and the coordinates of its center. For example, the circular area in the first row and third column of the calibration plate is used as an example. Fig. 9 The red boxes in (a) show different circles in the circular area at different magnifications.
[0032] Then find the center coordinates of these circles, connect them one by one, and use the weighted least squares method to fit them into a straight line to exclude abnormal coordinate values, such as Fig. 9 (b) The green line.
[0033] Similarly, connect the circles of other circles with different magnifications on the calibration plate and fit them into the best straight line. Finally, all the straight lines are as follows: Fig.10 .
[0034] Intersect each red line in the second and fourth images with all the green lines in the first and third images, and find the coordinates of all intersection points.
[0035] S206: Determine, based on the intersection coordinates and the center coordinates of the first image, a maximum pixel offset of the optical center within a corresponding magnification range of the first image and a distance deviation of the lens optical center relative to the center of the CCD sensor.
[0036] Further, determining the maximum pixel offset of the optical center within the corresponding magnification range of the first image based on the intersection coordinates and the center coordinates of the first image includes: Calculate the mean of all intersection coordinates to obtain the mean coordinates of the intersections; calculate the center coordinates of the first image; Subtracting the mean coordinates of the intersection points and the center coordinates of the first image to obtain the maximum pixel offset of the optical center within the magnification range; The maximum pixel offset is multiplied by the physical size of each pixel of the CCD sensor to obtain the physical size offset of the optical center of the lens relative to the center of the CCD sensor within the magnification range.
[0037] Specifically, in this embodiment, Fig.11 Schematic diagram of the intersection mean coordinates and image center coordinates of this embodiment is shown. In this embodiment, the mean value of all intersection coordinates is calculated to obtain (x_mean, y_mean), such as Fig.11 The blue point, and then the center coordinates of the image are center_image(x_ center, y_ center), such as Fig.11 Red dot. Subtract the two coordinates to get the maximum pixel offset of the optical center within the magnification range (x_ center - x_mean, y_center - y_mean), then multiply it by the physical size of each pixel of the CCD sensor, and finally get the physical size offset of the lens optical center relative to the center of the CCD sensor within the zoom range, so as to perform assembly deviation compensation correction.
[0038] In this embodiment, the horizontal and vertical coordinates of the intersection points of all the lines obtained above are combined to obtain the average coordinates, x_mean = (x_1+x_2+…+x_n) / n, y_mean = (y_1+y_2+…+y_n) / n.
[0039] The center coordinates of the image are the coordinates of the pixel at the center of the image. If the image is Height pixels high and Width pixels wide, the horizontal coordinates of the center coordinates of the image are x_ center = (Height-1) / 2, and the vertical coordinates are y_center = (Width-1) / 2. The maximum pixel offset of the optical center within the magnification range is (x_ center - x_mean, y_ center - y_mean). Each pixel of the camera's CCD sensor corresponds to each pixel of the image it images. The number of pixels that are offset in the image represents the number of physical pixels that are offset during the CCD assembly process. Each pixel has a fixed physical size. Assuming that the side length of each pixel is L, in mm, the final physical offset of the lens optical center within the zoom range is (x_ center - x_mean)*L in the horizontal direction and (y_ center - y_mean)*L in the vertical direction.
[0040] In summary, in the scheme of this embodiment, a calibration plate is set under the camera so that the center of the calibration plate coincides with the center of the camera field of view; the camera field of view is the field of view when the camera is fixed and its magnification is adjusted to the maximum; the calibration plate includes a predetermined number of standard circles; the camera is switched from high magnification to low magnification in a predetermined step-by-step manner, and first images at corresponding magnifications are respectively acquired to generate a first image sequence; wherein each first image corresponds to a magnification; each first image is threshold segmented, the circular areas at the four corners of each first image are extracted, and a second image sequence is generated; the circular areas at the four corners corresponding to each second image in the second image sequence are superimposed to generate a third image; the center of the circular area in the third image is calculated, and the centers of circles at the same position with different magnifications are sequentially connected and fitted into straight lines; the centers of all circular areas are fitted into straight lines, and the coordinates of the intersections between the straight lines are obtained; based on the intersection coordinates and the center coordinates of the first image, the maximum pixel offset of the optical center within the corresponding magnification range of the first image and the distance deviation of the lens optical center relative to the center of the CCD sensor are determined. Compared with the prior art, the embodiments of the present application have the following main beneficial effects: by calculating the distance deviation between the optical center of the lens group and the center of the CCD sensor, it is convenient to compensate and improve the deviation during camera assembly and lens processing, thereby improving the optical performance of the camera.
[0041] In order to solve the above technical problems, in a second aspect of the present embodiment, a system for testing the optical center deviation of a zoom camera is provided, the system comprising a setting module, a collection module, a segmentation module, a superposition module, a fitting module and a determination module; The setting module is used to set the calibration plate to be placed under the camera so that the center of the calibration plate coincides with the center of the camera field of view; the camera field of view is the field of view when the camera is fixed and its magnification is adjusted to the maximum; the calibration plate includes a predetermined number of standard circles; The acquisition module is used to switch the camera from high magnification to low magnification in a predetermined step-by-step manner, and respectively acquire first images at corresponding magnifications to generate a first image sequence; wherein each first image corresponds to a magnification; The segmentation module is used to perform threshold segmentation on each first image, extract circular areas located at four corners of each first image, and generate a second image sequence; The superposition module is used to superimpose the circular areas on the four corners corresponding to each second image in the second image sequence to generate a third image; The fitting module is used to calculate the center of the circular area in the third image, and sequentially connect the centers of circles at the same position with different magnifications and fit them into a straight line; fit the centers of all circular areas into a straight line, and obtain the coordinates of the intersections between the straight lines; The determining module is configured to determine the maximum pixel offset of the optical center within the magnification range corresponding to the first image and the distance deviation between the lens optical center and the center of the CCD sensor based on the intersection coordinates and the center coordinates of the first image.
[0042] Further, in the determining module, determining the maximum pixel offset of the optical center within the magnification range corresponding to the first image based on the intersection coordinates and the center coordinates of the first image includes: Calculating the mean value of all intersection coordinates to obtain the intersection mean coordinates; calculating the center coordinates of the first image; Subtracting the intersection mean coordinates from the center coordinates of the first image to obtain the maximum pixel offset of the optical center within the magnification range; Multiplying the maximum pixel offset by the physical size of each pixel of the CCD sensor to obtain the physical size offset of the lens optical center relative to the center of the CCD sensor within the magnification range.
[0043] Further, the calibration plate includes N*N standard circles; In the segmentation module, threshold segmentation is performed on each first image, circular regions located at the four corners of each first image are extracted, and a second image sequence is generated, including: Performing image gray-scale threshold segmentation on the first image based on the OTSU algorithm, and performing screening to determine the circular regions corresponding to the standard circles; Sorting the circular regions in ascending order according to the column coordinates corresponding to each region; then sorting them in ascending order according to the row coordinates, so as to extract the M*M circular regions at the four corners to generate a second image; where M < N / 2; N represents the number of horizontal and vertical circles in the standard circle array of the calibration plate; M represents the number of horizontal and vertical circles in the circular region array at the four corners.
[0044] Further, in the fitting module, calculating the centers of the circular regions in the third image, and connecting the centers of the circles at the same position with different magnifications in sequence and fitting them into a straight line, includes: Obtaining the center coordinates of the circles of the circular regions at the same position under different magnifications, connecting the center coordinates one by one into a line, and then fitting them into a straight line using the weighted least squares method.
[0045] In addition, an embodiment of the present application also discloses an electronic device, which includes: one or more processors, a memory, and the memory is used to store one or more computer programs; characterized in that the computer programs are configured to be executed by the one or more processors, and the programs include steps for performing the test method for the optical center deviation of the variable magnification zoom camera as described in the first aspect above.
[0046] In addition, an embodiment of the present application further provides a storage medium storing a computer program; the program is loaded and executed by a processor to implement the steps of the test method for the optical center deviation of a variable magnification and zoom camera as described in the first aspect above.
[0047] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0048] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, or it can be an electrical, mechanical or other form of connection.
[0049] The units described as separate components may or may not be physically separated. As a unit, it can be appreciated by those skilled in the art that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0050] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0051] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a grid device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0052] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for testing the optical center deviation of a zoom camera, characterized in that: The method includes: Setting a calibration board under the camera so that the center of the calibration board coincides with the center of the camera's field of view; the camera's field of view is the field of view when the camera is fixed and its magnification is adjusted to the maximum; the calibration board includes a predetermined number of standard circles; Switching the camera from high magnification to low magnification in a predetermined step progression and respectively collecting first images at corresponding magnifications to generate a first image sequence; wherein, each first image corresponds to a magnification; Performing threshold segmentation on each first image, extracting the circular regions located at the four corners of each first image, and generating a second image sequence; Superimposing the circular regions at the four corners corresponding to each second image in the second image sequence to generate a third image; Calculating the centers of the circular regions in the third image, connecting the centers of the circles at the same position with different magnifications in sequence and fitting them into a straight line; fitting the centers of all circular regions into straight lines to obtain the intersection coordinates between the straight lines; Based on the intersection coordinates and the center coordinates of the first image, determining the maximum pixel offset of the optical center within the magnification range corresponding to the first image and the distance deviation of the lens optical center relative to the center of the CCD sensor.
2. The method for testing the optical center deviation of a zoom camera according to claim 1, characterized in that: The determining the maximum pixel offset of the optical center within the magnification range corresponding to the first image based on the intersection coordinates and the center coordinates of the first image includes: Performing a mean value calculation on all intersection coordinates to obtain the mean intersection coordinates; calculating the center coordinates of the first image; Subtracting the mean intersection coordinates from the center coordinates of the first image to obtain the maximum pixel offset of the optical center within this magnification range; Multiplying the maximum pixel offset by the physical size of each pixel of the CCD sensor to obtain the physical size offset of the lens optical center relative to the center of the CCD sensor within this magnification range.
3. The method for testing the optical center deviation of a zoom camera according to claim 2, characterized in that: The calibration board includes N*N standard circles; The performing threshold segmentation on each first image, extracting the circular regions located at the four corners of each first image, and generating a second image sequence includes: Performing image gray-level threshold segmentation on the first image based on the OTSU algorithm and performing screening to determine the circular regions corresponding to the standard circles; Sorting the circular regions in ascending order according to the column coordinates corresponding to each region; then sorting them in ascending order according to the row coordinates to extract the M*M circular regions at the four corners and generating a second image; wherein, M < N / 2; N represents the number of horizontal and vertical circles in the standard circle array of the calibration board; M represents the number of horizontal and vertical circles in the circular region array at the four corners.
4. The method for testing the optical center deviation of a zoom camera according to claim 3, characterized in that: The calculating the centers of the circular regions in the third image, connecting the centers of the circles at the same position with different magnifications in sequence and fitting them into a straight line includes: Obtaining the center coordinates of the circles of each circular region at the same position under different magnifications, connecting the center coordinates one by one into a line, and then fitting them into a straight line using the weighted least squares method.
5. A test system for optical center deviation of a zoom camera, characterized in that: The system includes a setting module, a collecting module, a segmentation module, a superimposing module, a fitting module, and a determining module; The setting module is used to set the calibration board under the camera so that the center of the calibration board coincides with the center of the camera's field of view; the camera's field of view is the field of view when the camera is fixed and its magnification is adjusted to the maximum; the calibration board includes a predetermined number of standard circles; The acquisition module is used to switch the camera from high magnification to low magnification step by step in a predetermined manner and respectively acquire the first images at the corresponding magnifications to generate a first image sequence; wherein, each first image corresponds to a magnification; The segmentation module is used to perform threshold segmentation on each first image, extract the circular regions located at the four corners of each first image, and generate a second image sequence; The superimposing module is used to superimpose the circular regions at the four corners corresponding to each second image in the second image sequence to generate a third image; The fitting module is used to calculate the center of the circular region in the third image, connect the centers of the circles at the same position with different magnifications in sequence and fit them into a straight line; fit the centers of all circular regions into straight lines to obtain the intersection coordinates between the straight lines; The determination module is used to determine the maximum pixel offset of the optical center within the magnification range corresponding to the first image and the distance deviation of the lens optical center relative to the center of the CCD sensor based on the intersection coordinates and the center coordinates of the first image.
6. The optical center deviation test system for a zoom camera according to claim 5, characterized in that: In the determination module, based on the intersection coordinates and the center coordinates of the first image, determining the maximum pixel offset of the optical center within the magnification range corresponding to the first image includes: Performing a mean value calculation on all the intersection coordinates to obtain the intersection mean coordinates; calculating the center coordinates of the first image; Subtracting the intersection mean coordinates from the center coordinates of the first image to obtain the maximum pixel offset of the optical center within this magnification range; Multiplying the maximum pixel offset by the physical size of each pixel of the CCD sensor to obtain the physical size offset of the lens optical center relative to the center of the CCD sensor within this magnification range.
7. The optical center deviation test system for a zoom camera according to claim 6, characterized in that: The calibration board includes N*N standard circles; In the segmentation module, performing threshold segmentation on each first image, extracting the circular regions located at the four corners of each first image, and generating a second image sequence includes: Performing image gray-scale threshold segmentation on the first image based on the OTSU algorithm and performing screening to determine the circular regions corresponding to the standard circles; Sorting the circular regions in ascending order according to the column coordinates corresponding to each region; then sorting them in ascending order according to the row coordinates to extract the M*M circular regions at the four corners to generate a second image; wherein, M < N / 2; N represents the number of horizontal and vertical circles in the standard circle array of the calibration board; M represents the number of horizontal and vertical circles in the circular region array at the four corners.
8. The optical center deviation test system for a zoom camera according to claim 7, characterized in that: In the fitting module, calculating the center of the circular region in the third image, connecting the centers of the circles at the same position with different magnifications in sequence and fitting them into a straight line includes: Obtaining the center coordinates of the circles of each circular region at the same position under different magnifications, connecting the center coordinates one by one into a line, and then fitting them into a straight line using the weighted least squares method.
9. An electronic device, comprising: One or more processors, a memory, wherein the memory is used to store one or more computer programs; characterized in that the computer program is configured to be executed by the one or more processors, and the program includes steps for executing the test method for the optical center deviation of a variable magnification and zoom camera as described in any one of claims 1-4.
10. A storage medium storing a computer program; the program is loaded and executed by a processor to implement the steps of the method for testing the optical center deviation of a zoom camera according to any one of claims 1 to 4.
Citation Information
Cited By
Calibration method of synchrotron radiation micro-focusing experimental device
CN120102605A