Method and device for dynamically adjusting drawing and electronic equipment
By adding mark points during the camera module detection process and performing image analysis, determining and compensating the offset of the test drawings, the problem of image displacement in telephoto camera module detection is solved, and the accuracy and efficiency of detection are improved.
Patent Information
- Application Number
- CN202411916271.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-03-28
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
During the telephoto camera module detection process, the slight shaking of the test drawings and the production tolerance of the module fixtures lead to large displacement on the image, affecting the detection effect.
By adding four mark points to the predetermined field of view of the test drawing, the image is captured using the camera module, the offset in the x, y and r directions is determined according to the mark points, and the stage motor is compensated until the offset is less than the preset threshold, dynamic adjustment and three-dimensional correction of the drawing are achieved.
It effectively solves the problem of test drawing displacement, ensures the accuracy and efficiency of camera module detection, and ensures the reliability of test results.
Smart Images

Figure CN119728956A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of camera module detection, and in particular to a method, device and electronic equipment for dynamically adjusting drawings. Background Art
[0002] The longer the focal length of the lens, the smaller the field of view. When testing a telephoto camera module, any slight shake of the test drawing or module will be magnified on the module image.
[0003] Since the manufacturing tolerance of the module fixture (device that fixes the module) is ±0.05mm, there is a 0.1mm deviation in the position of each module placement, which is equivalent to a large displacement of the drawing on the image. This deviation will make some tests impossible to perform, so it is necessary to develop a solution that can dynamically adjust the drawing during the inspection process. Summary of the invention
[0004] The technical problem to be solved by the embodiments of the present application is to dynamically adjust the drawing during the detection process to achieve three-dimensional correction of the test drawing and ensure the detection effect of the camera module. The purpose of the embodiments of the present invention is to provide a solution that can dynamically adjust the deviation rate of the test drawing x (horizontal), y (vertical) and r (rotation angle) to ensure the detection effect of the camera module.
[0005] A first aspect of the present invention provides a method for dynamically adjusting drawings, which is applied to camera module testing, and the method comprises:
[0006] Add four mark points at the positions of the predetermined field of view of the current test drawing, and the intersection of the diagonal lines of the mark points is located at the center of the test drawing;
[0007] The image corresponding to the test drawing is captured by the camera module, and the offsets in the x, y and r directions relative to the center of the field of view are determined according to the four marks; wherein the x direction is the left-right direction, the y direction is the up-down direction, and the r direction is the rotation angle direction with the center as the origin;
[0008] If the offsets in the x, y and r directions relative to the center of the field of view are all less than the preset offset threshold, the corresponding camera module test item is executed.
[0009] Further, adding four mark points at the positions of the predetermined field of view of the current test drawing includes: adding four mark points at the positions of the 0.9 degree field of view angle of the drawing;
[0010] Before capturing an image corresponding to the test drawing according to the camera module, the method further includes:
[0011] Build the test environment required for the current camera module test item; the test environment includes the location of the test drawing and the color temperature setting of the white field or black field.
[0012] The step of photographing an image corresponding to the test drawing according to the camera module and determining the offsets of the x, y and r directions relative to the center of the field of view according to the four marks includes:
[0013] Placing the test drawing at the center of the camera module's field of view and capturing a first image;
[0014] Processing the first image according to an image segmentation algorithm, determining the marked area as the ROI area, and performing binarization processing to obtain a second image;
[0015] Determine the center coordinates of the four markers and the center coordinates of the field of view of the camera module based on the second image;
[0016] Based on the center point coordinates of the four marks and the center coordinates of the field of view of the camera module, the three-dimensional direction offset of the test drawing is determined.
[0017] Further, the stage motor includes an x-direction motor, a y-direction motor, and an r-direction motor;
[0018] The method of photographing the image corresponding to the test drawing according to the camera module includes: the stage motor on which the test drawing is located controls the test drawing to a corresponding position; setting a time delay according to the shaking time after the stage motor stops, and after the delay, executing the photographing of the image corresponding to the test drawing according to the camera module; the x-direction motor, the y-direction motor, and the r-direction motor are respectively used to control the test drawing to move in the x, y and r directions to the position required by the current camera module test item.
[0019] Furthermore, the stage motor movement is in units of pulse numbers, and n pulses are input to the x-direction motor, the y-direction motor or the r-direction motor, and the drawings controlled respectively move n millimeters in the corresponding directions;
[0020] The method further includes: if one or more of the offsets in the x, y and r directions relative to the center of the field of view are not less than a preset offset threshold, controlling the test drawing to be compensated in the three directions of x, y and r.
[0021] Furthermore, the control test drawing is compensated in three directions of x, y and r, including:
[0022] According to the x-direction offset, y-direction offset, and r-direction offset, the corresponding number of pulses input to the stage motor is compensated until the offsets in the x, y, and r directions relative to the center of the field of view are all less than a preset offset threshold.
[0023] In order to solve the above technical problems, in a second aspect, an embodiment of the present application provides a device for dynamically adjusting a drawing, which is applied to a camera module test, and the device includes a marking module, an offset determination module, and an execution module; wherein:
[0024] A marking module, used to add four mark points at the positions of the predetermined field of view of the current test drawing, wherein the intersection of the diagonal lines of the mark points is located at the center of the test drawing;
[0025] An offset determination module is used to capture an image corresponding to the test drawing according to the camera module, and determine the offsets in the x, y and r directions relative to the center of the field of view according to the four marks; wherein the x direction is the left-right direction, the y direction is the up-down direction, and the r direction is the rotation angle direction with the center as the origin;
[0026] An execution module is used to execute the corresponding camera module test item if the offsets in the x, y and r directions relative to the center of the field of view are all less than a preset offset threshold.
[0027] Furthermore, the marking module is further used to add four mark points at the position of the 0.9 degree field angle of the drawing;
[0028] The device also includes a building module, which is used to build a test environment required for the current camera module test item; the test environment includes the position of the test drawing and the color temperature setting of the white field or the black field.
[0029] Further, the stage motor includes an x-direction motor, a y-direction motor, and an r-direction motor;
[0030] In the offset determination module, the image corresponding to the test drawing is photographed according to the camera module, including: the stage motor where the test drawing is located controls the test drawing to the corresponding position; a time delay is set according to the shaking time after the stage motor stops, and after the delay, the image corresponding to the test drawing is photographed according to the camera module; the x-direction motor, y-direction motor, and r-direction motor are respectively used to control the test drawing to move in the x, y and r directions to the position required by the current camera module test item.
[0031] Furthermore, the stage motor movement is in units of pulse numbers, and n pulses are input to the x-direction motor, the y-direction motor or the r-direction motor, and the drawings controlled respectively move n millimeters in the corresponding directions;
[0032] The execution module is also used to control the test drawing to be compensated in the three directions of x, y and r if one or more of the offsets in the x, y and r directions relative to the center of the field of view are not less than a preset offset threshold.
[0033] In addition, the third aspect of the present invention provides an electronic device, the electronic device comprising: one or more processors, a memory, the memory being 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, the program comprising steps for executing the method for dynamically adjusting the drawing according to any one of claims 1 to 5
[0034] In the solution of the present invention, four mark points are added at the positions of the predetermined field of view of the current test drawing, and the intersection of the diagonal lines of the mark points is located at the center of the test drawing; the image corresponding to the test drawing is captured by the camera module, and the offsets of the x, y and r directions relative to the center of the field of view are determined according to the four marks; wherein the x direction is the left-right direction, the y direction is the up-down direction, and the r direction is the rotation angle direction with the center as the origin; if the offsets of the x, y and r directions relative to the center of the field of view are all less than the preset offset threshold, the corresponding camera module test item is executed. Compared with the prior art, the embodiment of the present application has the following beneficial effects: by determining the offsets of the x, y and r directions relative to the center of the field of view according to the four marks, it is determined whether the test drawing is excessively offset, whether compensation needs to be performed and the offset compensation is performed, thereby ensuring that the position of the test drawing is relatively fixed, facilitating subsequent testing, and ensuring test efficiency and effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] 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.
[0036] Figure 1 It is a flowchart of a method for dynamically adjusting drawings disclosed in an embodiment of the present invention. DETAILED DESCRIPTION
[0037] 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.
[0038] 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.
[0039] It should be noted that the “plurality” mentioned in this article refers to two or more.
[0040] The implementation details of the technical solution of the embodiment of the present application are described in detail below:
[0041] In the prior art, the module testing solution is to encapsulate different test algorithms into test items. Each test item requires a corresponding test environment (drawings in different positions, white fields or black fields with different color temperatures). After the industrial control software controls the equipment to build the test environment, it executes the corresponding test items and repeats this action until all test items are executed.
[0042] In a first aspect of this embodiment, a method for dynamically adjusting drawings is provided, which is applied to camera module testing. The method flow chart is shown in Figure 1 The method comprises:
[0043] S101, adding four mark points at positions of a predetermined field of view of a current test drawing, wherein the intersection of the diagonal lines of the mark points is located at the center of the test drawing.
[0044] Further, in S101, adding four mark points at the positions of the predetermined field of view of the current test drawing includes: adding four mark points at the positions of the field of view angle of 0.9 degrees on the drawing.
[0045] In this embodiment, four mark points are added at the position of 0.9 field of view of the test drawing, and the intersection point of the diagonal lines of the mark points is located at the center of the drawing.
[0046] The method also includes: building a test environment required for the current camera module test item; the test environment includes the position of the test drawing and the color temperature setting of the white field or the black field.
[0047] In this embodiment, since the module test solution encapsulates different test algorithms into test items, each test item requires a corresponding test environment (drawings in different positions, white fields or black fields with different color temperatures). By building the test environment required by the current test item, the drawing is controlled to move to a preset position (the x direction, y direction, and r direction are adjusted to the corresponding positions respectively), and white fields or black fields with different color temperatures corresponding to different test items are set.
[0048] S102, photographing an image corresponding to the test drawing according to the camera module, and determining the offsets of the x, y and r directions relative to the center of the field of view according to the four marks; wherein the x direction is the left-right direction, the y direction is the up-down direction, and the r direction is the rotation angle direction with the center as the origin.
[0049] In this embodiment, the drawing plane is used as the reference plane, left and right is the x direction, up and down is the y direction, the rotation angle with the center as the origin is the r direction, and the distance from the drawing to the camera is a fixed value and no calculation or compensation is performed.
[0050] Further, the image corresponding to the test drawing is photographed by the camera module, and the offsets in the x, y and r directions relative to the center of the field of view are determined according to the four marks, including:
[0051] Placing the test drawing at the center of the camera module's field of view and capturing a first image;
[0052] Processing the first image according to an image segmentation algorithm, determining the marked area as the ROI area, and performing binarization processing to obtain a second image;
[0053] Determine the center coordinates of the four markers and the center coordinates of the field of view of the camera module based on the second image;
[0054] Based on the center point coordinates of the four marks and the center coordinates of the field of view of the camera module, the three-dimensional direction offset of the test drawing is determined.
[0055] Specifically, in this embodiment, the region where the mark is located is captured as the ROI region (region of interest), which is a parameter that needs to be preset in advance, such as setting the corresponding rectangular frame coordinates in advance to determine the corresponding ROI region. The purpose is to extract this region and process it separately, ensure the uniqueness of the mark in the ROI region, and reduce the amount of calculation.
[0056] Furthermore, after the ROI area is cut out, each ROI area image is subjected to image segmentation processing. There are many methods for image segmentation (segmenting an image into foreground and background with a certain threshold as the boundary). For the test drawing of this embodiment, the bimodal method (the histogram of pixel distribution has two obvious peaks) is selected as the segmentation algorithm.
[0057] Furthermore, the ROI region image is extracted and processed separately to obtain a binary image, and the first image is binarized to obtain a second image. The center of each circular mark is the center coordinate position of the mark.
[0058] Calculate the center coordinates of the four markers and the center coordinates of the camera module's field of view according to the following formula:
[0059]
[0060] Wherein, x and y are column and row coordinates respectively, and array(x,y) is the grayscale value of the pixel at the (x,y) coordinates. In this embodiment, m 10 is the first-order moment of j=1, i=0, where j=1, i=0, m 10 =∑ x,y (arry(x,y)·x 1 ), after binarization, only 1 and 0 remain in the image data, so m 10 It is actually the integral of the x-coordinates of non-zero pixels in the binary image. Similarly, m01 is the integral of the y-coordinates of non-zero pixels in the binary image, and m00 is the number of non-zero pixels.
[0061] Furthermore, in this embodiment, the center point coordinates of the four markers are A (x1, y1), B (x2, y2), C (x3, y3), D (x4, y4) and the center field of view coordinates of the camera (x0, y0).
[0062] Further, based on the center point coordinates of the four mark marks and the center coordinates of the field of view of the camera module, the three-dimensional offset of the test drawing is determined, including: calculating the horizontal offset pixel δx, the vertical offset pixel δy and the rotation angle δr according to the following formulas; that is, in this embodiment, the pixels in the x, y and r directions relative to the center of the field of view.
[0063] δx=(x1+x2+x3+x4) / 4-x0;
[0064] δy=(y1+y2+y3+y4) / 4-y0;
[0065] δr=ractan[((y2-y1) / (x2-x1)+(x2-x3) / (y3-y2)+(y3-y4) / (x3-x4)+(x1-x4) / (y4-y1)) / 4].
[0066] Specifically, in this example, the units of δx and δy calculated above are pixels. The actual offset needs to be multiplied by the length of the side corresponding to the pixel (from the chip specification, most pixels are square) to get the specific offset corresponding to the offset pixel. The unit of δr is °, and no additional processing is required.
[0067] Further, in this example, the stage motor includes an x-direction motor, a y-direction motor, and an r-direction motor.
[0068] In S102, the image corresponding to the test drawing is photographed according to the camera module, including:
[0069] The carrier motor where the test drawing is located controls the test drawing to the corresponding position; a time delay is set according to the shaking time after the carrier motor stops, and after the delay, the image corresponding to the test drawing is taken according to the camera module; the x-direction motor, y-direction motor, and r-direction motor are respectively used to control the test drawing to move in the x, y and r directions to the position required by the current camera module test item.
[0070] In this embodiment, a certain time delay is performed, and the delay is determined according to the specific situation, so as to cover the shaking time of the device.
[0071] Specifically, in this embodiment, the carrier motor will load a larger light source panel (with test drawings). At the moment the motor stops, the panel will shake due to inertia (generally it will stop within 1 second). This shaking can be reduced by adjusting the motion curve parameters of the motor, but it cannot be avoided. Subsequent calculations will introduce errors, and it is necessary to wait for m milliseconds before performing subsequent calculations. Different m values can be set to make the same batch of modules, and the number of compensations can be counted. As the m value increases, the number of compensations will decrease. The m value at which the number of compensations stops decreasing can be used as the required time delay. The delay operation is performed according to the above time delay, and then, the image corresponding to the test drawing is taken according to the camera module.
[0072] S103: If the offsets in the x, y and r directions relative to the center of the field of view are all less than a preset offset threshold, the corresponding camera module test item is executed.
[0073] The method further includes: if one or more of the offsets in the x, y and r directions relative to the center of the field of view are not less than a preset offset threshold, controlling the test drawing to be compensated in the three directions of x, y and r.
[0074] Specifically, in this embodiment, by capturing an image, the offsets in the x, y and r directions relative to the center of the field of view are calculated through four marks. If the three offsets are all less than the offset threshold, it means that the current test drawing position meets the requirements and jumps to the corresponding test item; otherwise, the control drawing is continued to be executed to perform corresponding compensation in the x, y and r directions until the offsets in the x, y and r directions relative to the center of the field of view are all less than the preset offset threshold.
[0075] Furthermore, the stage motor movement is in units of pulse numbers, and n pulses are input to the x-direction motor, the y-direction motor or the r-direction motor, and the drawings controlled respectively move n millimeters in the corresponding directions;
[0076] Furthermore, the control test drawing is compensated in three directions of x, y and r, including:
[0077] According to the x-direction offset, y-direction offset, and r-direction offset, the corresponding number of pulses input to the stage motor is compensated until the offsets in the x, y, and r directions relative to the center of the field of view are all less than a preset offset threshold.
[0078] Specifically, in this embodiment, the position (x, y direction) and rotation angle (r direction) of the test paper are controlled by the stage motor. The motor action is in units of pulse number. When n pulses are input, the paper controlled by the motor moves n millimeters. Each motor has a corresponding n value.
[0079] The three motors in the x, y and r directions (x direction motor, y direction motor, r direction motor) need to be compensated. According to the above four marks, the offsets of the x, y and r directions relative to the center of the field of view and n are calculated, and the corresponding number of pulses are input for compensation. Since the calculated r value has an error with the actual offset angle when x and y are deviated, it is necessary to iterate the compensation until the calculated offset is less than the threshold.
[0080] In summary, in this embodiment, four mark points are added at the positions of the predetermined field of view of the current test drawing, and the intersection of the diagonal lines of the mark points is located at the center of the test drawing; the image corresponding to the test drawing is captured by the camera module, and the offsets of the x, y and r directions relative to the center of the field of view are determined according to the four marks; wherein the x direction is the left-right direction, the y direction is the up-down direction, and the r direction is the rotation angle direction with the center as the origin; if the offsets of the x, y and r directions relative to the center of the field of view are all less than the preset offset threshold, the corresponding camera module test item is executed. Compared with the prior art, the embodiment of the present application has the following main beneficial effects: by determining the offsets of the x, y and r directions relative to the center of the field of view according to the four marks, it is determined whether the test drawing is excessively offset, whether compensation needs to be performed and the offset compensation is performed, thereby ensuring that the position of the test drawing is relatively fixed, facilitating subsequent testing, and ensuring test efficiency and effect.
[0081] In order to solve the above technical problems, the second aspect of this embodiment provides a device for dynamically adjusting drawings, which is applied to camera module testing. The device includes a marking module, an offset determination module and an execution module; wherein:
[0082] A marking module, used to add four mark points at the positions of the predetermined field of view of the current test drawing, wherein the intersection of the diagonal lines of the mark points is located at the center of the test drawing;
[0083] An offset determination module is used to capture an image corresponding to the test drawing according to the camera module, and determine the offsets in the x, y and r directions relative to the center of the field of view according to the four marks; wherein the x direction is the left-right direction, the y direction is the up-down direction, and the r direction is the rotation angle direction with the center as the origin;
[0084] An execution module is used to execute the corresponding camera module test item if the offsets in the x, y and r directions relative to the center of the field of view are all less than a preset offset threshold.
[0085] Furthermore, the marking module is further used to add four mark points at the position of the 0.9 degree field angle of the drawing;
[0086] The device also includes a building module, which is used to build a test environment required for the current camera module test item; the test environment includes the position of the test drawing and the color temperature setting of the white field or the black field.
[0087] Further, the image corresponding to the test drawing is photographed by the camera module, and the offsets in the x, y and r directions relative to the center of the field of view are determined according to the four marks, including:
[0088] Placing the test drawing at the center of the camera module's field of view and capturing a first image;
[0089] Processing the first image according to an image segmentation algorithm, determining the marked area as the ROI area, and performing binarization processing to obtain a second image;
[0090] Determine the center coordinates of the four markers and the center coordinates of the field of view of the camera module based on the second image;
[0091] Based on the center point coordinates of the four marks and the center coordinates of the field of view of the camera module, the three-dimensional direction offset of the test drawing is determined.
[0092] Further, the stage motor includes an x-direction motor, a y-direction motor, and an r-direction motor;
[0093] In the offset determination module, the image corresponding to the test drawing is photographed according to the camera module, including: the stage motor where the test drawing is located controls the test drawing to the corresponding position; a time delay is set according to the shaking time after the stage motor stops, and after the delay, the image corresponding to the test drawing is photographed according to the camera module; the x-direction motor, y-direction motor, and r-direction motor are respectively used to control the test drawing to move in the x, y and r directions to the position required by the current camera module test item.
[0094] Furthermore, the stage motor movement is in units of pulse numbers, and n pulses are input to the x-direction motor, the y-direction motor or the r-direction motor, and the drawings controlled respectively move n millimeters in the corresponding directions;
[0095] The execution module is also used to control the test drawing to be compensated in the three directions of x, y and r if one or more of the offsets in the x, y and r directions relative to the center of the field of view are not less than a preset offset threshold.
[0096] Furthermore, the control test drawing is compensated in three directions of x, y and r, including:
[0097] According to the x-direction offset, y-direction offset, and r-direction offset, the corresponding number of pulses input to the stage motor is compensated until the offsets in the x, y, and r directions relative to the center of the field of view are all less than a preset offset threshold.
[0098] In addition, an embodiment of the present application also discloses an electronic device, which includes: one or more processors, and 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 method steps for executing the dynamic adjustment of drawings as described in the first aspect above.
[0099] 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 method steps for dynamically adjusting drawings as described in the first aspect above.
[0100] 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.
[0101] 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.
[0102] 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.
[0103] 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.
[0104] 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.
[0105] 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 dynamically adjusting drawings, applied to camera module testing, characterized in that: The method comprises: Add four mark points at the positions of the predetermined field of view of the current test drawing, and the intersection of the diagonal lines of the mark points is located at the center of the test drawing; The image corresponding to the test drawing is captured by the camera module, and the offsets in the x, y and r directions relative to the center of the field of view are determined according to the four marks; wherein the x direction is the left-right direction, the y direction is the up-down direction, and the r direction is the rotation angle direction with the center as the origin; If the offsets in the x, y and r directions relative to the center of the field of view are all less than the preset offset threshold, the corresponding camera module test item is executed.
2. The method for dynamically adjusting drawings according to claim 1, characterized in that: Adding four mark points at the position of the predetermined field of view of the current test drawing includes: adding four mark points at the position of the field of view angle of 0.9 degree on the drawing; Before capturing an image corresponding to the test drawing according to the camera module, the method further includes: Build the test environment required for the current camera module test item; the test environment includes the location of the test drawing and the color temperature setting of the white field or black field.
3. The method for dynamically adjusting drawings according to claim 2, characterized in that: The step of photographing an image corresponding to the test drawing according to the camera module and determining the offsets of the x, y and r directions relative to the center of the field of view according to the four marks includes: Placing the test drawing at the center of the camera module's field of view and capturing a first image; Processing the first image according to an image segmentation algorithm, determining the marked area as the ROI area, and performing binarization processing to obtain a second image; Determine the center coordinates of the four markers and the center coordinates of the field of view of the camera module based on the second image; Based on the center point coordinates of the four marks and the center coordinates of the field of view of the camera module, the three-dimensional direction offset of the test drawing is determined.
4. The method for dynamically adjusting drawings according to claim 3, characterized in that: The stage motor includes an x-direction motor, a y-direction motor, and an r-direction motor; The step of photographing the image corresponding to the test drawing according to the camera module includes: a motor of the stage where the test drawing is located controls the test drawing to a corresponding position; A time delay is set according to the shaking time after the carrier motor stops. After the delay, the image corresponding to the test drawing is photographed according to the camera module; the x-direction motor, y-direction motor, and r-direction motor are respectively used to control the test drawing to move in the x, y and r directions to the position required by the current camera module test item.
5. The method for dynamically adjusting drawings according to claim 4, characterized in that: The stage motor movement is in units of pulse numbers. n pulses are input to the x-direction motor, y-direction motor or r-direction motor, and the drawings controlled respectively move n millimeters in the corresponding directions. The method further includes: if one or more of the offsets in the x, y and r directions relative to the center of the field of view are not less than a preset offset threshold, controlling the test drawing to be compensated in the x, y and r directions; The control test drawing is compensated in three directions: x, y and r, including: According to the x-direction offset, y-direction offset, and r-direction offset, the corresponding number of pulses input to the stage motor is compensated until the offsets in the x, y, and r directions relative to the center of the field of view are all less than a preset offset threshold.
6. A device for dynamically adjusting drawings, applied to camera module testing, characterized in that: The device comprises a marking module, an offset determination module and an execution module; wherein: A marking module, used to add four mark points at the positions of the predetermined field of view of the current test drawing, wherein the intersection of the diagonal lines of the mark points is located at the center of the test drawing; An offset determination module is used to capture an image corresponding to the test drawing according to the camera module, and determine the offsets in the x, y and r directions relative to the center of the field of view according to the four marks; wherein the x direction is the left-right direction, the y direction is the up-down direction, and the r direction is the rotation angle direction with the center as the origin; An execution module is used to execute the corresponding camera module test item if the offsets in the x, y and r directions relative to the center of the field of view are all less than a preset offset threshold.
7. The device for dynamically adjusting drawings according to claim 6, characterized in that: The marking module is also used to add four mark points at the position of 0.9 degree field angle of the drawing; The device also includes a building module, which is used to build a test environment required for the current camera module test item; the test environment includes the position of the test drawing and the color temperature setting of the white field or the black field.
8. The device for dynamically adjusting drawings according to claim 7, characterized in that: The stage motor includes an x-direction motor, a y-direction motor, and an r-direction motor; In the offset determination module, the image corresponding to the test drawing is photographed according to the camera module, including: the stage motor where the test drawing is located controls the test drawing to the corresponding position; a time delay is set according to the shaking time after the stage motor stops, and after the delay, the image corresponding to the test drawing is photographed according to the camera module; the x-direction motor, y-direction motor, and r-direction motor are respectively used to control the test drawing to move in the x, y and r directions to the position required by the current camera module test item.
9. The device for dynamically adjusting drawings according to claim 8, characterized in that: The stage motor movement is in units of pulse numbers. n pulses are input to the x-direction motor, y-direction motor or r-direction motor, and the drawings controlled respectively move n millimeters in the corresponding directions. The execution module is also used to control the test drawing to be compensated in the three directions of x, y and r if one or more of the offsets in the x, y and r directions relative to the center of the field of view are not less than a preset offset threshold.
10. 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 method steps for executing the dynamic adjustment drawing as described in any one of claims 1-5.
Citation Information
Patent Citations
Method and device for adjusting test target plate
CN114170319A
Visual centering method, visual centering system and electronic equipment
CN114593695A
Device and method for camera module to collect image
CN117278742A
Automatic test method and system for camera module, electronic equipment and storage medium
CN118055219A