Field of view angle calculation method, terminal device and storage medium

By determining the pixel area and the inner region of the boundary from the captured image and calculating the field of view of the camera module, the problem of not being able to test FOV calculation in the prior art is solved, and the rapid and efficient calculation of the field of view angle is achieved.

CN114187231BActive Publication Date: 2025-04-01KUNSHAN Q TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111244865.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-26
Publication Date
2025-04-01
Estimated Expiration
2041-10-26

AI Technical Summary

Technical Problem

The prior art cannot perform test luminescent field angle (FOV) calculations, resulting in the inability to effectively evaluate the field angle performance of the camera module.

Method used

By acquiring the captured image, multiple pixel areas in the image are determined, and the boundary inner region is determined based on these pixel areas, and the field angle of the camera module is finally calculated.

Benefits of technology

It realizes fast and convenient calculation of field angle, improves the convenience and efficiency of calculation, and solves the problem of inability to perform test FOV calculations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114187231B_ABST
    Figure CN114187231B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for calculating the field of view angle, a terminal device and a storage medium, wherein the method comprises: acquiring a captured image; determining a plurality of pixel regions in the captured image; determining a boundary inner region according to the plurality of pixel regions in the captured image; and calculating the field of view angle of the camera module according to the boundary inner region. The present invention can solve the defect problem that the test FOV calculation cannot be performed in the prior art, and realizes the fast and convenient calculation of the field of view angle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a method for calculating a field of view angle, a terminal device and a storage medium. Background Art

[0002] In order to improve the ranging range of the camera module, the spot indirect time-of-flight (spot-itof) camera module came into being, which is different from the area array indirect time-of-flight (itof) module on the market. Specifically, the spot-itof module is a dot matrix pulse light emission, each point has a higher light emission power and a lower operating frequency, which can test a longer distance.

[0003] Among them, the light-emitting device of the spot-itof module is the laser pulse emission end, which is the key component of the spot-itof module and must meet certain performance requirements during the manufacturing process. During the module testing process, one of the tests is the field of vision (FOV) test, but there is currently no test method for this FOV in the industry. Therefore, it is urgent to propose a calculation scheme for testing FOV. Summary of the invention

[0004] The embodiment of the present application solves the defect problem that the test FOV calculation cannot be performed in the prior art by providing a method for calculating the field of view angle, and realizes fast and convenient calculation of the field of view angle.

[0005] On the one hand, the present application provides a method for calculating a field of view angle through an embodiment of the present application, the method comprising:

[0006] Acquire a captured image, where the captured image is an image captured by the camera module to be tested;

[0007] Determine a plurality of pixel regions in the captured image, wherein the pixel regions are regions where all adjacent pixels in the captured image whose grayscale values ​​exceed a preset threshold value are located;

[0008] Determine a boundary inner region according to a plurality of pixel regions in the captured image, wherein the boundary inner region is an innermost pixel region in a preset boundary direction among the plurality of pixel regions;

[0009] The field of view angle of the camera module is calculated based on the inner area of ​​the boundary.

[0010] Optionally, the preset boundary direction includes a preset upper boundary direction, a preset lower boundary direction, a preset left boundary direction and a preset right boundary direction.

[0011] Optionally, the preset condition includes at least one of the following: the slope between the starting point and the target area point is within a preset slope range, the angle between the starting point and the target area point is within a preset angle range, and the error value between the distance between the starting point and the target area point and a preset pixel spacing reference value is within a preset error range.

[0012] Optionally, the method further comprises:

[0013] Determine a target point, where the target point is the starting point, or any area center point of a plurality of area center points of the pixel areas that is located in a preset image center area;

[0014] Calculating the pixel distance between the target point and the center points of the plurality of pixel areas;

[0015] The pixel spacing reference value is calculated according to the calculated multiple pixel distances.

[0016] Optionally, calculating the field of view angle of the camera module according to the inner area of ​​the boundary includes:

[0017] Calculating the field of view angle of the camera module along a preset first direction according to the inner area of ​​the upper boundary and the inner area of ​​the lower boundary;

[0018] The field of view angle of the camera module along a preset second direction is calculated according to the inner area of ​​the left border and the inner area of ​​the right border.

[0019] Optionally, calculating the field of view angle of the camera module along a preset first direction according to the inner area of ​​the upper boundary and the inner area of ​​the lower boundary includes:

[0020] Calculating the viewing angle pixel width of the camera module along a preset first direction according to the inner area of ​​the upper boundary and the inner area of ​​the lower boundary;

[0021] The field of view angle of the camera module along the preset first direction is calculated according to the viewing angle pixel width of the camera module along the preset first direction and the focal length of the lens corresponding to the captured image.

[0022] Optionally, calculating the field of view angle of the camera module along a preset second direction according to the inner area of ​​the left border and the inner area of ​​the right border includes:

[0023] Calculating the viewing angle pixel width of the camera module along a preset second direction according to the inner area of ​​the left border and the inner area of ​​the right border;

[0024] The field of view angle of the camera module along the preset second direction is calculated according to the viewing angle pixel width of the camera module along the preset second direction and the focal length of the lens corresponding to the captured image.

[0025] Optionally, the method further comprises:

[0026] When the field of view angle is within a preset standard range, the camera module is determined to be a high-quality module.

[0027] On the other hand, the present application provides a field of view angle calculation device through an embodiment of the present application, the device includes an acquisition module, a determination module and a calculation module, wherein:

[0028] The acquisition module is used to acquire a captured image, where the captured image is an image captured by the camera module to be tested;

[0029] The determination module is used to determine a plurality of pixel regions in the captured image, wherein the pixel region is a region where all adjacent pixels in the captured image whose grayscale values ​​exceed a preset threshold value are located;

[0030] The determination module is further used to determine a boundary inner region according to a plurality of pixel regions in the captured image, wherein the boundary inner region is an innermost pixel region in the plurality of pixel regions in a preset boundary direction;

[0031] The calculation module is used to calculate the field of view angle of the camera module according to the inner area of ​​the boundary.

[0032] For the contents not introduced or described in the embodiments of the present application, please refer to the relevant introduction in the aforementioned method embodiments, and the present application will not elaborate on them here.

[0033] On the other hand, the present application provides a terminal device through an embodiment of the present application, 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 field of view angle calculation method as described above.

[0034] On the other hand, the present application provides a computer-readable storage medium through an embodiment of the present application, wherein the computer-readable storage medium stores a program, and when the program is run on a terminal device, the field of view angle calculation method as described above is executed.

[0035] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: the present application obtains a captured image, determines multiple pixel areas in the captured image, and then determines the inner area of ​​the boundary according to the multiple pixel areas in the captured image, and finally calculates the field of view of the camera module according to the inner area of ​​the boundary. In this way, the inner area of ​​the boundary can be easily determined from the captured image using the area search algorithm, and then the field of view of the camera module can be directly calculated based on the inner area of ​​the boundary, which is conducive to improving the convenience and efficiency of the field of view angle calculation, and also solves the technical problem that the test FOV calculation cannot be performed in the prior art, and realizes the fast and convenient calculation of the field of view angle. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] 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.

[0037] Figure 1 It is a scenario diagram of a test platform provided in an embodiment of the present application.

[0038] Figure 2 It is a top view schematic diagram of a test platform provided in an embodiment of the present application.

[0039] Figure 3 It is a flowchart of a method for calculating a field of view angle provided in an embodiment of the present application.

[0040] Figure 4 It is a schematic diagram of a pixel area in a captured image provided in an embodiment of the present application.

[0041] Figure 5 and Figure 6 It is a schematic diagram of several boundary area divisions provided in the embodiments of the present application.

[0042] Figure 7 It is a flowchart of another method for calculating the field of view angle provided in an embodiment of the present application.

[0043] Figure 8 This is a schematic diagram of an upper / lower boundary area search provided in an embodiment of the present application.

[0044] Fig. 9 It is a schematic diagram of a left / right boundary area search provided in an embodiment of the present application.

[0045] Fig.10 It is a schematic diagram of calculating a pixel spacing reference value provided in an embodiment of the present application.

[0046] Fig.11 It is a schematic diagram of the result of field of view FOV calculation provided in an embodiment of the present application.

[0047] Fig.12 It is a structural schematic diagram of a field of view angle calculation device provided in an embodiment of the present application.

[0048] Fig.13 It is a structural diagram of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0049] In the process of filing this application, the applicant discovered that the prior art estimates the approximate emission angle of the camera module through the manufacturing process parameters of the camera module (such as focal length, etc.), and there is a large deviation between the estimation accuracy and the actual test accuracy. In addition, the spot-itof module is a dot array laser, not a plane array laser, which results in discontinuous pixels in the FOV effective area. Therefore, the FOV cannot be calculated simply by finding the outermost pixels in each direction. In other words, the prior art cannot calculate the test FOV.

[0050] The embodiment of the present application solves the technical problem that test FOV calculation cannot be performed in the prior art by providing a method for calculating the field of view angle.

[0051] The technical solution of the embodiment of the present application is to solve the above-mentioned technical problems, and the overall idea is as follows: obtain a captured image, wherein the captured image is an image captured by the camera module to be tested; determine multiple pixel areas in the captured image, wherein the pixel area is an area where all adjacent pixels in the captured image whose grayscale values ​​exceed a preset threshold are located; determine an inner boundary area based on the multiple pixel areas in the captured image, wherein the inner boundary area is the innermost pixel area among the multiple pixel areas located in the preset boundary direction; calculate the field of view angle of the camera module based on the inner boundary area.

[0052] 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.

[0053] 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.

[0054] See also Figure 1, is a scene diagram of a test platform provided in an embodiment of the present application. The test platform is used to perform a quality test on a camera module to be tested to determine the quality of the camera module; that is, to test whether the camera module is a high-quality module or a low-quality module. Figure 1 The test platform 10 shown includes: a camera 101, a diffusion film 102, a glass panel 103 and a camera module 104. Among them:

[0055] The camera 101 is used to capture the image of the camera module 104 to be tested, which can be referred to as capturing the image. The camera 101 includes but is not limited to an infrared charge coupled device (CCD) camera, a complementary metal oxide semiconductor (CMOS) camera or other cameras. Preferably, the camera 101 described in the present application is an infrared CCD camera.

[0056] The diffusion film 102 is installed on the glass panel 103. The diffusion film 102 has the function of diffusing light, that is, light will be scattered on its surface, and the light will be spread softly and evenly. Specifically, the camera module 104 will be projected onto the diffusion film 102 for display, and the camera 101 will capture the image of the camera module 104 displayed on the diffusion film 102, that is, capture the image.

[0057] It should be noted that the present application uses the camera 101 to capture the image displayed on the diffusion film 102, aiming to obtain a panoramic image of the camera module 104, so as to avoid the situation where the captured image is not a panoramic image due to limitations on the camera viewing angle or environmental obstructions, which is not conducive to subsequent analysis and calculation of the field of view angle of the camera module based on the image.

[0058] The camera module 104 is a camera module to be tested during the manufacturing process, and the present application may specifically include a dot matrix laser emission module, a spot-itof module, etc. Figure 2 FIG. 1 shows a top view of a test platform. Figure 2 In the top view shown, the black frame area is the glass panel 103, and the center frame area is the camera 101. How to implement the quality test of the camera module based on the test platform will be described in detail below in this application.

[0059] See also Figure 3 , is a flow chart of a method for calculating a field of view angle provided in an embodiment of the present application.

[0060] like Figure 3 The method shown includes the following implementation steps:

[0061] S301, obtaining a captured image, where the captured image is an image captured by a camera module to be tested.

[0062] The captured images in this application are images captured by the camera at the transmitting end of each camera module to be tested. Taking the camera as an infrared CCD camera as an example, the captured images can correspond to infrared images, which is not limited in this application.

[0063] S302: Determine a plurality of pixel regions in the captured image, where the pixel regions are regions where all adjacent pixels whose grayscale values ​​exceed a preset threshold in the captured image are located.

[0064] The present application can filter out all pixels whose grayscale values ​​exceed a preset threshold from the captured image according to the grayscale value of the image, and combine all adjacent pixels with an adjacency relationship into corresponding pixel areas, thereby obtaining multiple pixel areas. The preset threshold is a system-defined setting, such as an experience value set according to user experience, or a threshold set according to system requirements, such as the preset threshold is 125, etc. The shape of the pixel area is not limited, for example, it may include but is not limited to a circle, square, rectangle or other irregular shapes, etc.

[0065] For example, see Figure 4 A schematic diagram showing a possible pixel area in a captured image is shown. Figure 4 The captured image shown includes 14×13 pixels, and each small square in the diagram represents a pixel. The present application may first screen out all pixels in the captured image whose grayscale values ​​exceed a preset threshold (e.g., 125), and then determine whether there are adjacent pixels around each screened pixel. If so, the area composed of all adjacent pixels is determined as a pixel area, such as pixel area 1 and pixel area 2 in the diagram. On the contrary, if there are no adjacent pixels around the screened pixel, such as pixel 1 in the diagram, the present application may discard pixel 1.

[0066] S303: Determine a boundary inner region according to a plurality of pixel regions in the captured image, wherein the boundary inner region is an innermost pixel region in the plurality of pixel regions in a preset boundary direction.

[0067] In a specific embodiment, the present application can determine the boundary areas in the captured image located in each preset boundary direction, such as the upper boundary area, the lower boundary area, the left boundary area and the right boundary area, based on the plurality of pixel areas. Each of the boundary areas includes at least one pixel area. Then, from each boundary area, the inner boundary area corresponding to the boundary area is determined, which may include the upper boundary inner area, the lower boundary inner area, the left boundary inner area and the right boundary inner area. Specifically, the inner boundary area can be determined from at least one corresponding pixel area based on the position coordinates of the area center point of each pixel area in each boundary area.

[0068] The preset boundary direction is a system-defined setting, which may include but is not limited to the upper boundary direction, the lower boundary direction, the left boundary direction and the right boundary direction. For example, see Figure 5 and Figure 6 A possible division diagram of the boundary direction / area is shown. Figure 5 , the two vertical lines in the figure are vertical line 1 and vertical line 2, the area to the left of vertical line 1 is the left boundary area, and the area to the right of vertical line 2 is the right boundary area. Figure 6 The two horizontal lines in the figure are horizontal line 1 and horizontal line 2, the area above horizontal line 1 is the upper boundary area, and the area below horizontal line 2 is the lower boundary area.

[0069] For a specific implementation method of determining each boundary area in the captured image in this application, please refer to Figure 7 As shown, it specifically includes the following implementation steps:

[0070] S1. Determine a starting point corresponding to a preset boundary direction according to the plurality of pixel regions, wherein the starting point is one of the center points of the plurality of pixel regions.

[0071] Specifically, if the preset boundary direction is the preset upper boundary direction, the starting point is a region center point with the smallest ordinate (e.g., Y-axis coordinate value) among the target region center points. If the preset boundary direction is the preset lower boundary direction, the starting point is a region center point with the largest ordinate among the target region center points. If the preset boundary direction is the preset left boundary direction, the starting point is a region center point with the smallest horizontal coordinate (e.g., X-axis coordinate value) among the target region center points. If the preset boundary direction is the preset right boundary direction, the starting point is a region center point with the largest horizontal coordinate among the target region center points. Among them, the target region center point is the region center point of at least one of the pixel regions in the captured image located in the preset image center area. The preset image center area is a system-defined setting, located in the middle / center area of ​​the captured image, and its size is not limited in this application. The region center point refers to the center point of the pixel region. If the pixel region is a region with a regular shape, the region center point is directly the center point of the pixel region. If the pixel region is an irregularly shaped region, the region center point may be the center point of the minimum circumscribed circle of the pixel region.

[0072] S2. Filtering out a target area point that meets a preset condition from the area center points of the plurality of pixel areas along a direction perpendicular to the preset boundary direction according to the starting point.

[0073] S3, taking the target area point as the starting point, and repeatedly executing the above step S2 until the area center points of multiple pixel areas are traversed.

[0074] S4. Determine the pixel areas corresponding to all the screened target area points and the starting point as corresponding boundary areas that match the preset boundary direction, which may specifically include but are not limited to an upper boundary area, a lower boundary area, a left boundary area, and a right boundary area.

[0075] The preset condition is a system-defined setting, which may include but is not limited to any one or more of the following combinations: the slope between the starting point and the target area point is within a preset slope range, the angle between the starting point and the target area point (i.e., the angle corresponding to the slope) is within a preset angle range, and the error value between the distance between the starting point and the target area point and a preset pixel spacing reference value is within a preset error range. The preset slope range is a system-defined setting, such as -1 to 1, etc. The preset angle range is a system-defined setting, for example, if the angle is 0 to 180° and the error can be between plus or minus 10°, then the preset angle range is -10° to 190°. The pixel spacing reference value is a system-defined setting in advance, such as pre-calculated according to actual needs, etc.

[0076] For example, see Figure 8 and Fig. 9 A possible search schematic diagram of the upper / lower boundary area and the left / right boundary area is shown respectively. Figure 8 A schematic diagram of searching the upper and lower boundary areas is shown. In the diagram, center point 1 is used as the starting point, and searches are performed in the left and right directions respectively, and target area points that meet the preset conditions are screened from the area center points of multiple pixel areas, wherein the numerical value between the points in the diagram represents the angle between the two points. Taking the starting point 1 and the area center point 2 in the diagram as an example, the angle between them is 60°, which is within the preset angle range, then the present application can determine that the pixel area corresponding to the area center point 2 is included in the upper boundary area. Similarly, the angle between the starting point 1 and the area center point 3 in the diagram is -60°, which is not within the preset angle range, then the present application can determine that the pixel area corresponding to the area center point 3 is not in the upper boundary area. XOY in the diagram represents a coordinate system, X represents the horizontal axis, referred to as the X-axis. Y represents the vertical axis, referred to as the Y-axis. O represents the origin of the coordinate system.

[0077] Similarly, if Fig. 9 A schematic diagram of searching for left and right boundary regions is shown in the figure. In the figure, center point 1 is used as the starting point, and searches are performed in the up and down directions to filter out target region points that meet preset conditions from the region center points of multiple pixel regions, where the numerical value between the points in the figure represents the angle between the two points. Taking starting point 1 and region center point 2 in the figure as an example, the angle between them is 120°, which is within the preset angle range. Then, the present application can determine that the pixel region corresponding to region center point 2 is included in the left boundary region, etc.

[0078] In an optional embodiment, the present application may first calculate the pixel spacing reference value. Specifically, the present application may first determine the target point, and the target point may be the starting point, or may be any area center point in the captured image located in the preset image center area. Further, the present application may calculate the pixel distance between the target point and the area center points of multiple pixel areas other than the target point, with the target point as the center, to obtain multiple pixel distances. Then, based on the multiple pixel distances, the corresponding pixel spacing reference value is calculated, for example, calculation processing such as averaging or finding the mode is performed on some or all of the multiple pixel distances, and the present application does not limit this.

[0079] For example, see Fig.10 FIG. 4 is a schematic diagram showing a possible calculation of a pixel spacing reference value. Figure 8 In the present application, m (m is equal to 6 in the figure) smallest values ​​among multiple pixel distances can be selected, and the average value of these 6 pixel distances can be calculated to obtain the corresponding pixel spacing reference value.

[0080] It should be noted that the upper boundary area is at least one area in the plurality of pixel areas located in a preset upper boundary direction. The lower boundary area is at least one area in the plurality of pixel areas located in a preset lower boundary direction. The left boundary area is at least one area in the plurality of pixel areas located in a preset left boundary direction. The right boundary area is at least one area in the plurality of pixel areas located in a preset right boundary direction.

[0081] Finally, after determining each boundary area, the present application can further determine the corresponding inner boundary area from each boundary area. Specifically, the present application can select the pixel area with the largest ordinate (maximum Y-axis value) of the center point of the region from the upper boundary area (specifically, each pixel area included in the upper boundary area) as the inner boundary area of ​​the upper boundary. The present application selects the pixel area with the smallest ordinate (minimum Y-axis value) of the center point of the region from the lower boundary area (specifically, each pixel area included in the lower boundary area) as the inner boundary area of ​​the lower boundary. The present application selects the pixel area with the largest horizontal coordinate (maximum X-axis value) of the center point of the region from the left boundary area (specifically, each pixel area included in the left boundary area) as the inner boundary area of ​​the left boundary. The present application can select the pixel area with the smallest horizontal coordinate (minimum X-axis value) of the center point of the region from the right boundary area (specifically, each pixel area included in the right boundary area) as the inner boundary area of ​​the right boundary.

[0082] S304: Calculate the field of view angle of the camera module according to the inner area of ​​the boundary.

[0083] In a specific implementation, the present application can calculate the field of view angle of the camera module along a preset first direction (also referred to as a vertical direction, i.e., the Y-axis direction in the above figure) according to the inner area of ​​the upper boundary and the inner area of ​​the lower boundary. Similarly, the present application can calculate the field of view angle of the camera module along a preset second direction (also referred to as a horizontal direction, i.e., the X-axis direction in the above figure) according to the inner area of ​​the left boundary and the inner area of ​​the right boundary.

[0084] Specifically, the present application can calculate the pixel width of the viewing angle of the camera module along the preset first direction according to the inner area of ​​the upper boundary and the inner area of ​​the lower boundary. Specifically, it can be the absolute value of the difference between the longitudinal coordinates of the center points of the inner area of ​​the upper boundary and the inner area of ​​the lower boundary. Furthermore, the present application can calculate the field of view of the camera module along the preset first direction according to the pixel width of the viewing angle in the preset first direction, the focal length of the lens corresponding to the captured image (i.e., the focal length of the lens of the camera), and the physical distance between the lens and the camera module.

[0085] Correspondingly, the present application can calculate the pixel width of the viewing angle of the camera module along the preset second direction (also referred to as the pixel distance) based on the inner area of ​​the left border and the inner area of ​​the right border. Specifically, it can be the absolute value of the difference between the horizontal coordinates of the center points of the inner area of ​​the left border and the inner area of ​​the right border. Further, the present application can calculate the field of view of the camera module along the preset second direction based on the lens focal length (i.e., the lens focal length of the camera) corresponding to the captured image and the physical distance between the lens and the camera module according to the pixel width of the viewing angle in the preset second direction.

[0086] In practical applications, the field of view angle can be calculated using the following formula (1):

[0087]

[0088] Among them, FOV is the field of view. pixel is the pixel width of the viewing angle. mm is the focal length of the lens. um is the unit pixel size, the unit is 1 micron. 1 is the distance between the camera lens and the diffuser. 2 is the distance between the camera module and the diffusion film.

[0089] For example, see Fig.11 FIG. 1 is a schematic diagram showing a possible FOV calculation result provided by an embodiment of the present application. Fig.11 As shown, F1 in the figure represents the calculated vertical field of view angle, which can be specifically 45.97581°. F2 in the figure represents the horizontal field of view angle, which can be specifically 63.175854°.

[0090] In an optional embodiment, the present application may test and determine the camera module to be tested according to the calculated field of view angle. Specifically, when the field of view angle (specifically, the field of view angle in the preset first direction and the field of view angle in the preset second direction) are both within the corresponding preset standard range, it can be determined that the quality of the camera module is relatively good, and the camera module is a high-quality module; otherwise, it is determined that the quality of the camera module is relatively poor, and the camera module is a low-quality module.

[0091] By implementing this application, the application obtains a captured image, determines multiple pixel areas in the captured image, and then determines the inner area of ​​the boundary according to the multiple pixel areas in the captured image, and finally calculates the field of view of the camera module according to the inner area of ​​the boundary. In this way, the area search algorithm can be easily used to determine the inner area of ​​the boundary from the captured image, and then the field of view of the camera module can be directly calculated based on the inner area of ​​the boundary, which is conducive to improving the convenience and efficiency of the field of view calculation, and also solves the technical problem that the test FOV calculation cannot be performed in the prior art, and realizes the fast and convenient calculation of the field of view.

[0092] Based on the same inventive concept, another embodiment of the present application provides an apparatus and a terminal device for implementing the method for calculating the field of view angle described in the embodiment of the present application.

[0093] See also Fig.12 , is a schematic diagram of the structure of a viewing angle calculation device provided in an embodiment of the present application. Fig.12 The device 100 shown includes: an acquisition module 1001, a determination module 1002 and a calculation module 1003, wherein:

[0094] The acquisition module 1001 is used to acquire a captured image, where the captured image is an image captured by the camera module to be tested;

[0095] The determination module 1002 is used to determine a plurality of pixel regions in the captured image, where the pixel region is a region where all adjacent pixels in the captured image whose grayscale values ​​exceed a preset threshold value are located;

[0096] The determination module 1002 is further configured to determine a boundary inner region according to a plurality of pixel regions in the captured image, wherein the boundary inner region is an innermost pixel region in the plurality of pixel regions in a preset boundary direction;

[0097] The calculation module 1003 is used to calculate the field of view angle of the camera module according to the inner area of ​​the boundary.

[0098] Optionally, the border inner area includes an upper border inner area, a lower border inner area, a left border inner area and a right border inner area, and the determining module 1002 is specifically used to:

[0099] Determine, according to a plurality of pixel regions in the captured image, a boundary region in the captured image located in the preset direction, wherein the boundary region includes at least one of the pixel regions;

[0100] The inner region of the boundary is determined from at least one of the pixel regions according to the position coordinates of the region center point of each of the pixel regions in the boundary region.

[0101] Optionally, the determining module 1002 is specifically configured to perform the following steps:

[0102] S1. Determine a starting point in the preset boundary direction, where the starting point is one of the center points of the plurality of pixel regions;

[0103] S2, selecting a target area point that meets a preset condition from the area center points of the plurality of pixel areas along a direction perpendicular to the preset boundary direction according to the starting point;

[0104] S3, taking the target area point as the starting point, and repeatedly executing step S2 until the traversal of the area center points of multiple pixel areas is completed;

[0105] S4. Determine the pixel area corresponding to the screened target area point and the starting point as a boundary area located in the preset boundary direction.

[0106] Optionally, the preset condition includes at least one of the following: the slope between the starting point and the target area point is within a preset slope range, the angle between the starting point and the target area point is within a preset angle range, and the error value between the distance between the starting point and the target area point and a preset pixel spacing reference value is within a preset error range.

[0107] Optionally,

[0108] The determination module 1002 is further used to determine a target point, where the target point is the starting point, or any area center point of the area center points of the plurality of pixel areas located in a preset image center area;

[0109] The calculation module 1003 is further used to calculate the pixel distance between the target point and the center points of the plurality of pixel areas;

[0110] The calculation module 1003 is further configured to calculate the pixel spacing reference value according to the calculated multiple pixel distances.

[0111] Optionally, the border inner area includes an upper border inner area, a lower border inner area, a left border inner area and a right border inner area, and the calculation module 1003 is specifically used to:

[0112] Calculating the field of view angle of the camera module along a preset first direction according to the inner area of ​​the upper boundary and the inner area of ​​the lower boundary;

[0113] The field of view angle of the camera module along a preset second direction is calculated according to the inner area of ​​the left border and the inner area of ​​the right border.

[0114] Optionally, the calculation module 1003 is specifically used for:

[0115] Calculating the viewing angle pixel width of the camera module along a preset first direction according to the inner area of ​​the upper boundary and the inner area of ​​the lower boundary;

[0116] The field of view angle of the camera module along the preset first direction is calculated according to the viewing angle pixel width of the camera module along the preset first direction and the focal length of the lens corresponding to the captured image.

[0117] Optionally, the calculation module 1003 is specifically used for:

[0118] Calculating the viewing angle pixel width of the camera module along a preset second direction according to the inner area of ​​the left border and the inner area of ​​the right border;

[0119] The field of view angle of the camera module along the preset second direction is calculated according to the viewing angle pixel width of the camera module along the preset second direction and the focal length of the lens corresponding to the captured image.

[0120] Optionally, the determining module 1002 is further configured to:

[0121] When the field of view angle is within a preset standard range, the camera module is determined to be a high-quality module.

[0122] Please refer to 13, which is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application. Fig.13 The terminal device 110 shown includes: at least one processor 1101, a communication interface 1102, a user interface 1103 and a memory 1104. The processor 1101, the communication interface 1102, the user interface 1103 and the memory 1104 can be connected via a bus or other means. The embodiment of the present invention takes the connection via a bus 1105 as an example.

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

[0124] The communication interface 1102 may be a wired interface (eg, an Ethernet interface) or a wireless interface (eg, a cellular network interface or a wireless local area network interface) for communicating with other terminals or websites. In the embodiment of the present invention, the communication interface 1102 is specifically used to obtain captured images.

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

[0126] The memory 1104 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 1104 may also include a combination of the above-mentioned types of memory. The memory 1104 is used to store a set of program codes, and the processor 1101 is used to call the program codes stored in the memory 1104 to perform the following operations:

[0127] Acquire a captured image, where the captured image is an image captured by the camera module to be tested;

[0128] Determine a plurality of pixel regions in the captured image, wherein the pixel regions are regions where all adjacent pixels in the captured image whose grayscale values ​​exceed a preset threshold value are located;

[0129] Determine a boundary inner region according to a plurality of pixel regions in the captured image, wherein the boundary inner region is an innermost pixel region in a preset boundary direction among the plurality of pixel regions;

[0130] The field of view angle of the camera module is calculated based on the inner area of ​​the boundary.

[0131] Optionally, determining the inner area of ​​the boundary according to the plurality of pixel areas in the captured image comprises:

[0132] Determine, according to a plurality of pixel regions in the captured image, a boundary region in the captured image located in the preset direction, wherein the boundary region includes at least one of the pixel regions;

[0133] The inner region of the boundary is determined from at least one of the pixel regions according to the position coordinates of the region center point of each of the pixel regions in the boundary region.

[0134] Optionally, determining a boundary area in the captured image located in the preset direction according to a plurality of pixel areas in the captured image comprises the following steps:

[0135] S1. Determine a starting point in the preset boundary direction, where the starting point is one of the center points of the plurality of pixel regions;

[0136] S2, selecting a target area point that meets a preset condition from the area center points of the plurality of pixel areas along a direction perpendicular to the preset boundary direction according to the starting point;

[0137] S3, taking the target area point as the starting point, and repeatedly executing step S2 until the traversal of the area center points of multiple pixel areas is completed;

[0138] S4. Determine the pixel area corresponding to the screened target area point and the starting point as a boundary area located in the preset boundary direction.

[0139] Optionally, the preset condition includes at least one of the following: the slope between the starting point and the target area point is within a preset slope range, the angle between the starting point and the target area point is within a preset angle range, and the error value between the distance between the starting point and the target area point and a preset pixel spacing reference value is within a preset error range.

[0140] Optionally, the processor 1101 is further configured to:

[0141] Determine a target point, where the target point is the starting point, or any area center point of a plurality of area center points of the pixel areas that is located in a preset image center area;

[0142] Calculating the pixel distance between the target point and the center points of the plurality of pixel areas;

[0143] The pixel spacing reference value is calculated according to the calculated multiple pixel distances.

[0144] Optionally, the inner boundary area includes an upper inner boundary area, a lower inner boundary area, a left inner boundary area, and a right inner boundary area, and calculating the field of view angle of the camera module according to the inner boundary area includes:

[0145] Calculating the field of view angle of the camera module along a preset first direction according to the inner area of ​​the upper boundary and the inner area of ​​the lower boundary;

[0146] The field of view angle of the camera module along a preset second direction is calculated according to the inner area of ​​the left border and the inner area of ​​the right border.

[0147] Optionally, calculating the field of view angle of the camera module along a preset first direction according to the inner area of ​​the upper boundary and the inner area of ​​the lower boundary includes:

[0148] Calculating the viewing angle pixel width of the camera module along a preset first direction according to the inner area of ​​the upper boundary and the inner area of ​​the lower boundary;

[0149] The field of view angle of the camera module along the preset first direction is calculated according to the viewing angle pixel width of the camera module along the preset first direction and the focal length of the lens corresponding to the captured image.

[0150] Optionally, calculating the field of view angle of the camera module along a preset second direction according to the inner area of ​​the left border and the inner area of ​​the right border includes:

[0151] Calculating the viewing angle pixel width of the camera module along a preset second direction according to the inner area of ​​the left border and the inner area of ​​the right border;

[0152] The field of view angle of the camera module along the preset second direction is calculated according to the viewing angle pixel width of the camera module along the preset second direction and the focal length of the lens corresponding to the captured image.

[0153] Since the terminal device introduced in this embodiment is a terminal device used to implement the method for calculating the field of view angle in the embodiment of the present application, based on the method for calculating the field of view angle in the embodiment of the present application, a person skilled in the art can understand the specific implementation of the terminal device of the present embodiment and its various variations, so how the terminal device implements the method in the embodiment of the present application is not described in detail here. As long as a terminal device used by a person skilled in the art to implement the method for information processing in the embodiment of the present application is adopted, it belongs to the scope of protection of this application.

[0154] The technical solution in the above-mentioned embodiment of the present application has at least the following technical effects or advantages: the present application obtains a captured image, determines a plurality of pixel areas in the captured image, and then determines the inner area of ​​the boundary according to the plurality of pixel areas in the captured image, and finally calculates the field of view of the camera module according to the inner area of ​​the boundary. In this way, the inner area of ​​the boundary can be easily determined from the captured image using the area search algorithm, and then the field of view of the camera module can be directly calculated based on the inner area of ​​the boundary, which is conducive to improving the convenience and efficiency of the calculation of the field of view, and also solves the technical problem that the test FOV calculation cannot be performed in the prior art, and realizes the fast and convenient calculation of the field of view.

[0155] 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.

[0156] 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.

[0157] 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.

[0158] 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. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0159] 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.

[0160] 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 a field of view angle, characterized in that: The method comprises: Acquire a captured image, where the captured image is an image captured by the camera module to be tested; Determine a plurality of pixel regions in the captured image, wherein the pixel regions are regions where all adjacent pixels in the captured image whose grayscale values ​​exceed a preset threshold value are located; Determine a boundary inner region according to a plurality of pixel regions in the captured image, wherein the boundary inner region is an innermost pixel region in a preset boundary direction among the plurality of pixel regions; Calculating the field of view of the camera module according to the inner area of ​​the boundary; The determining the inner area of ​​the boundary according to the plurality of pixel areas in the captured image comprises: Determine, according to a plurality of pixel regions in the captured image, a boundary region in a preset direction in the captured image, wherein the boundary region includes at least one of the pixel regions; Determine the inner region of the boundary from at least one of the pixel regions according to the position coordinates of the region center point of each of the pixel regions in the boundary region; Determining the boundary area in the captured image located in the preset direction according to the plurality of pixel areas in the captured image comprises the following steps: S1. Determine a starting point in the preset boundary direction, where the starting point is one of the center points of the plurality of pixel regions; S2, selecting a target area point that meets a preset condition from the area center points of the plurality of pixel areas along a direction perpendicular to the preset boundary direction according to the starting point; S3, taking the target area point as the starting point, and repeatedly executing step S2 until the traversal of the area center points of multiple pixel areas is completed; S4, determining the pixel area corresponding to the screened target area point and the starting point as a boundary area located in the preset boundary direction; The inner boundary area includes an upper inner boundary area, a lower inner boundary area, a left inner boundary area, and a right inner boundary area. The calculating of the field of view angle of the camera module according to the inner boundary area includes: Calculating the field of view angle of the camera module along a preset first direction according to the inner area of ​​the upper boundary and the inner area of ​​the lower boundary; The field of view angle of the camera module along a preset second direction is calculated according to the inner area of ​​the left border and the inner area of ​​the right border.

2. The method according to claim 1, characterized in that: The preset condition includes at least one of the following: the slope between the starting point and the target area point is within a preset slope range, the angle between the starting point and the target area point is within a preset angle range, and the error value between the distance between the starting point and the target area point and a preset pixel spacing reference value is within a preset error range.

3. The method according to claim 2, characterized in that The method further comprises: Determine a target point, where the target point is the starting point, or any area center point of a plurality of area center points of the pixel areas that is located in a preset image center area; Calculating the pixel distance between the target point and the center points of the plurality of pixel areas; The pixel spacing reference value is calculated according to the calculated multiple pixel distances.

4. The method according to claim 1, characterized in that: Calculating the field of view angle of the camera module along a preset first direction according to the inner area of ​​the upper boundary and the inner area of ​​the lower boundary includes: Calculating the viewing angle pixel width of the camera module along a preset first direction according to the inner area of ​​the upper boundary and the inner area of ​​the lower boundary; The field of view angle of the camera module along the preset first direction is calculated according to the viewing angle pixel width of the camera module along the preset first direction and the focal length of the lens corresponding to the captured image.

5. The method according to claim 4, characterized in that Calculating the field of view angle of the camera module along a preset second direction according to the inner area of ​​the left boundary and the inner area of ​​the right boundary includes: Calculating the viewing angle pixel width of the camera module along a preset second direction according to the inner area of ​​the left border and the inner area of ​​the right border; The field of view angle of the camera module along the preset second direction is calculated according to the viewing angle pixel width of the camera module along the preset second direction and the focal length of the lens corresponding to the captured image.

6. A terminal device, characterized in that: 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 field of view angle calculation method as described in any one of claims 1 to 5 above.

7. 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 field of view angle as described in any one of claims 1 to 5 is executed.

Citation Information

Patent Citations

  • Matching cost calculation method and apparatus, and parallax value calculation method and equipment

    CN105335952A

  • Beacon arranging and image processing method based on UAN (unmanned aerial vehicle) pose calculation

    CN107202982A