Camera imaging direction recognition method, computer device and storage device
By using camera equipment to photograph markers to identify the imaging direction, the problem of time-consuming, labor-intensive, and inaccurate imaging direction detection by camera equipment is solved, achieving efficient and accurate imaging direction recognition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-01
- Publication Date
- 2026-04-10
AI Technical Summary
In existing technologies, the imaging direction detection of camera equipment is time-consuming, labor-intensive, and prone to errors due to manual detection, resulting in low accuracy of imaging direction detection.
By using a camera to capture images of the configured markers, including pointing backgrounds and pointing signs, the background prediction region and pointing prediction region in the image are determined, and their positional relationship is used to identify the imaging direction of the camera.
It improves the accuracy of imaging direction recognition of camera equipment, has strong adaptability, and can accurately identify the imaging direction in various scenarios.
Smart Images

Figure CN115661231B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to a method for identifying the imaging direction of a camera device, a computer device and a storage device. BACKGROUND
[0002] With the improvement of people's living standards, camera devices are increasingly widespread in the public eye, such as for taking pictures, monitoring, video recording, etc., which can record life, things, etc.
[0003] When a user uses a camera device to take pictures, the camera of the camera device can image according to the imaging direction of the camera device to obtain a captured image. However, due to quality problems of the camera itself, factory batch assembly errors, etc., there are errors in some links in the production process of the camera device and the installation process of the camera, which causes the imaging direction of the final camera device to be wrong, so that the imaging direction of the camera is wrong when the camera collects images.
[0004] At present, the imaging direction of the camera device is usually detected manually, which requires a lot of manpower and time, is not convenient for detecting the imaging direction of the camera device, and manual detection is prone to visual errors, resulting in low accuracy of imaging direction detection. SUMMARY
[0005] The technical problem solved by the present application is to provide a method for identifying the imaging direction of a camera device, a computer device and a storage device, which can improve the accuracy of identifying the imaging direction of the camera device in various scenarios.
[0006] To solve the above problems, the first aspect of the present application provides a method for identifying the imaging direction of a camera device, which comprises: using the camera device to take pictures of a configured marker to obtain an imaging image; wherein the configured marker comprises a pointing background and a pointing identifier, the pointing identifier is arranged in the pointing background, and the pointing identifier represents a preset imaging direction of the camera device; determining at least one background prediction region corresponding to the pointing background and at least one pointing prediction region corresponding to the pointing identifier from the imaging image; using the positional relationship between the at least one background prediction region and the at least one pointing prediction region to find a pointing identifier region corresponding to the pointing identifier, so as to determine the imaging direction of the camera device by using the pointing identifier region.
[0007] To solve the above problems, the second aspect of the present application provides a computer device, which comprises a memory and a processor coupled to each other, the memory stores program data, and the processor is used to execute the program data to realize any step of the above-mentioned method for identifying the imaging direction of a camera device.
[0008] To solve the above problems, the third aspect of the present application provides a storage device, which stores program data capable of being run by a processor, and the program data is used to implement any step of the imaging direction recognition method of the camera.
[0009] The above scheme, by using the camera to shoot the configured marker, obtains an imaging image, since the configured marker includes a pointing background and a pointing identifier, the pointing identifier is arranged in the pointing background, and the pointing identifier represents a preset imaging direction of the camera, at least one background prediction region corresponding to the pointing background and at least one pointing prediction region corresponding to the pointing identifier can be determined from the imaging image, the prediction regions corresponding to the pointing background and the pointing identifier are obtained respectively, and the pointing identifier region corresponding to the pointing identifier is searched by using the positional relationship between the at least one background prediction region and the at least one pointing prediction region, so as to determine the imaging direction of the camera by using the pointing identifier region, which is adaptive and can improve the accuracy of the imaging direction recognition of the camera in various scenes. BRIEF DESCRIPTION OF DRAWINGS
[0010] In order to more clearly illustrate the technical solutions in the present application, the drawings needed in the embodiments will be briefly introduced as follows. Obviously, the drawings described below are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings. Among them:
[0011] Figure 1 is a flowchart of an embodiment of the imaging direction recognition method of the camera of the present application;
[0012] Figure 2 is a structural schematic diagram of an embodiment of the marker of the present application;
[0013] Figure 3 is a flowchart of an embodiment of step S12 in the present application Figure 1
[0014] Figure 4 is a schematic diagram of an embodiment of the gray-scale image of the present application;
[0015] Figure 5 is a schematic diagram of an embodiment of the background mask image of the present application;
[0016] Figure 6 is a schematic diagram of an embodiment of the identifier mask image of the present application;
[0017] Figure 7 is a schematic diagram of an embodiment of the background mask image subjected to morphological processing of the present application;
[0018] Figure 8 This is a schematic diagram of an embodiment of a morphologically processed identifier mask image of this application;
[0019] Figure 9 This is a schematic diagram of an embodiment of the background prediction region of this application;
[0020] Figure 10 This is a schematic diagram of an embodiment of the predicted region in this application;
[0021] Figure 11 This application Figure 1 A flowchart illustrating an embodiment of step S13;
[0022] Figure 12 This is a schematic diagram of an embodiment of the pointing identification image of this application;
[0023] Figure 13 This is a schematic diagram of an embodiment of a morphologically processed pointing identification area in this application;
[0024] Figure 14 This is a schematic diagram of an embodiment of the projected image pointing to the identification area in this application;
[0025] Figure 15 This is a schematic diagram of the structure of an embodiment of the imaging direction recognition device of the camera equipment of this application;
[0026] Figure 16 This is a schematic diagram of the structure of an embodiment of the computer device of this application;
[0027] Figure 17 This is a schematic diagram of the structure of an embodiment of the storage device of this application. Detailed Implementation
[0028] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0029] The terms "first", "second", etc. are used herein only to describe different instances, and cannot be construed as implying relative importance or implying a number of the technical features being pointed out. Thus, the features defined with "first", "second" can explicitly or implicitly include at least one of the features. In the description of the present application, the meaning of "a plurality of" is at least two, such as two, three, etc., unless otherwise explicitly and specifically limited. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but can optionally include steps or units not listed, or can optionally include other steps or units inherent to the process, method, product or device.
[0030] In the present application, referring to "embodiments" means that the specific features, structures or properties described in conjunction with the embodiments can be included in at least one embodiment of the present application. The phrase appears at various places in the specification does not necessarily refer to the same embodiment, nor is it independent or alternative to other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0031] The present application provides the following embodiments, which will be specifically described below.
[0032] Please refer to Figure 1 , Figure 1 is a flowchart of an embodiment of a method for identifying the imaging direction of a camera device. The method can include the following steps:
[0033] S11: capturing the configured marker by using the camera device to obtain an imaging image; wherein the configured marker includes a pointing background and a pointing identifier, the pointing identifier is arranged in the pointing background, and the pointing identifier represents a preset imaging direction of the camera device.
[0034] Before step S11, the marker can be configured in the environment where the camera device is located. The configured marker can include a pointing background and a pointing identifier, the pointing identifier can be arranged in the pointing background, the pointing background can be the background of the pointing identifier, the pointing identifier can represent the preset imaging direction of the camera device, and can be an article that can represent direction and pointing. Here, the pointing identifier and the pointing background can be relative article descriptions, which are not limited here.
[0035] In some embodiments, the pointing background and the pointing identifier can be different pixels (e.g., colors), for example, the pixel values of the pixel points of the pointing background and the pointing identifier exceed a preset pointing pixel threshold, so that the pixel color difference between the pixel points of the pointing background and the pointing identifier is large, and thus the pointing background and the pointing identifier can be easily distinguished or recognized.
[0036] In some embodiments, referring to Figure 2 , as an example, the marker 100100 includes a pointing background 101 and a pointing identifier 102. The pointing identifier 102 can be an arrow with a direction indication, such as a black arrow, a white arrow, a finger pointing identifier, etc. The pointing background 101 can be a white paper, a whiteboard or a blackboard, etc. The marker 100 can be a printed white paper with a black arrow, can be a whiteboard with a black arrow, a blackboard with a white arrow, etc., and the present application does not limit the marker 100.
[0037] The marker is placed in the field of view of the camera device, so that the configured marker can be photographed by the camera device to obtain an imaging image. Since there is a pixel color difference between the pointing background and the pointing identifier in the marker, even if the environment in which the camera device is located is a production line, the environment is complex, the marker in the imaging image and the surrounding things can be more obvious.
[0038] S12: Determine at least one background prediction region corresponding to the pointing background and at least one pointing prediction region corresponding to the pointing identifier from the imaging image, respectively.
[0039] The region where the marker is located can be determined from the imaging image. Among them, at least one background prediction region corresponding to the pointing background and at least one pointing prediction region corresponding to the pointing identifier can be determined respectively to find all possible positions of the pointing background and the pointing identifier.
[0040] In some embodiments, when determining at least one background prediction region corresponding to the pointing background, the pixel range of the pixel points of the pointing background of the configured marker can be used to find the region within the pixel range of the pointing background from the imaging image as the background prediction region, that is, all possible regions of the pointing background can be found from the imaging image.
[0041] It can be understood that the region within the pixel range of the pointing identifier can be found from the imaging image as the pointing prediction region based on the pixel range of the pixel points of the configured pointing identifier in the manner of finding the background prediction region from the imaging image, and all possible regions of the pointing identifier can be found from the imaging image.
[0042] S13: searching for a pointing mark area corresponding to the pointing mark based on the positional relationship between the at least one background prediction area and the at least one pointing prediction area, and determining the imaging direction of the camera device based on the pointing mark area.
[0043] The positional relationship between the at least one background prediction area and the at least one pointing prediction area can be used to find the position of the marker, that is, to determine the pointing background area and / or the pointing mark area from the imaging image.
[0044] In some embodiments, the pointing background area corresponding to the pointing background can be determined based on the positional relationship between the background prediction area and the pointing prediction area, and the pointing mark area corresponding to the pointing mark in the pointing background can be determined.
[0045] In some embodiments, the pointing mark area can be directionally identified, and the target imaging direction of the imaging image can be identified. Since the pointing mark represents the preset imaging direction of the camera device, the imaging direction of the camera device can be determined based on the target imaging direction and the preset imaging direction.
[0046] In this embodiment, the imaging image is obtained by capturing the configured marker by the camera device. Since the configured marker includes the pointing background and the pointing mark, the pointing mark is arranged in the pointing background, and the pointing mark represents the preset imaging direction of the camera device, at least one background prediction area corresponding to the pointing background and at least one pointing prediction area corresponding to the pointing mark can be determined from the imaging image, the prediction areas corresponding to the pointing background and the pointing mark are obtained, and the imaging direction of the camera device is determined based on the positional relationship between the at least one background prediction area and the at least one pointing prediction area and the pointing mark area. The pointing mark area is searched for, and the pointing mark area is used to determine the imaging direction of the camera device. The adaptability is high, and the accuracy of the imaging direction of the camera device in various scenes can be improved.
[0047] In some embodiments, referring to Figure 3 The step S12 of the above embodiment can be further extended. The at least one background prediction area corresponding to the pointing background and the at least one pointing prediction area corresponding to the pointing mark are determined from the imaging image. The embodiment can include the following steps:
[0048] S121: obtaining a background mask image corresponding to the pointing background and a mark mask image corresponding to the pointing mark based on the imaging image.
[0049] In some embodiments, referring to Figure 4The imaging image can be subjected to grayscale processing to obtain a grayscale image. The grayscale image can represent most features of the imaging image with less data, and can improve the efficiency of subsequent algorithm processing. The grayscale processing can include maximum grayscale processing, average grayscale processing, weighted average grayscale processing, or gamma correction weighted average grayscale processing, and the like. The specific manner of grayscale processing is not limited in the present application.
[0050] The grayscale image can be subjected to binarization processing to obtain a background mask image corresponding to the background and an identification mask image corresponding to the identification, respectively.
[0051] In some embodiments, when obtaining the background mask image corresponding to the background, a background grayscale threshold range corresponding to the background can be obtained. The background grayscale threshold range can be determined based on a configured pixel description value of the background. The pixel description value of the background can be a pixel range of a pixel of the configured marker pointing to the background, such as a grayscale value range of the pixel pointing to the background after grayscale conversion. The preset background grayscale threshold range can be determined based on the preset pixel description value of the background pointing to the background. The background grayscale threshold range can be represented as [Tp1, Tp2], where Tp1 is a first background grayscale threshold and Tp2 is a second background grayscale threshold. The first background grayscale threshold can be less than the second background grayscale threshold. In some application scenarios, the first background grayscale threshold and the second background grayscale threshold are preset values or statistical values. The present application is not limited in this regard.
[0052] The grayscale image is subjected to binarization processing, the grayscale value of a pixel in the grayscale image within the background grayscale threshold range is set to a first grayscale value, and the grayscale value of a pixel outside the background grayscale threshold range is set to a second grayscale value to obtain the background mask image. The first grayscale value can be 255, and the second grayscale value can be 0.
[0053] Referring to Figure 5 , for example, the grayscale value of a pixel in the grayscale image within the background grayscale threshold range [Tp1, Tp2] can be set to 255, i.e., white. The grayscale value of a pixel outside the background grayscale threshold range [Tp1, Tp2] is set to 0 to obtain the background mask image.
[0054] In some embodiments, when obtaining the identification mask image corresponding to the identification, an identification grayscale threshold range corresponding to the identification can be obtained. The identification grayscale threshold range can be determined based on a configured pixel description value of the identification pointing to the identification. For example, the identification grayscale threshold range can be represented as [Ta1, Ta2], where Ta1 represents a first identification grayscale threshold and Ta2 represents a second identification grayscale threshold. The first identification grayscale threshold is less than the second identification grayscale threshold.
[0055] Referring to Figure 6 The gray scale value of the pixel points in the gray scale image located in the gray scale threshold range [Ta1, Ta2] can be set as a third gray scale value, and the gray scale value of the pixel points located outside the gray scale threshold range [Ta1, Ta2] can be set as a fourth gray scale value to obtain the identification mask image. The third gray scale value can be 255, and the fourth gray scale value can be 0.
[0056] In some embodiments, referring to Figure 7 and Figure 8 The background mask image and the identification mask image can also be respectively subjected to morphological processing to obtain a background mask image and an identification mask image subjected to morphological processing. The morphological processing includes an opening operation. The opening operation is a process of sequentially subjecting an image to an erosion process and a dilation process using the same structural element. After the image is subjected to the erosion process, noise is removed, but the image is also compressed. Then, the image subjected to the erosion process is subjected to the dilation process to remove noise and retain the original image. The opening operation can eliminate the part of the image smaller than the structural element and disconnect the narrow neck.
[0057] S122: Determine at least one background prediction region corresponding to the background by using the contour features in the background mask image.
[0058] Referring to Figure 9 A plurality of first contour features in the background mask image can be obtained, and the background mask image can be a background mask image subjected to morphological processing. A first circumscribed rectangular frame corresponding to each first contour feature is determined based on the plurality of first contour features. The first circumscribed rectangular frame can be a circumscribed rectangular frame corresponding to the first contour feature.
[0059] The first circumscribed rectangular frame satisfying the background frame condition is taken as the background prediction region 201, and the background frame condition can include that the width of the first circumscribed rectangular frame is greater than or equal to the first width paper_w and the height is greater than or equal to the first height paper_h. In this way, the first circumscribed rectangular frame with a width less than paper_w or a height less than paper_h can be removed, and each first circumscribed rectangular frame satisfying the background frame condition is taken as the background prediction region 201, so that a plurality of background prediction regions 201 corresponding to the background can be obtained.
[0060] In the above manner, at least one background prediction region corresponding to the background is determined by using the contour features in the background mask image, so that a plurality of background prediction regions corresponding to the background in the imaging image can be quickly found.
[0061] S123: Determine at least one pointing prediction region corresponding to the identification by using the contour features in the identification mask image.
[0062] Referring to Figure 10 , a plurality of second contour features in the identification mask image are obtained, wherein the identification mask image can be a morphologically processed identification mask image. A second circumscribed rectangle corresponding to each second contour feature is determined, and each second circumscribed rectangle that satisfies a pointing frame condition can be used as a pointing prediction region 301.
[0063] The pointing frame condition can include that the width of the second circumscribed rectangle is greater than or equal to a second width arrow_w and the height is greater than or equal to a second height arrow_h. In this way, second circumscribed rectangles with a width less than arrow_w or a height less than arrow_h can be removed, and each second circumscribed rectangle that satisfies the pointing frame condition can be used as a pointing prediction region 301, so that a plurality of pointing prediction regions 301 corresponding to the pointing identification can be obtained.
[0064] In the above manner, the contour features in the identification mask image are used to determine at least one pointing prediction region corresponding to the pointing identification, so that a plurality of pointing prediction regions corresponding to the pointing identification in the imaging image can be quickly found.
[0065] In some embodiments, referring to Figure 11 , step S13 of the above embodiments can be further extended. The imaging direction of the camera device is determined based on the positional relationship between the at least one background prediction region and the at least one pointing prediction region. The present embodiment can include the following steps:
[0066] S131: Determine a background prediction region whose positional relationship satisfies a matching condition based on the positional relationship between each background prediction region and each pointing prediction region.
[0067] Each background prediction region and each pointing prediction region can be matched, and the positional relationship between the background prediction region and the pointing prediction region is obtained based on the positional coordinate information of the background prediction region and the pointing prediction region, such as inclusion relationship, overlapping relationship, and disjoint relationship, so as to determine whether the background prediction region and the pointing prediction region satisfy the matching condition.
[0068] In some embodiments, the matching condition includes that the pointing prediction region is located in the background prediction region. If the pointing prediction region is located in the background prediction region, i.e., the positional relationship between the background prediction region and the pointing prediction region is an inclusion relationship, it is determined that the matching condition is satisfied, and the background prediction region can be retained, so that one or more background prediction regions can be obtained.
[0069] S132: Determine a pointing identification region based on the background prediction region that satisfies the matching condition.
[0070] From the background prediction area satisfying the matching condition, a pointing background area is determined. For example, the background prediction area corresponding to the first circumscribed rectangular frame with the largest area can be selected as the pointing background area. In this way, the pointing background area can be determined based on the positional relationship between the background prediction area and the pointing prediction area, and the position of the pointing background in the image can be quickly determined from the imaging image.
[0071] The pointing sign image is determined from the imaging image, the grayscale image, or the sign mask image based on the position (such as the coordinate position) of the background area in the imaging image. If the pointing sign image is determined from the imaging image, subsequent grayscale processing and binarization processing of the pointing sign image are required. If the pointing sign image is determined from the grayscale image, subsequent binarization processing of the pointing sign image is required. The present application does not limit this.
[0072] In some embodiments, referring to Figure 12 The pointing sign image can be cropped from the sign mask image based on the position (such as the coordinate position) of the background area in the imaging image. In this way, the approximate position of the pointing sign in the image can be determined.
[0073] In some embodiments, the third contour feature satisfying the pointing sign condition can be selected from the plurality of third contour features in the pointing sign image based on the contour area of the plurality of third contour features. The pointing sign condition can include the largest contour area, and the third contour feature with the largest contour area is selected.
[0074] Then, the region where the pointing sign is located can be drawn based on the selected third contour feature, that is, the third contour feature with the largest contour area, to obtain the pointing sign region corresponding to the pointing sign.
[0075] In some embodiments, referring to Figure 13 After obtaining the pointing sign region, morphological processing can be performed on the pointing sign region to obtain a morphologically processed pointing sign region, that is, a mask image of the region where the pointing sign is located. The morphological processing includes closing operation. The closing operation first dilates the pointing sign region using a structure element, and then erodes the dilated result using the structure element. The closing operation can smooth the image by filling the concave corners of the pointing sign region.
[0076] S133: The pointing sign region is directionally recognized based on the pixel distribution rule of the pixel points of the pointing sign region to obtain a target imaging direction of the imaging image.
[0077] The pointing sign region is projected in a preset direction, and the preset direction is perpendicular to the preset imaging direction. Referring to Figure 14For example, taking the vertical direction as an example, if the preset imaging manner represented by the pointing identifier is vertical downward (or pointing downward), the preset direction for projection can be horizontal, that is, horizontal projection is performed, and a projection image of the pointing identifier region can be obtained.
[0078] It can be understood that if the preset imaging manner is horizontal, such as horizontal left or horizontal right (or left-right orientation), the preset direction for projection can be vertical, that is, vertical projection is performed. If the preset imaging manner is a direction at a preset angle, the preset direction for projection can be a direction perpendicular to the preset angle, which is not limited in the present application.
[0079] Thus, the preset pixel point in the projected pointing identifier region can be obtained. The preset pixel point is a pixel point with a preset gray value in the pointing identifier region after grayscale processing and binarization processing, that is, the preset pixel point can be a pixel point with a first gray value, that is, a white pixel point.
[0080] In some embodiments, the number of preset pixel points in each row in the projected pointing identifier region can be obtained, and thus the pixel distribution rule of the preset pixel points in the pointing identifier region can be obtained based on the number of preset pixel points in each row.
[0081] In some embodiments, the pixel distribution rule includes the distribution of the preset pixel points in the preset imaging direction, or the change of the number of preset pixel points in the preset imaging direction. Thus, the target imaging direction of the imaging image corresponding to the pixel distribution rule can be determined.
[0082] For example, taking the number of preset pixel points in each row as an example, the pixel distribution rule includes the change rule of the number of preset pixel points in each row in the vertical downward direction, which is: no preset pixel point, preset pixel point, no preset pixel point, and in the vertical direction, the number of preset pixel points in each row is close to each other and is within a preset number range, the number of preset pixel points increases (suddenly), and the number of preset pixel points gradually decreases. The preset range can represent a value close in number, such as 0-5, which is not limited in the present application. It can be determined that the target imaging manner of the imaging image is vertical downward.
[0083] For example, taking the number of preset pixels in each row as an example, the pixel distribution rule includes the change rule of the number of preset pixels in each row in the vertical downward direction, which is: no preset pixels, preset pixels, and no preset pixels in turn, and in the vertical direction, the number of preset pixels gradually increases, the number of preset pixels decreases (suddenly), and the number of multiple rows of preset pixels close to each other is kept within a preset range, wherein the preset range can be represented by a value close in number, such as 0-5, which is not limited in the present application. It can be determined that the target imaging mode of the imaging image is vertical upward. It can be understood that other directions and the determination method of the above target imaging mode are the same, and details are not repeated here.
[0084] S134: Determine the imaging direction of the camera device based on the preset imaging direction represented by the pointing identifier and the target imaging direction of the imaging image.
[0085] If the preset imaging direction represented by the pointing identifier and the target imaging direction of the imaging image are consistent, the target imaging direction or the preset imaging direction can be determined as the imaging direction of the camera device.
[0086] If the preset imaging direction represented by the pointing identifier and the target imaging direction of the imaging image are opposite, the target imaging direction can be determined as the imaging direction of the camera device.
[0087] In the embodiment, by using the positional relationship between each background prediction region and each pointing prediction region, the background prediction region satisfying the matching condition is determined, the pointing identifier region is determined based on the background prediction region satisfying the matching condition, the direction of the pointing identifier region is identified by using the pixel distribution rule of the pixel points of the pointing identifier region, and the target imaging direction of the imaging image is obtained, so as to determine the imaging direction of the camera device. The step of determining the target imaging direction of the imaging image can be simplified, and the method is simple and reliable. In addition, without relying on obtaining the fine region of the pointing identifier in the imaging image, the target imaging direction of the imaging image can also be accurately identified, which can improve the adaptability of the imaging direction recognition method of the camera device and improve the accuracy of the imaging direction recognition of the camera device in various scenes.
[0088] For the above embodiment, the present application provides a camera device imaging direction recognition device. Please refer to Figure 15 , Figure 15 is a structural schematic diagram of an embodiment of the camera device imaging direction recognition device of the present application. The camera device imaging direction recognition device 20 includes a shooting module 21, a region module 22, and a direction module 23.
[0089] The photographing module 21 is configured to photograph the configured marker by using the camera device to obtain an imaging image, wherein the configured marker comprises a pointing background and a pointing mark, the pointing mark is arranged in the pointing background, and the pointing mark represents a preset imaging direction of the camera device.
[0090] The region module 22 is configured to determine at least one background prediction region corresponding to the pointing background and at least one pointing prediction region corresponding to the pointing mark from the imaging image.
[0091] The direction module 23 is configured to find a pointing mark region corresponding to the pointing mark by using a positional relationship between the at least one background prediction region and the at least one pointing prediction region, and determine the imaging direction of the camera device by using the pointing mark region.
[0092] The specific implementation of the embodiment can refer to the implementation process of the above-mentioned embodiment, which will not be described here.
[0093] For the above-mentioned embodiment, the present application provides a computer device, please refer to Figure 16 , Figure 16 is a structural schematic diagram of an embodiment of the computer device of the present application. The computer device 30 comprises a memory 31 and a processor 32, wherein the memory 31 and the processor 32 are coupled to each other, the memory 31 stores program data, and the processor 32 is configured to execute the program data to realize the steps of any embodiment of the above-mentioned camera device imaging direction recognition method.
[0094] In the embodiment, the processor 32 can also be referred to as a CPU (Central Processing Unit, central processing unit). The processor 32 can be an integrated circuit chip with signal processing capability. The processor 32 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor 32 can also be any conventional processor or the like.
[0095] The specific implementation of the embodiment can refer to the implementation process of the above-mentioned embodiment, which will not be described here.
[0096] For the above-mentioned method, it can be realized in the form of a computer program, and thus the present application provides a storage device, please refer to Figure 17 , Figure 17 is a structural schematic diagram of an embodiment of the storage device of the present application. The storage device 40 stores program data 41 capable of being executed by a processor, and the program data 41 can be executed by the processor to realize the steps of any embodiment of the above-mentioned camera device imaging direction recognition method.
[0097] The storage device 40 of the embodiment can be a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc., which can store the program data 41, or can also be a server storing the program data, which can send the stored program data 41 to other devices for running, or can also run the stored program data 41 itself.
[0098] The specific implementation of the embodiment can refer to the implementation process of the above-described embodiment, which will not be described here again.
[0099] In several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic, for example, the division of the modules or units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0100] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., they can be located in one place or distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the present embodiment.
[0101] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The above integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0102] If the integrated unit is realized in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage device, which is a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part of the prior art that makes a contribution or the whole or part of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of instructions for making an electronic device (which can be a personal computer, a server, or a network device, etc.) or a processor execute all or part of the steps of the method of each embodiment of the present application.
[0103] It is apparent that those skilled in the art should understand that the modules or steps of the present application described above can be realized by general computing devices, which can be centralized on a single computing device or distributed on a network composed of multiple computing devices, and optionally, they can be realized by program codes executable by computing devices, so that they can be stored in storage devices and executed by computing devices, or they can be respectively manufactured into individual integrated circuit modules, or multiple modules or steps among them can be manufactured into a single integrated circuit module to realize. Thus, the present application is not limited to any specific combination of hardware and software.
[0104] The above description is only an embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent process transformation using the content of the specification and drawings, or direct or indirect application in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method of recognizing an imaging direction of an imaging device, characterized by, The method comprises: photographing a configured marker by using a camera device to obtain an imaging image, wherein the configured marker comprises a pointing background and a pointing identifier, the pointing identifier is arranged in the pointing background, and the pointing identifier represents a preset imaging direction of the camera device; determining at least one background prediction region corresponding to the pointing background and at least one pointing prediction region corresponding to the pointing identifier from the imaging image respectively; finding a pointing identifier region corresponding to the pointing identifier by using a positional relationship between the at least one background prediction region and the at least one pointing prediction region, so as to determine the imaging direction of the camera device by using the pointing identifier region, comprising: determining a background prediction region that satisfies a matching condition by using a positional relationship between each background prediction region and each pointing prediction region; determining a pointing identifier region corresponding to the pointing identifier based on the background prediction region that satisfies the matching condition; performing direction recognition on the pointing identifier region by using a pixel distribution rule of pixel points of the pointing identifier region to obtain a target imaging direction of the imaging image; and determining the imaging direction of the camera device based on the preset imaging direction represented by the pointing identifier and the target imaging direction of the imaging image.
2. The method of claim 1, wherein, The method comprises: acquiring a background mask image corresponding to the pointing background and an identifier mask image corresponding to the pointing identifier by using the imaging image; determining the at least one background prediction region corresponding to the pointing background by using contour features in the background mask image; and determining the at least one pointing prediction region corresponding to the pointing identifier by using contour features in the identifier mask image.
3. The method of claim 2, wherein, The method comprises: performing grayscale processing on the imaging image to obtain a grayscale image; performing binarization processing on the grayscale image respectively to obtain the background mask image corresponding to the pointing background and the identifier mask image corresponding to the pointing identifier.
4. The method of claim 3, wherein, The method comprises: acquiring a background grayscale threshold range corresponding to the pointing background, wherein the background grayscale threshold range is determined based on pixel description values of the configured pointing background; setting a grayscale value of a pixel point in the grayscale image within the background grayscale threshold range as a first grayscale value and setting a grayscale value of a pixel point outside the background grayscale threshold range as a second grayscale value to obtain the background mask image; and acquiring a pointing grayscale threshold range corresponding to the pointing identifier, wherein the pointing grayscale threshold range is determined based on pixel description values of the configured pointing identifier. Set a third gray value to the gray value of the pixel points in the gray image within the pointing gray threshold range, and set a fourth gray value to the gray value of the pixel points outside the pointing gray threshold range, to obtain the identification mask image.
5. The method of claim 2, wherein, The contour feature in the background mask image is used to determine at least one background prediction region corresponding to the pointing background, including: Obtain a plurality of first contour features in the background mask image, determine a first circumscribed rectangular frame corresponding to each of the first contour features, and take the first circumscribed rectangular frame meeting the background frame condition as the background prediction region. The contour feature in the identification mask image is used to determine at least one pointing prediction region corresponding to the pointing identification, including: Obtain a plurality of second contour features in the identification mask image, determine a second circumscribed rectangular frame corresponding to each of the second contour features, and take the second circumscribed rectangular frame meeting the pointing frame condition as the pointing prediction region.
6. The method of claim 2, wherein, After the background mask image corresponding to the pointing background and the identification mask image corresponding to the pointing identification are obtained from the imaging image, including: Perform morphological processing on the background mask image and the identification mask image to obtain the background mask image and the identification mask image after morphological processing; wherein the morphological processing includes an opening operation.
7. The method of claim 1, wherein, The matching condition includes: the pointing prediction region is located within the background prediction region; and / or, The pointing identification region corresponding to the pointing identification is determined based on the background prediction region meeting the matching condition, including: Determine the pointing background region from the background prediction region meeting the matching condition; Determine the pointing identification image using the location of the background region in the imaging image; Select a third contour feature meeting the pointing identification condition from a plurality of third contour features in the pointing identification image based on the contour area of the plurality of third contour features, and obtain the pointing identification region corresponding to the pointing identification using the selected third contour feature.
8. The method of claim 1, wherein, The pointing identification region is directionally identified using the pixel distribution rule of the pixel points of the pointing identification region, to obtain the target imaging direction of the imaging image, including: Project the pointing identification region in a preset direction, and obtain a preset pixel point in the projected pointing identification region; wherein the preset direction is perpendicular to the preset imaging direction, and the preset pixel point is a pixel point with a preset gray value in the pointing identification region after grayscale processing and binary processing; Obtain the pixel distribution rule of the preset pixel point in the pointing identification region, and determine the target imaging direction of the imaging image corresponding to the pixel distribution rule; wherein the pixel distribution rule includes the distribution of the preset pixel point in the preset imaging direction, or the change of the number of the preset pixel point in the preset imaging direction.
9. A computer device, comprising: A computer program product comprising a storage medium readable by a machine and storing program data, the program data comprising instructions executable by the machine for performing the steps of the method according to any one of claims 1 to 8.
10. A memory device, comprising: A computer program product comprising a storage medium readable by a machine and storing program data, the program data comprising instructions executable by the machine for performing the steps of the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
System and method for detecting screen orientation of a device
US11270668B1