Method, device, equipment and medium for calculating stripe width in stripe mark

By taking pictures of the camera module and calculating the average width in the striped image, the true width of the striped plate is determined, which solves the problem that the width of the striped plate cannot be calculated in the prior art, improves the accuracy and convenience of calibration, and ensures the camera. High-quality calibration of modules.

CN114862965BActive Publication Date: 2025-01-17KUNSHAN Q TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210470646.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-28
Publication Date
2025-01-17
Estimated Expiration
2042-04-28

AI Technical Summary

Technical Problem

In the production calibration of camera modules, the prior art cannot directly calculate the stripe width of the stripe marker, resulting in the selection of the wrong width stripe marker for calibration, affecting the accuracy and quality of the camera module.

Method used

The pre-selected striped markers are photographed through the camera module, the imaging areas of bright stripes and dark stripes in the striped image are extracted, their average width is calculated, and the striped markers are determined based on the module parameters and image distance of the camera module. Real stripe width.

Benefits of technology

It realizes fast, convenient and accurate calculation of the width of the striped marker, avoids calibration errors, and improves the accuracy and quality of the camera module.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114862965B_ABST
    Figure CN114862965B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, equipment and medium for calculating the stripe width in a stripe mark plate. The method comprises: using a camera module to take a picture of a preselected stripe mark plate to obtain a corresponding stripe image, wherein the stripe image comprises respective imaging areas of bright stripes and dark stripes in the stripe mark plate, and the bright stripes and dark stripes in the stripe mark plate are arranged at equal intervals; calculating the width of the imaging area of ​​the target stripes in the stripe image to obtain the average stripe width, wherein the target stripes are the bright stripes or the dark stripes; and determining the real stripe width of the stripe mark plate according to the average stripe width. The present invention can quickly and accurately calculate the real stripe width of the stripe mark plate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of terminal technology, and in particular to a method, device, equipment and medium for calculating the width of stripes in a stripe label. Background Art

[0002] With the maturity of the camera module phase focus (Phase Detection Auto Focus, PDAF) technology, most camera modules will perform PDAF calibration. Especially in recent years, Qualcomm PDAF technology has been widely used in smartphones. At present, when the camera module is calibrated for PDAF before leaving the factory, the manufacturer's recommended stripe standard (such as a chart) is usually used for PDAF calibration. Specifically, the image captured by the camera module includes masked pixels that appear in pairs and have a certain regularity. These pairs of masked pixels with a certain regularity are detected by using a chart to complete the PDAF calibration.

[0003] However, in practice, it is found that the required width of the stripes in the stripe mark varies with the hardware configuration (i.e., module model) of different camera modules. This will result in the selection of a stripe mark with the wrong width for calibration during the production calibration of the camera module, which will cause errors in the calibration of the camera module and affect the accuracy and quality of the camera module. It can be seen that it is crucial to select a suitable stripe mark for calibration of different camera modules, but the stripe width in the stripe mark cannot be directly obtained. Therefore, how to calculate the stripe width in the stripe mark before calibrating the camera module is an important issue that needs to be solved urgently. Summary of the invention

[0004] The embodiments of the present invention provide a method, device, equipment and medium for calculating the stripe width in a stripe mark, which can quickly and accurately calculate the real stripe width of the stripe mark, thereby improving the convenience, speed and accuracy of stripe width calculation.

[0005] On the one hand, the present invention provides a method for calculating the width of stripes in a stripe mark through an embodiment of the present invention, the method comprising:

[0006] Using a camera module to take a picture of a preselected stripe mark to obtain a corresponding stripe image, wherein the stripe image includes respective imaging areas of bright stripes and dark stripes in the stripe mark, and the bright stripes and dark stripes in the stripe mark are arranged at equal intervals;

[0007] Calculating the width of an imaging area of ​​a target stripe in the stripe image to obtain an average stripe width, wherein the target stripe is the bright stripe or the dark stripe;

[0008] The actual stripe width of the stripe target is determined according to the average stripe width.

[0009] Optionally, calculating the width of an imaging area of ​​a target stripe in the stripe image to obtain the average stripe width comprises:

[0010] Extracting the center coordinates of the imaging area of ​​the target stripes in the stripe image to obtain the center coordinates of a plurality of the target stripes;

[0011] The average width of the center coordinates of the plurality of target stripes is calculated to obtain the average stripe width.

[0012] Optionally, extracting the center coordinates of the imaging area of ​​the target stripes in the stripe image to obtain the center coordinates of the plurality of target stripes includes:

[0013] The two target stripes at the head and tail positions in the stripe image are eliminated, and the center coordinates of the imaging areas of the remaining target stripes in the stripe image are extracted to obtain the center coordinates of the plurality of target stripes.

[0014] Optionally, before determining the real stripe width of the stripe target plate according to the average stripe width, the method further comprises:

[0015] Calculating the image distance of the camera module according to the module parameters of the camera module;

[0016] Determining the real stripe width of the stripe target plate according to the average stripe width comprises:

[0017] The actual stripe width of the stripe target plate is calculated based on the image distance of the camera module and the average stripe width.

[0018] Optionally, the calculating the real stripe width of the stripe target plate according to the image distance of the camera module and the average stripe width comprises:

[0019] The image distance of the camera module, the average stripe width and the target object distance are subjected to similar triangle calculation to obtain the real stripe width of the stripe mark, and the target object distance is the distance between the stripe mark and the camera module.

[0020] Optionally, the method further comprises:

[0021] The theoretical stripe width of the stripe mark is calculated according to the target object distance and the effective focal length of the camera module, wherein the target object distance is the distance between the stripe mark and the camera module;

[0022] According to the theoretical stripe width and the actual stripe width, it is determined whether the stripe mark is selected correctly.

[0023] Optionally, the determining whether the stripe mark is selected correctly according to the theoretical stripe width and the actual stripe width includes:

[0024] When the theoretical stripe width and the actual stripe width are the same, it is determined that the stripe mark is selected correctly; or,

[0025] When the theoretical stripe width is different from the actual stripe width, it is determined that the stripe mark is incorrectly selected.

[0026] On the other hand, the present invention provides a device for calculating the width of stripes in a stripe target through an embodiment of the present invention, the device comprising a photographing module, a calculating module and a determining module, wherein:

[0027] The photographing module is used to photograph the pre-selected stripe mark plate using the camera module to obtain a corresponding stripe image, wherein the stripe image includes the imaging areas of the bright stripes and the dark stripes in the stripe mark plate, and the bright stripes and the dark stripes in the stripe mark plate are arranged at equal intervals;

[0028] The calculation module is used to calculate the width of the imaging area of ​​the target stripes in the stripe image to obtain the average stripe width, and the target stripes are the bright stripes or the dark stripes;

[0029] The determination module is used to determine the actual stripe width of the stripe target plate according to the average stripe width.

[0030] For the contents not introduced or described in the embodiments of the present invention, please refer to the relevant introduction in the aforementioned method embodiments, which will not be repeated here.

[0031] On the other hand, the present invention provides a terminal device through an embodiment of the present invention, and the terminal device includes: a processor, a memory, a communication interface and a bus; the processor, the memory and the communication interface are connected through the bus and communicate with each other; the memory stores executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the method for calculating the stripe width in the stripe mark as described above.

[0032] On the other hand, the present invention provides a computer-readable storage medium through an embodiment of the present invention, wherein the computer-readable storage medium stores a program, and when the program is run on a terminal device, the method for calculating the stripe width in the stripe mark as described above is executed.

[0033] One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages: the present invention uses a camera module to take a picture of a preselected stripe mark plate to obtain a corresponding stripe image, wherein the stripe image includes the imaging areas of the light stripes and the dark stripes in the stripe mark plate, and the light stripes and the dark stripes in the stripe mark plate are arranged at equal intervals; the width of the imaging area of ​​the target stripes in the stripe image is calculated to obtain the average stripe width, and the target stripes are the light stripes or the dark stripes; according to the average stripe width, the real stripe width of the stripe mark plate is determined. In the above scheme, the present invention can calculate the real stripe width of the stripe mark plate according to the imaging area of ​​the light / dark stripes in the stripe image, thereby realizing the fast, convenient and accurate calculation of the real stripe width of the stripe mark plate, and further, it is also helpful to avoid the problems in the prior art of selecting a stripe mark with an incorrect width for calibration in the calibration of the camera module, which causes calibration errors and affects the accuracy and quality of the camera module. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0035] Figure 1 The present invention is a flowchart of a method for calculating the width of stripes in a stripe label provided by an embodiment of the present invention.

[0036] Figure 2 It is a schematic diagram of a stripe label provided by an embodiment of the present invention.

[0037] Figure 3 It is a schematic diagram of a stripe image provided by an embodiment of the present invention.

[0038] Figure 4 It is a schematic diagram of removing target stripes located at the head and tail positions in a stripe image provided by an embodiment of the present invention.

[0039] Figure 5 The invention is a schematic diagram of the structure of a device for calculating the width of stripes in a stripe mark provided by an embodiment of the present invention.

[0040] Figure 6 It is a structural diagram of a terminal device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0041] The embodiments of the present invention provide a method, device, equipment and medium for calculating the stripe width in a stripe mark, which can quickly and accurately calculate the real stripe width of the stripe mark, thereby facilitating the improvement of the convenience, speed and accuracy of stripe width calculation.

[0042] The technical solution of the embodiment of the present invention is to solve the above technical problems, and the overall idea is as follows: using a camera module to take a picture of a pre-selected stripe mark to obtain a corresponding stripe image, wherein the stripe image includes the imaging areas of the bright stripes and the dark stripes in the stripe mark, and the bright stripes and the dark stripes in the stripe mark are arranged at equal intervals; the width of the imaging area of ​​the target stripes in the stripe image is calculated to obtain the average stripe width, and the target stripes are the bright stripes or the dark stripes; according to the average stripe width, the real stripe width of the stripe mark is determined.

[0043] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0044] First of all, the term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0045] See also Figure 1 , is a flow chart of a method for calculating the stripe width in a stripe mark provided by an embodiment of the present invention. Figure 1 The method shown includes the following implementation steps:

[0046] S101, using a camera module to take a picture of a preselected stripe mark to obtain a corresponding stripe image, wherein the stripe image includes respective imaging areas of bright stripes and dark stripes in the stripe mark, and the bright stripes and dark stripes in the stripe mark are arranged at equal intervals.

[0047] The stripe target plate of the present invention is a target plate selected by the system for self-definition, and is used for performing PDAF calibration on the camera module, etc., and may include but is not limited to a chart, a black and white stripe pattern, or a target plate with other stripe patterns, etc. Optionally, the stripe target plate includes a series of light stripes and dark stripes, and these light stripes and dark stripes are arranged at equal intervals on the stripe target plate.

[0048] For example, see Figure 2 A schematic diagram of a stripe label is given as an example. Figure 2The stripe mark shown includes a series of light stripes and dark stripes arranged at equal intervals, wherein the light stripes may be gray stripes as shown in the figure, and the dark stripes may be black stripes as shown in the figure.

[0049] In an optional embodiment, the present invention uses a camera module to take a picture of a preselected stripe mark plate to directly obtain the stripe image. Then, in step S102, the present invention can directly calculate the width of the stripe image obtained by taking the picture, and its specific implementation is described in detail below in the present invention.

[0050] In another optional embodiment, the present invention uses a camera module to take a picture of a preselected stripe mark plate to obtain a corresponding photographed image. Further, the present invention can perform preprocessing operations such as grayscale conversion, filtering and binarization on the photographed image. The present invention does not limit the execution order of these preprocessing operations. For example, the present invention can first perform grayscale conversion on the photographed image, then perform binarization, and finally perform filtering, etc., to obtain the processed stripe image.

[0051] The fringe image includes imaging areas of the light fringe and the dark fringe in the fringe target. The number of the light fringe and the dark fringe is not limited in the present invention, and they can be the same or different, and the present invention does not limit it. Usually, the number of the light fringe and the dark fringe included in the fringe image is multiple.

[0052] For example, see Figure 3 A schematic diagram showing a possible fringe image is shown in FIG. Figure 3 The stripe image shown includes an imaging area where black and white stripes alternate, that is, a black and white stripe area.

[0053] S102, calculating the width of an imaging area of ​​a target stripe in the stripe image to obtain the average stripe width, wherein the target stripe includes the bright stripe and / or the dark stripe.

[0054] In a specific embodiment, the present invention can extract the central coordinates of the imaging area of ​​the target stripes in the stripe image, so as to obtain the central coordinates of each of the target stripes, wherein the target stripes can be bright stripes or dark stripes in the stripe image, and the number of the target stripes is not limited by the present invention, and usually there are multiple target stripes. The central coordinates refer to the coordinates of the center point of the target stripes (specifically, they can be regarded as rectangular areas).

[0055] Optionally, in order to ensure the accuracy of stripe width calculation and eliminate the influence of image edge areas, the present invention can first remove the target stripes located at the head and tail positions in the stripe image, and then extract the center coordinates of the imaging areas of all the remaining target stripes in the stripe image, thereby obtaining the center coordinates of each remaining target stripe.

[0056] For example, citing Figure 3 For examples, see Figure 4 A schematic diagram showing a possible method of removing target stripes at the head and tail positions in a stripe image is shown. Figure 4 As shown, the present invention takes the target stripe as a bright stripe (the white rectangle in the figure) as an example to illustrate the relevant content, but it does not constitute a limitation. In order to eliminate the influence of the edge stripes of the image, the present invention will remove one bright stripe at the beginning and end of the edge in the stripe image, that is, the two white rectangles not selected in the figure will not participate in the calculation (that is, they will not participate in the center coordinate extraction); then all the remaining bright stripes after the removal will participate in the calculation, as shown in the following figure. Figure 4 The bright stripes framed by the black wireframe shown are all the remaining bright stripes after removal.

[0057] After further extracting the center coordinates of the plurality of target stripes, the present invention can calculate the average width of the center coordinates of the plurality of target stripes to obtain the average stripe width. The present invention does not limit the specific implementation of the average width calculation. Specifically, for example, the present invention can first calculate the total distance width between two adjacent center coordinates of the plurality of target stripes, where the total distance width is specifically the sum of the widths of a bright stripe and a dark stripe. Then, the average stripe width is calculated based on the total distance width.

[0058] In a specific implementation, the present invention can use the following formula (1) to calculate the total distance width W: sum(n-2) .

[0059] W sum(n-2) =(X2-X1)+(X3-X2)+...+(X n -X n-1 )Formula (1)

[0060] Among them, X i is the abscissa of the center coordinate of the i-th target stripe, n is the total number of target stripes in the stripe image, and i is a positive integer less than or equal to n.

[0061] Furthermore, the present invention can use the following formula (2) to calculate the distance width W1 between the center coordinates of two adjacent target stripes.

[0062]

[0063] Since the widths of the light stripes and the dark stripes in the stripe target plate are the same, the present invention can use the following formula (3) to calculate the average stripe width W of the target stripes (specifically, the light stripes or the dark stripes): Avg .

[0064]

[0065] In another specific embodiment, the present invention can extract the center coordinates of the imaging area of ​​any two adjacent stripes (specifically, a dark stripe and a bright stripe) in the stripe image, so as to obtain the center coordinates of the two adjacent stripes. Then, the average stripe width is calculated based on the center coordinates of the two adjacent stripes. Specifically, the present application first calculates the total distance width between the two adjacent stripes based on the center coordinates of the two adjacent stripes. At this time, the total distance width here is specifically the width of a bright stripe or a dark stripe. Finally, the present application determines the total distance width as the average stripe width.

[0066] S103, determining the real stripe width of the stripe target plate according to the average stripe width.

[0067] In a specific embodiment, before step S103, the present invention can calculate the image distance of the camera module according to the module parameters of the camera module. The module parameters of the camera module are parameters used to describe the camera module, which may include but are not limited to the effective focal length (EFL) of the camera module, the target object distance of the camera module or other parameters. The target object distance here specifically refers to the distance between the stripe mark and the camera module when taking pictures.

[0068] In a specific implementation, the present invention can calculate the module parameters of the camera module according to the camera module imaging formula, so as to obtain the image distance v of the camera module, and its specific calculation formula is shown in the following formula (4):

[0069]

[0070] Among them, v is the image distance of the camera module, f is the effective focal length of the camera module, and μ is the target object distance of the camera module.

[0071] Correspondingly, in step S103, the present invention can calculate the real stripe width of the target stripe according to the image distance of the camera module and the average stripe width. In a specific implementation, the present invention can use the principle of similar triangles to perform similar triangle calculation on the image distance of the camera module, the target object distance and the average stripe width, so as to obtain the real stripe width of the stripe calibration, and the specific calculation formula involved is shown in the following formula (5):

[0072]

[0073] Wherein, v is the image distance of the camera module, μ is the target object distance of the camera module, and W Avg is the average stripe width, and W2 is the actual stripe width of the stripe target.

[0074] In an optional embodiment, the present invention can also calculate the theoretical stripe width of the stripe target plate according to the target object distance and the effective focal length of the camera module. The present invention does not limit the specific calculation method of the theoretical stripe width. Specifically, for example, the present invention can use the following formula (6) to calculate the theoretical stripe width W3.

[0075]

[0076] Wherein, W3 is the theoretical stripe width of the stripe target plate, μ is the target object distance of the camera module, and f is the effective focal length of the camera module.

[0077] Further, the present invention can determine whether the stripe mark is correctly selected according to the theoretical stripe width and the actual stripe width. Specifically, the present invention can determine whether the theoretical stripe width and the actual stripe width are the same. When the theoretical stripe width is the same as the actual stripe width, it can be determined that the current stripe mark is correctly selected, and the stripe mark can be used to perform test operations such as PDAF calibration on the camera module. On the contrary, when the theoretical stripe width is different from the actual stripe width, it can be determined that the current stripe mark is incorrectly selected (i.e., the selection is wrong), and the stripe mark cannot be used to perform test operations such as PDAF calibration on the camera module.

[0078] By implementing the present invention, the present invention uses a camera module to take a picture of a preselected stripe mark plate to obtain a corresponding stripe image, wherein the stripe image includes the imaging areas of the light stripes and the dark stripes in the stripe mark plate, and the light stripes and the dark stripes in the stripe mark plate are arranged at equal intervals; the imaging area of ​​the target stripes in the stripe image is calculated to obtain the average stripe width, and the target stripes are the light stripes or the dark stripes; according to the average stripe width, the real stripe width of the stripe mark plate is determined. In the above scheme, the present invention can calculate the real stripe width of the stripe mark plate according to the imaging area of ​​the light / dark stripes in the stripe image, thereby realizing the fast, convenient and accurate calculation of the real stripe width of the stripe mark plate, and further, it is also helpful to avoid the calibration errors caused by selecting a stripe mark with an incorrect width for calibration in the calibration of the camera module in the prior art, affecting the accuracy and quality of the camera module, and other problems.

[0079] Based on the same inventive concept, another embodiment of the present invention provides a device and a terminal device corresponding to the method for calculating the stripe width in the stripe mark described in the embodiment of the present invention.

[0080] See also Figure 5 , is a schematic diagram of a structure of a device for calculating the width of stripes in a stripe mark provided by an embodiment of the present invention. Figure 5 The device 50 shown includes a photographing module 501, a calculating module 502 and a determining module 503, wherein:

[0081] The photographing module 501 is used to photograph a pre-selected stripe mark plate using a camera module to obtain a corresponding stripe image, wherein the stripe image includes respective imaging areas of the bright stripes and the dark stripes in the stripe mark plate, and the bright stripes and the dark stripes in the stripe mark plate are arranged at equal intervals;

[0082] The calculation module 502 is used to calculate the width of the imaging area of ​​the target stripes in the stripe image to obtain the average stripe width, and the target stripes are the bright stripes or the dark stripes;

[0083] The determination module 503 is used to determine the actual stripe width of the stripe target according to the average stripe width.

[0084] Optionally, the calculation module 502 is specifically configured to:

[0085] Extracting the center coordinates of the imaging area of ​​the target stripes in the stripe image to obtain the center coordinates of a plurality of the target stripes;

[0086] The average width of the center coordinates of the plurality of target stripes is calculated to obtain the average stripe width.

[0087] Optionally, the calculation module 502 is specifically configured to:

[0088] The two target stripes at the head and tail positions in the stripe image are eliminated, and the center coordinates of the imaging areas of the remaining target stripes in the stripe image are extracted to obtain the center coordinates of the plurality of target stripes.

[0089] Optionally, before determining the real stripe width of the stripe target plate according to the average stripe width, the calculation module 502 is further configured to:

[0090] Calculating the image distance of the camera module according to the module parameters of the camera module;

[0091] The determining module 503 is specifically used for:

[0092] The actual stripe width of the stripe target plate is calculated based on the image distance of the camera module and the average stripe width.

[0093] Optionally, the determining module 503 is specifically configured to:

[0094] The image distance of the camera module, the average stripe width and the target object distance are subjected to similar triangle calculation to obtain the real stripe width of the stripe mark, and the target object distance is the distance between the stripe mark and the camera module.

[0095] Optionally, the calculation module 502 is further used to calculate the theoretical stripe width of the stripe mark according to the target object distance and the effective focal length of the camera module, wherein the target object distance is the distance between the stripe mark and the camera module;

[0096] The determination module 503 is further used to determine whether the stripe mark is selected correctly according to the theoretical stripe width and the actual stripe width.

[0097] Optionally, the determining module 503 is specifically configured to:

[0098] When the theoretical stripe width and the actual stripe width are the same, it is determined that the stripe mark is selected correctly; or,

[0099] When the theoretical stripe width is different from the actual stripe width, it is determined that the stripe mark is incorrectly selected.

[0100] For the contents not introduced or described in the embodiments of the present invention, please refer to the relevant introduction in the aforementioned method embodiments, which will not be repeated here.

[0101] Please refer to 6, which is a schematic diagram of the structure of a terminal device provided by an embodiment of the present invention. Figure 6 The terminal device 60 shown includes a camera module (not shown), and may also include: at least one processor 601, a communication interface 602, a user interface 603 and a memory 604. The processor 601, the communication interface 602, the user interface 603 and the memory 604 may be connected via a bus or other means. The embodiment of the present invention takes the connection via a bus 605 as an example. Among them,

[0102] The processor 601 may be a general-purpose processor, such as a central processing unit (CPU).

[0103] The communication interface 602 may be a wired interface (e.g., an Ethernet interface) or a wireless interface (e.g., a cellular network interface or a wireless LAN interface) for communicating with other terminals or websites. In an embodiment of the present invention, the communication interface 602 is specifically used to obtain information such as the stripe image and the module parameters of the camera module.

[0104] The user interface 603 may be a touch panel, including a touch screen and a touch screen, for detecting operation instructions on the touch panel, or a physical button or a mouse. The user interface 603 may also be a display screen for outputting and displaying images or data.

[0105] The memory 604 may include a volatile memory, such as a random access memory (RAM); the memory may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); the memory 604 may also include a combination of the above-mentioned types of memory. The memory 604 is used to store a set of program codes, and the processor 601 is used to call the program codes stored in the memory 604 to perform the following operations:

[0106] Using a camera module to take a picture of a preselected stripe mark to obtain a corresponding stripe image, wherein the stripe image includes respective imaging areas of bright stripes and dark stripes in the stripe mark, and the bright stripes and dark stripes in the stripe mark are arranged at equal intervals;

[0107] Calculating the width of an imaging area of ​​a target stripe in the stripe image to obtain the average stripe width, wherein the target stripe is the bright stripe or the dark stripe;

[0108] The actual stripe width of the stripe target is determined according to the average stripe width.

[0109] Optionally, calculating the width of an imaging area of ​​a target stripe in the stripe image to obtain the average stripe width comprises:

[0110] Extracting the center coordinates of the imaging area of ​​the target stripes in the stripe image to obtain the center coordinates of a plurality of the target stripes;

[0111] The average width of the center coordinates of the plurality of target stripes is calculated to obtain the average stripe width.

[0112] Optionally, extracting the center coordinates of the imaging area of ​​the target stripes in the stripe image to obtain the center coordinates of the plurality of target stripes includes:

[0113] The two target stripes at the head and tail positions in the stripe image are eliminated, and the center coordinates of the imaging areas of the remaining target stripes in the stripe image are extracted to obtain the center coordinates of the plurality of target stripes.

[0114] Optionally, before determining the real stripe width of the stripe target plate according to the average stripe width, the processor 601 is further configured to:

[0115] Calculating the image distance of the camera module according to the module parameters of the camera module;

[0116] Determining the real stripe width of the stripe target plate according to the average stripe width comprises:

[0117] The actual stripe width of the stripe target plate is calculated based on the image distance of the camera module and the average stripe width.

[0118] Optionally, the calculating the real stripe width of the stripe target plate according to the image distance of the camera module and the average stripe width comprises:

[0119] The image distance of the camera module, the average stripe width and the target object distance are subjected to similar triangle calculation to obtain the real stripe width of the stripe mark, and the target object distance is the distance between the stripe mark and the camera module.

[0120] Optionally, the processor 601 is further configured to:

[0121] The theoretical stripe width of the stripe mark is calculated according to the target object distance and the effective focal length of the camera module, wherein the target object distance is the distance between the stripe mark and the camera module;

[0122] According to the theoretical stripe width and the actual stripe width, it is determined whether the stripe mark is selected correctly.

[0123] Optionally, the determining whether the stripe mark is selected correctly according to the theoretical stripe width and the actual stripe width includes:

[0124] When the theoretical stripe width and the actual stripe width are the same, it is determined that the stripe mark is selected correctly; or,

[0125] When the theoretical stripe width is different from the actual stripe width, it is determined that the stripe mark is incorrectly selected.

[0126] Since the terminal device introduced in this embodiment is a terminal device used to implement the method in the embodiment of the present invention, based on the method introduced in the embodiment of the present invention, a person skilled in the art can understand the specific implementation of the terminal device in this embodiment and its various variations, so how the terminal device implements the method in the embodiment of the present invention is not described in detail here. As long as a terminal device used by a person skilled in the art to implement the method in the embodiment of the present invention is within the scope of protection of the present invention.

[0127] One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages: the present invention uses a camera module to take a picture of a preselected stripe mark plate to obtain a corresponding stripe image, wherein the stripe image includes the imaging areas of the light stripes and the dark stripes in the stripe mark plate, and the light stripes and the dark stripes in the stripe mark plate are arranged at equal intervals; the width of the imaging area of ​​the target stripes in the stripe image is calculated to obtain the average stripe width, and the target stripes are the light stripes or the dark stripes; according to the average stripe width, the real stripe width of the stripe mark plate is determined. In the above scheme, the present invention can calculate the real stripe width of the stripe mark plate according to the imaging area of ​​the light / dark stripes in the stripe image, thereby realizing the fast, convenient and accurate calculation of the real stripe width of the stripe mark plate, and further, it is also helpful to avoid the problems in the prior art of selecting a stripe mark with an incorrect width for calibration in the calibration of the camera module, which causes calibration errors and affects the accuracy and quality of the camera module.

[0128] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0129] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0130] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0131] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0132] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0133] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A method for calculating the width of stripes in a stripe label, characterized in that: The method comprises: Using a camera module to take a picture of a preselected stripe mark to obtain a corresponding stripe image, wherein the stripe image includes respective imaging areas of bright stripes and dark stripes in the stripe mark, and the bright stripes and dark stripes in the stripe mark are arranged at equal intervals; Calculating the width of an imaging area of ​​target stripes in the stripe image to obtain an average stripe width, wherein the target stripes include the bright stripes and / or the dark stripes; Determining the actual stripe width of the stripe target plate according to the average stripe width; The step of calculating the width of the imaging area of ​​the target stripes in the stripe image to obtain the average stripe width comprises: Extracting the center coordinates of the imaging area of ​​the target stripes in the stripe image to obtain the center coordinates of a plurality of the target stripes; specifically comprising: Eliminating the target stripes at the head and tail positions in the stripe image, and extracting the center coordinates of the imaging areas of the remaining target stripes in the stripe image to obtain the center coordinates of a plurality of the target stripes; The average width of the center coordinates of the plurality of target stripes is calculated to obtain the average stripe width.

2. The method according to claim 1, characterized in that Before determining the real stripe width of the stripe target plate according to the average stripe width, the method further comprises: Calculating the image distance of the camera module according to the module parameters of the camera module; Determining the real stripe width of the stripe mark according to the average stripe width includes: calculating the real stripe width of the stripe mark according to the image distance of the camera module and the average stripe width.

3. The method according to claim 1, characterized in that The calculating the real stripe width of the stripe target plate according to the image distance of the camera module and the average stripe width comprises: The image distance of the camera module, the average stripe width and the target object distance are subjected to similar triangle calculation to obtain the real stripe width of the stripe mark, and the target object distance is the distance between the stripe mark and the camera module.

4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: calculating a theoretical stripe width of the stripe mark according to a target object distance and an effective focal length of the camera module, wherein the target object distance is a distance between the stripe mark and the camera module; According to the theoretical stripe width and the actual stripe width, it is determined whether the stripe mark is selected correctly.

5. The method according to claim 4, characterized in that The determining whether the stripe mark is selected correctly according to the theoretical stripe width and the actual stripe width comprises: When the theoretical stripe width and the actual stripe width are the same, it is determined that the stripe mark is selected correctly; or, When the theoretical stripe width is different from the actual stripe width, it is determined that the stripe mark is incorrectly selected.

6. A device for calculating the width of stripes in a stripe label, characterized in that: The device includes a photographing module, a calculating module and a determining module, wherein: The photographing module is used to photograph the pre-selected stripe mark plate using the camera module to obtain a corresponding stripe image, wherein the stripe image includes the imaging area domains of the bright stripes and the dark stripes in the stripe mark plate, and the bright stripes and the dark stripes in the stripe mark plate are arranged at equal intervals; The calculation module is used to calculate the width of the imaging area of ​​the target stripes in the stripe image to obtain an average stripe width, and the target stripes are the bright stripes or the dark stripes; The determination module is used to determine the real stripe width of the stripe target plate according to the average stripe width; Wherein, the calculation module is also used for: Extracting the center coordinates of the imaging area of ​​the target stripes in the stripe image to obtain the center coordinates of a plurality of the target stripes; specifically comprising: Eliminating the target stripes at the head and tail positions in the stripe image, and extracting the center coordinates of the imaging areas of the remaining target stripes in the stripe image to obtain the center coordinates of a plurality of the target stripes; The average width of the center coordinates of the plurality of target stripes is calculated to obtain the average stripe width.

7. A terminal device, characterized in that: The terminal device comprises: a processor, a memory, a communication interface and a bus; the processor, the memory and the communication interface are connected through the bus and communicate with each other; the memory stores executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the method for calculating the stripe width in the stripe label as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program, and when the program is run on a terminal device, the method for calculating the stripe width in a stripe mark as described in any one of claims 1 to 5 is executed.

Citation Information

Patent Citations

  • Object dimension measurement method and measurement device based on intelligent terminal

    CN108151657A