A test method for image blur downstroke curve
In the voice coil motor test, the test image is binarized and the dot centroid distance is calculated and the stroke curve is drawn. The problem of image blur affecting the accuracy of the test is solved, and the accuracy and linearity of the test are improved.
Patent Information
- Application Number
- CN202111525295.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-14
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2041-12-14
AI Technical Summary
In the case where the test plate image is blurred, it is difficult to accurately determine whether the optical lens reaches the stroke position accurately, which affects the stroke curve test effect of the voice coil motor.
By controlling the voice coil motor, move the optical lens to different stroke positions, take a picture of the same test panel, obtain multiple test images, and binarize the images, calculate the center of mass distance of each group of dots, and draw the stroke curve of the voice coil motor.
The effect of image blur on the linearity of stroke curve is reduced, and the accuracy of voice coil motor mechanical performance testing is improved.
Smart Images

Figure CN114298981B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a voice coil motor testing technology, and in particular to a testing method for an image blur downstroke curve. Background Art
[0002] High-pixel camera products have very high requirements for imaging quality, the most important of which is clarity. The autofocus camera module uses a voice coil motor to drive the optical lens to move, which expands the depth of field range of the camera module imaging and improves the user experience. For the autofocus camera module, the mechanical performance test of the voice coil motor is crucial.
[0003] At present, after assembling the camera module, the general manufacturer needs to conduct mechanical performance testing on the product with voice coil motor (VCM), that is, testing the stroke curve of the voice coil motor (that is, the curve of driving current and stroke distance). The stroke curve can reflect whether the voice coil motor is abnormal, so generally in the experiment or production line, when the camera module cannot focus near or far, it is necessary to send the camera module to the manufacturer to test whether the stroke curve is abnormal, and then further analyze it.
[0004] A Chinese patent discloses a method for testing the stroke curve of a camera module motor, wherein the camera module is mounted on a mobile terminal, and the steps of the method include: S1, fixing the mobile terminal with a fixture and adjusting the position of a test target plate; S2, quantitatively controlling the driving current of the VCM motor to be tested through a motor driving module of the camera module, and recording the register code value corresponding to the driving current; S3, the image signal processor of the camera module collects and records the contrast value of the target position of the test target plate image under different driving currents; S4, drawing a relationship curve between the register code value and the contrast value.
[0005] However, most of the test target images captured by the above test method will have image blurring problems because the focus of the optical lens is not on the test target. In the case of blurred images, the contrast difference of the test target image is very small, making it difficult to determine whether the optical lens has accurately reached the corresponding stroke position, which ultimately affects the effect of the stroke curve for determining the mechanical properties of the voice coil motor. Summary of the invention
[0006] In order to solve the above-mentioned deficiencies of the prior art, the present invention provides a method for testing a stroke curve under image blur, which can reduce the influence of image blur on the linearity of the stroke curve.
[0007] The technical problem to be solved by the present invention is achieved through the following technical solutions:
[0008] A method for testing a blurred image downstroke curve comprises the following steps:
[0009] Step 100: Controlling the voice coil motor to move the optical lens to different travel positions to shoot the same test plate to obtain multiple test images, wherein the test plate includes at least one group of dots, and each group of dots includes two dots;
[0010] Step 200: performing binary segmentation on the obtained test image to obtain a plurality of binary images;
[0011] Step 300: In each binary image, calculate the centroid distance between two dots in each group;
[0012] Step 400: Using the distance between the centroids of two dots in the same group in each binary image as one axis of the curve coordinate system to draw the stroke curve of the voice coil motor.
[0013] Furthermore, in step 200, the obtained test image is subjected to binary segmentation, and the steps of obtaining a plurality of binary images are as follows:
[0014] Step 201: setting at least one group of search boxes in each test image, each group of search boxes includes two search boxes, and one search box contains a dot;
[0015] Step 202: performing binary segmentation on the image regions within each search box to obtain a plurality of binary images.
[0016] Furthermore, in step 200, an adaptive threshold segmentation method or a fixed threshold segmentation method is used to perform binary segmentation on the test image or the image area within each search box.
[0017] Furthermore, in step 300, in each binary image, the steps of calculating the centroid distance between two dots in each group are as follows:
[0018] Step 301: Detecting each dot in each binary image;
[0019] Step 302: Calculate the centroid coordinates of the two dots in each group in each binary image;
[0020] Step 303: Calculate the centroid distance between the two dots in each group in each binary image according to the centroid coordinates of the two dots in each group.
[0021] Furthermore, in step 301, the connected component method is used to detect each dot in each binary image.
[0022] Furthermore, at least one group of search boxes is set in each test image, each group of search boxes includes two search boxes, and one search box corresponds to a dot. When using the connected area method to detect each dot in each binary image, only the image area within each search box is detected, and the pixel block with the largest connected area in each search box is used as the corresponding dot.
[0023] Furthermore, the test chart includes a first group of dots and a second group of dots, the first group of dots includes a first dot and a second dot, and the second group of dots includes a third dot and a fourth dot; the line between the first dot and the second dot is perpendicular to the line between the third dot and the fourth dot.
[0024] Further, in step 100, the voice coil motor is first controlled to move the optical lens from the closest stroke position to the farthest stroke position, and then the voice coil motor is controlled to move the optical lens from the farthest stroke position to the closest stroke position, so as to draw in step 400 at least one first stroke curve in the process of the optical lens moving from the closest stroke position to the farthest stroke position, a first stroke curve corresponding to a group of dots, and at least one second stroke curve in the process of the optical lens moving from the farthest stroke position to the closest stroke position, a second stroke curve corresponding to a group of dots.
[0025] Furthermore, the first stroke curve and the second stroke curve corresponding to the two dots in the same group are compared to determine whether the voice coil motor is abnormal.
[0026] Furthermore, in step 400, when drawing the stroke curve of the voice coil motor, the current value, register value or code value of the voice coil motor is used as another axis of the curve coordinates.
[0027] The present invention has the following beneficial effects: the testing method performs binary segmentation on each test image, detects dots on each obtained binary image, and calculates the centroid distance between two dots in the same group, thereby drawing the stroke curve of the voice coil motor, thereby reducing the influence of image blur on the linearity of the stroke curve. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 A flowchart of the method for testing the image blur downstroke curve provided by the present invention;
[0029] Figure 2 A schematic diagram of an image sensor, an optical lens and a test plate in the test method for the image blur downstroke curve provided by the present invention;
[0030] Figure 3It is a stroke curve drawn with the code value as the other axis of the curve coordinate in the test method of the stroke curve under image blur provided by the present invention;
[0031] Figure 4 A schematic diagram of dots on a test board in the test method for the image blur downstroke curve provided by the present invention. DETAILED DESCRIPTION
[0032] The present invention is described in detail below in conjunction with the accompanying drawings and embodiments, examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0033] In the description of the present invention, it should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside" and "outside" etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.
[0034] In addition, the terms "first", "second", and "third" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first", "second", and "third" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0035] In the present invention, unless otherwise clearly specified and limited, the terms "install", "connect", "connect", "fix", "set" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or an indirect connection through an intermediate medium, or it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0036] Embodiment 1
[0037] like Figure 1 As shown, a method for testing a blurred image downstroke curve comprises the following steps:
[0038] Step 100: Control the voice coil motor to move the optical lens to different travel positions to shoot the same test plate to obtain multiple test images, where the test plate includes at least one group of dots, and each group of dots includes two dots.
[0039] In step 100, a camera module to be tested is fixed on a test fixture, and then the test plate is fixed in front of the camera module to be tested, and the relative distance between the camera module to be tested and the test plate is adjusted so that each dot on the test plate is within the shooting range of the camera module to be tested.
[0040] The camera module to be tested includes an optical lens, a voice coil motor and an image sensor. The voice coil motor is arranged in front of the image sensor, and the optical lens is arranged in the voice coil motor. The voice coil motor is driven to move relative to the image sensor to realize an autofocus function.
[0041] In a specific implementation, the camera module to be tested can be assembled into a mobile terminal such as a mobile phone or a tablet computer before being tested. At this time, the mobile terminal can be fixed on the test fixture to indirectly fix the camera module to be tested on the test fixture, and then the mobile terminal is connected to a test circuit board, and then the test circuit board is connected to a host computer. The test personnel operate the host computer to send an operation instruction to the test circuit board, and then the test circuit board controls the camera module to be tested in the mobile terminal according to the operation instruction for testing; the camera module to be tested can also be tested after production and before shipment. At this time, the camera module to be tested is directly connected to the test circuit board, and then the test circuit board is connected to the host computer. The test personnel operate the host computer to send an operation instruction to the test circuit board, and then the test circuit board controls the camera module to be tested according to the operation instruction for testing.
[0042] Specifically, the voice coil motor is first controlled to move the optical lens from the closest stroke position (closest to the image sensor) to the farthest stroke position (farthest from the image sensor) to take pictures in sequence, and then the voice coil motor is controlled to move the optical lens from the farthest stroke position (farthest from the image sensor) to the closest stroke position (closest to the image sensor) to take pictures in sequence.
[0043] Step 200: performing binary segmentation on the obtained test image to obtain a plurality of binary images.
[0044] In this step 200, the test image can be binarized by using, but not limited to, an adaptive threshold segmentation method or a fixed threshold segmentation method. If the adaptive threshold segmentation method is used, the test software automatically takes the average grayscale value or the highest grayscale value of each test image in a certain proportion as the threshold for the binary segmentation. If the fixed threshold segmentation method is used, the tester sets a fixed grayscale value as the threshold for the binary segmentation on the test software based on experience.
[0045] Most of the test images will have image blurring problems because the focus of the optical lens is not on the test target plate, which is manifested as blurred boundaries of each dot. It is difficult for the test software to recognize the dots on the test image. At the same time, due to the decrease in contrast, the contrast difference between each test image becomes smaller and smaller, that is, in the case of low contrast, the linear relationship between contrast and stroke position becomes weaker and weaker.
[0046] After each test image is binarized and segmented, all pixels in the original test image with grayscale values higher than the threshold are set to a grayscale of 255, and all pixels in the original test image with grayscale values lower than the threshold are set to a grayscale of 0. Compared with the original test image, the boundaries of each dot in the binarized image become clear, and each binarized image achieves the maximum contrast, which can ensure the linearity of the travel curve.
[0047] Step 300: In each binary image, calculate the centroid distance between two dots in each group.
[0048] In step 300, since the travel position of the optical lens is different during shooting, the distance between the two dots in each group in each test image will be different due to different defocus levels, so the centroid distance between the two dots in the same group can be used to reflect the defocus levels at different travel positions. At the same time, binary segmentation can also improve the calculation accuracy of the centroid of each dot in a blurred image.
[0049] like Figure 2 As shown, according to the related theorem of similar triangles, Where L1 and L2 are the distances between two dots in the same group on the test image and the test board, respectively; U is the distance from the center of the optical lens to the test board; and v is the distance from the center of the optical lens to the image sensor. , H=U+v, it can be seen that the voice coil motor drives the optical lens to move and causes the change of v, and the change of v value caused by the focusing of the optical lens is much smaller than H, so Hv can be considered as a constant, then L1∝v.
[0050] Specifically, in step 300, in each binary image, the steps of calculating the centroid distance between two dots in each group are as follows:
[0051] Step 301: Detect each dot in each binary image.
[0052] In step 301, the connected component method may be used, but is not limited to, to detect each black pixel block in each binary image, and then at least two black pixel blocks with the largest areas are used as corresponding dots.
[0053] In this embodiment, 8 connected regions are used to detect each dot.
[0054] Step 302: Calculate the centroid coordinates of the two dots in each group in each binary image.
[0055] In step 302, a rectangular coordinate system can be established on each binary image, with the horizontal direction of the image as the X-axis of the rectangular coordinate system and the vertical direction of the image as the Y-axis of the rectangular coordinate system, so as to obtain the coordinates (X, Y) of all pixels on each dot, and then take the average value of the X values of all pixels on the same dot and the average value of the Y values of all pixels to obtain the centroid coordinates of the dot.
[0056] Step 303: Calculate the centroid distance between the two dots in each group in each binary image according to the centroid coordinates of the two dots in each group.
[0057] In step 303, assuming that the centroid coordinates of one of the two points in the same group are (X1, Y1) and the centroid coordinates of the other point are (X2, Y2), then the centroid distance L1 of the two points in the group is .
[0058] Step 400: Figure 3 As shown, the distance between the centroids of two dots in the same group in each binary image is used as one axis of the curve coordinate to draw the stroke curve of the voice coil motor.
[0059] In step 400, when drawing the stroke curve of the voice coil motor, the current value, register value or code value of the voice coil motor is used as another axis of the curve coordinates to obtain a relationship curve between the current value, register value or code value of the voice coil motor and the center of mass distance as the stroke curve of the voice coil motor.
[0060] Specifically, if the current value is used as the other axis of the curve coordinate, then in step 100, the current value of the voice coil motor driving the optical lens to move needs to be synchronously recorded, and when controlling the voice coil motor to drive the optical lens to move, starting from a preset minimum current value, the current value is gradually increased until a preset maximum current value is reached, so that the optical lens moves from the closest stroke position to the farthest stroke position, and the current value increases by the same amount each time; then, conversely, starting from a preset maximum current value, the current value is gradually reduced until a preset minimum current value is reached, so that the optical lens moves from the farthest stroke position to the closest stroke position, and the current value decreases by the same amount each time.
[0061] Similarly, if the register value or code value is used as the other axis of the curve coordinate, then in step 100, the register value or code value of the voice coil motor driving the optical lens to move needs to be synchronously recorded, and when controlling the voice coil motor to drive the optical lens to move, starting from 0, the register value or code value is gradually increased until a preset maximum register value or maximum code value is reached, so that the optical lens moves from the closest stroke position to the farthest stroke position, and the amplitude of each increase in the register value is 1, and the amplitude of each increase in the code value is a preset value; then conversely, starting from the preset maximum register value or maximum code value, the register value or code value is gradually reduced until it reaches 0, so that the optical lens moves from the farthest stroke position to the closest stroke position, and the amplitude of each decrease in the register value is 1, and the amplitude of each decrease in the code value is the same as the preset value.
[0062] In fact, there is a corresponding relationship between the register value, the code value and the current value. The same increase or decrease in the register value or the code value corresponds to the same increase or decrease in the current value, that is, the register value and the code value are actually different forms of expression of the current value. All three can be used to represent the travel amount of the optical lens.
[0063] If in the above step 100, the voice coil motor is first controlled to move the optical lens from the closest stroke position to the farthest stroke position to take pictures in sequence, and then the voice coil motor is controlled to move the optical lens from the farthest stroke position to the closest stroke position to take pictures in sequence, then in this step 400, at least one first stroke curve in the process of the optical lens moving from the closest stroke position to the farthest stroke position can be drawn, and one first stroke curve corresponds to a group of dots, and at least one second stroke curve in the process of the optical lens moving from the farthest stroke position to the closest stroke position can be drawn, and one second stroke curve corresponds to a group of dots.
[0064] Step 500: Compare a first stroke curve and a second stroke curve corresponding to two dots in the same group to determine whether the voice coil motor is abnormal.
[0065] In step 500, the difference between the center-of-mass distance between two points in the same group on the first stroke curve and the center-of-mass distance on the second stroke curve under the same current value, register value or code value is compared. If the difference exceeds the qualified value, the voice coil motor is judged to be abnormal; if the difference is less than the qualified value, the voice coil motor is judged to be normal.
[0066] The test method performs binary segmentation on each test image, detects dots on each binary image, and calculates the centroid distance between two dots in the same group, thereby drawing the stroke curve of the voice coil motor, thereby reducing the influence of image blur on the linearity of the stroke curve.
[0067] Embodiment 2
[0068] As an optimization solution of the first embodiment, Figure 4 As shown, the test board used in the test method of this embodiment includes a first group of dots and a second group of dots, the first group of dots includes a first dot and a second dot, and the second group of dots includes a third dot and a fourth dot; the line between the first dot and the second dot is perpendicular to the line between the third dot and the fourth dot.
[0069] When testing, the first stroke curve and the second stroke curve of the voice coil motor are plotted with the distance between the centers of mass of the first dot and the second dot in each test image as one axis of the curve coordinates. At the same time, another first stroke curve and another second stroke curve of the voice coil motor are plotted with the distance between the centers of mass of the third dot and the fourth dot in each test image as one axis of the curve coordinates. Then, the first stroke curve and the second stroke curve corresponding to the first dot and the second dot are compared to determine whether the voice coil motor is abnormal. At the same time, the first stroke curve and the second stroke curve corresponding to the third dot and the fourth dot are compared to determine whether the voice coil motor is abnormal. Only when the differences of the stroke curves in the two directions are both less than the qualified value, the voice coil motor is finally determined to be normal.
[0070] Embodiment 3
[0071] As an optimization solution of Embodiment 1 or Embodiment 2, Figure 4 As shown, in step 200 of the test method of this embodiment, the steps of performing binary segmentation on the obtained test image and obtaining multiple binary images are as follows:
[0072] Step 201: at least one group of search boxes is set in each test image, each group of search boxes includes two search boxes, and one search box contains a dot.
[0073] In step 201, since the positions and sizes of the dots on the test plate are known, the positions and sizes of the search boxes on the test image can be set by the inspector based on the test plate. When shooting, the dot position offset caused by the movement of the optical lens is very small, and basically does not cause the dots to deviate from the corresponding search boxes.
[0074] Step 202: performing binary segmentation on the image regions within each search box to obtain a plurality of binary images.
[0075] In step 202, the image area in each search box can be binarized by using, but not limited to, an adaptive threshold segmentation method or a fixed threshold segmentation method. If the adaptive threshold segmentation method is used, the test software automatically takes the average grayscale value or the highest grayscale value of the image area in each search box as the threshold for the binary segmentation according to a certain ratio. If the fixed threshold segmentation method is used, the tester sets a fixed grayscale value as the threshold for the binary segmentation in the test software based on experience.
[0076] This embodiment sets a search box for the test image. When performing binary segmentation, only the image area located in each search box is segmented, which can reduce the amount of calculation during binary segmentation. In the case of blurred image, each dot can be detected more accurately.
[0077] In step 301, when detecting each dot in each binary image using the connected region method, only the image region within each search box is detected, and the pixel block with the largest connected region within each search box is taken as the corresponding dot.
[0078] In this embodiment, 8 connected regions are used to detect each dot.
[0079] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention rather than to limit them. Although the embodiments of the present invention have been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the embodiments of the present invention can still be modified or replaced by equivalents, and these modifications or equivalent replacements cannot cause the modified technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for testing a downstroke curve of image blur, characterized in that: The steps include: Step 100: Controlling the voice coil motor to move the optical lens to different travel positions to shoot the same test plate to obtain multiple test images, wherein the test plate includes at least one group of dots, and each group of dots includes two dots; Step 200: performing binary segmentation on the obtained test image to obtain a plurality of binary images; Step 300: In each binary image, calculate the centroid distance between two dots in each group; Step 400: Using the distance between the centroids of two dots in the same group in each binary image as one axis of the curve coordinate system to draw the stroke curve of the voice coil motor.
2. The method for testing the image blur downstroke curve according to claim 1, characterized in that: In step 200, the obtained test image is binarized and segmented, and the steps of obtaining multiple binary images are as follows: Step 201: setting at least one group of search boxes in each test image, each group of search boxes includes two search boxes, and one search box contains a dot; Step 202: performing binary segmentation on the image regions within each search box to obtain a plurality of binary images.
3. The method for testing the image blur downstroke curve according to claim 1 or 2, characterized in that: In step 200, an adaptive threshold segmentation method or a fixed threshold segmentation method is used to perform binary segmentation on the test image or the image regions within each search box.
4. The method for testing the image blur downstroke curve according to claim 1, characterized in that: In step 300, in each binary image, the steps of calculating the centroid distance between two dots in each group are as follows: Step 301: Detecting each dot in each binary image; Step 302: Calculate the centroid coordinates of the two dots in each group in each binary image; Step 303: Calculate the centroid distance between the two dots in each group in each binary image according to the centroid coordinates of the two dots in each group.
5. The method for testing the image blur downstroke curve according to claim 4, characterized in that: In step 301, the connected component method is used to detect each dot in each binary image.
6. The method for testing the image blur downstroke curve according to claim 5, characterized in that: At least one group of search boxes is set in each test image, and each group of search boxes includes two search boxes. One search box corresponds to a dot. When the connected area method is used to detect each dot in each binary image, only the image area within each search box is detected, and the pixel block with the largest connected area in each search box is taken as the corresponding dot.
7. The method for testing the image blur downstroke curve according to claim 1, characterized in that: The test chart includes a first group of dots and a second group of dots, the first group of dots includes a first dot and a second dot, the second group of dots includes a third dot and a fourth dot; the line between the first dot and the second dot is perpendicular to the line between the third dot and the fourth dot.
8. The method for testing the image blur downstroke curve according to claim 1, characterized in that: In step 100, the voice coil motor is first controlled to move the optical lens from the closest stroke position to the farthest stroke position, and then the voice coil motor is controlled to move the optical lens from the farthest stroke position to the closest stroke position, so as to draw in step 400 at least one first stroke curve in the process of the optical lens moving from the closest stroke position to the farthest stroke position, and a first stroke curve corresponds to a group of dots, and at least one second stroke curve in the process of the optical lens moving from the farthest stroke position to the closest stroke position, and a second stroke curve corresponds to a group of dots.
9. The method for testing the image blur downstroke curve according to claim 8, characterized in that: The following steps are also included: Step 500: Compare a first stroke curve and a second stroke curve corresponding to two dots in the same group to determine whether the voice coil motor is abnormal.
10. The method for testing the image blur downstroke curve according to claim 1, characterized in that: In step 400, when drawing the stroke curve of the voice coil motor, the current value, register value or code value of the voice coil motor is used as another axis of the curve coordinates.
Citation Information
Patent Citations
Travel curve test method and system of camera-shooting mode motor and mobile terminal
CN103837828A
Test drawing, and method and system for detecting camera module by adopting test drawing
CN105592308A
CT image resolution automatic test method based on global binarization
CN105631876A