Mobile phone detection automatic depth of field algorithm

By using a mobile phone detection algorithm to automatically adjust the depth of field, and by traversing sampling points and calculating edge information, the optimal depth of field position is locked, which solves the problem that mobile phone detection devices cannot automatically adjust the depth of field, and improves the clarity of photos and detection efficiency.

CN115564757BActive Publication Date: 2026-01-02HANGZHOU IMAGE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211303985.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-24
Publication Date
2026-01-02
Estimated Expiration
2042-10-24

AI Technical Summary

Technical Problem

In existing technologies, mobile phone detection devices cannot automatically adjust the depth of field when taking photos, resulting in unclear photos and affecting the judgment efficiency of the detection module.

Method used

A mobile phone detection automatic depth-of-field adjustment algorithm is adopted. The optimal depth-of-field position is found by traversing sampling points layer by layer. The gradient value is calculated by combining the Sobel operator and the Laplacian operator to extract edge information. The sharpness is iteratively calculated to lock the final depth-of-field position.

Benefits of technology

This improved the clarity of the photos taken by the mobile phone, making it easier for the detection module to accurately determine whether the mobile phone is qualified or not, thus improving the detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115564757B_ABST
    Figure CN115564757B_ABST
Patent Text Reader

Abstract

The application discloses a kind of mobile phone detection automatic depth-of-field algorithm, comprising the following steps: S1, the best depth-of-field position, i.e. the position of camera when the surface of mobile phone is clearest, search method is layer by layer approximation by sampling point traversal method;S2, calculate the definition of picture, obtain the position of the highest value;S3, then start the second round search.The application is first controlled depth-of-field motor to a certain range of distance fixed-point image acquisition, then calculate the gradient value of each image center area by sobel operator to judge the definition of picture, then calculate the peak position of definition list, after positioning to the peak position, define smaller area, iterate the above-described calculation process once or more, converge to the final depth-of-field position, can make the mobile phone photo clear, convenient for detection module to detect to judge whether qualified.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of mobile phone detection, in particular to a mobile phone detection automatic depth of field adjustment algorithm. BACKGROUND

[0002] The appearance defect detection technology in the secondary mobile phone transaction has important significance for mobile phone commodity valuation and quality evaluation. In the industrial detection field, the objects to be detected generally have the characteristics of flat surface and small size. A mobile phone has front and back surfaces, four side surfaces and four corners. Different types of mobile phones have different shapes, sizes, thicknesses, and the differences in the materials and colors of the mobile phone shells and side bodies also cause different surface reflection characteristics. Therefore, the common defect detection method in the industrial field cannot meet the needs of mobile phone appearance detection.

[0003] In the current mobile device detection process, a direct photographing method is usually used to upload the photos to the detection module. Most of the photographing detection devices will have the problem of unable to automatically adjust the depth of field to a certain extent, which leads to unclear mobile phone photos, the detection module cannot judge the unclear photos, and the processing efficiency is affected. SUMMARY

[0004] The present application aims to provide a mobile phone detection automatic depth of field adjustment algorithm to solve the problem of the current mobile device detection process, which uses a direct photographing method to upload photos to the detection module. Most of the photographing detection devices will have the problem of unable to automatically adjust the depth of field to a certain extent, which leads to unclear mobile phone photos, the detection module cannot judge the unclear photos, and the processing efficiency is affected.

[0005] To achieve the above purpose, the present application provides the following technical scheme: a mobile phone detection automatic depth of field adjustment algorithm, comprising the following steps:

[0006] S1, the best depth of field position is the position of the camera when the surface of the mobile phone in the center of the camera is the clearest, and the searching method is a layer-by-layer approximation method using sampling points;

[0007] S2, calculate the sharpness of the picture to obtain the position of the highest value;

[0008] S3, then start the second round of searching;

[0009] S4, if the highest value falls in S4_1, continue to calculate the values of three or more sampling points {S4_1_0, S4_1_1, S4_1_2} in the further reduced range with the point as the center;

[0010] S5, finally lock the best depth of field position at the P position;

[0011] S6, after the picture is collected, the clearness of the image is obtained by calculating the clearness of the center ROI region of the picture.

[0012] Preferably, the clearness calculation process in the step S6 is firstly converted into a gray scale picture, then normalized, gamma transformed to make the overall brightness of the picture uniform, and the edge information of the gray scale picture is extracted by using a laplacian operator, and the standard variance and the square value of the variance of the edge extraction picture are calculated.

[0013] Preferably, the formula for obtaining the clearness of the image in the step S6 is:

[0014] L = Laplacian (G) ;

[0015] Sigma = meanStdDev (L) ;

[0016] Measure_value = Sigma * Sigma;

[0017] Wherein G is a gray scale picture, L is an edge extraction picture, and Measure_value is the clearness obtained.

[0018] Preferably, the sampling points of the first round of search in the step S1 are {S0, S1, S2, S3, S4, S5, S6}, and pictures are captured at the six sampling points.

[0019] Preferably, if the highest value of the first round is S4 in the step S3, the smaller range of the region is traversed around the center point S4, and the picture clearness is calculated at the sampling points {S4_0, S4_1, S4_2, S4_34}.

[0020] Compared with the prior art, the present application has the following beneficial effects:

[0021] The present application firstly controls the depth of field motor to collect images at a certain range of distance, then calculates the gradient value of the center region of each image by using a sobel operator to judge the clearness of the picture, calculates the peak position of the clearness list, positions to the peak position, defines a smaller region, and iterates the above described calculation process once or more times to converge to the final depth of field position, so that the mobile phone picture taken is clear and convenient for the detection module to detect to judge whether it is qualified. BRIEF DESCRIPTION OF DRAWINGS

[0022] Fig. 1 is the flow chart of the automatic depth of field algorithm module of the present application;

[0023] Fig. 2 is the schematic diagram of the automatic depth of field algorithm of the present application. DETAILED DESCRIPTION

[0024] With reference to the drawings of the embodiments of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of the present application.

[0025] Please refer to Figs. 1-2 The present application provides a technical solution: a mobile phone detection automatic depth of field adjustment algorithm, comprising the following steps:

[0026] S1, the best depth of field position, i.e. the position of the camera when the surface of the mobile phone is clearest, is searched by using a sampling point traversal method layer by layer;

[0027] S2, the sharpness of the picture is calculated, and the position of the highest value is obtained;

[0028] S3, then the second round of searching is started;

[0029] S4, if the highest value falls in S4_1, then the values of three or more sampling points {S4_1_0, S4_1_1, S4_1_2} are further calculated in a range centered at the point;

[0030] S5, the best depth of field position is finally locked at the P position;

[0031] S6, after the picture is collected, the sharpness of the center ROI region is calculated, and the image sharpness is obtained.

[0032] Preferably, the sharpness calculation process in step S6 is first converting a gray scale image, then performing normalization processing, gamma transformation to make the overall brightness of the picture uniform, and then using a laplacian operator to extract edge information of the gray scale image, and calculating the standard deviation and the square of the variance of the edge extraction image.

[0033] Preferably, the formula for obtaining the image sharpness in step S6 is:

[0034] L = Laplacian(G);

[0035] Sigma = meanStdDev(L);

[0036] Measure_value = Sigma * Sigma;

[0037] Wherein G is a gray scale image, L is an edge extraction image, and Measure_value is the sharpness obtained.

[0038] Preferably, the first round of searching sampling points in the step S1 is {S0, S1, S2, S3, S4, S5, S6}, and pictures are captured at the six sampling points.

[0039] Preferably, if the first round of the highest value is at S4 in the step S3, S4 is taken as the center point, and a smaller range of areas is traversed before and after the center point, and picture definition is calculated at {S4_0, S4_1, S4_2, S4_34} sampling points.

[0040] Although the embodiments of the present application have been shown and described, it is to be understood that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the present application, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A mobile phone detection algorithm for automatic depth adjustment, characterized in that: Includes the following steps: S1, the optimal depth of field position is the position of the camera when the center area of ​​the phone surface is clearest. The search method is to use a sampling point traversal to approximate the position layer by layer. S2. Calculate the image sharpness and determine the position of the highest value; S3, then begin the second round of searching; S4. If the highest value falls on S4_1, then continue to calculate the values ​​of three or more sampling points {S4_1_0, S4_1_1, S4_1_2} by further narrowing the range with that point as the center. S5. Finally, the optimal depth of field position is locked at position P; S6. After acquiring the image, perform a sharpness calculation on the ROI region in the crop center to obtain the image sharpness.

2. The mobile phone detection automatic depth-of-field adjustment algorithm according to claim 1, characterized in that: The sharpness calculation process in step S6 involves first converting the image to grayscale, then performing normalization and gamma transformation to ensure uniform overall brightness. Next, the Laplacian operator is used to extract edge information from the grayscale image, and the standard deviation and squared variance of the extracted edge image are calculated.

3. The mobile phone detection automatic depth-of-field adjustment algorithm according to claim 1, characterized in that: The formula for determining image sharpness in step S6 is: L = Laplacian(G); Sigma = meanStdDev(L); Measure_value=Sigma*Sigma; Where G is the grayscale image, L is the edge extraction image, and Measure_value is the calculated sharpness.

4. The mobile phone detection automatic depth-of-field adjustment algorithm according to claim 1, characterized in that: In step S1, the first round of search sampling points are {S0, S1, S2, S3, S4, S5, S6}, and images are captured at these six sampling points.

5. The mobile phone detection automatic depth-of-field adjustment algorithm according to claim 1, characterized in that: In step S3, if the highest value in the first round is in S4, then with S4 as the center point, the smaller range of regions is traversed back and forth, and the image clarity is calculated at the sampling points {S4_0,S4_1,S4_2,S4_34} respectively.

Citation Information

Patent Citations

  • Self-adaptive detection system and method for camber contour of high-speed zooming shooting

    CN104897077A

  • Automatic focusing method for image analyzer

    CN111698420A