Method, storage medium and device for detecting camera installation angle
By comparing the standard image with the detected object image in the detected image, the problem that the camera installation angle in the prior art depends on subjective judgment, and the effect of accurately judging and adjusting the camera installation angle is achieved.
Patent Information
- Application Number
- CN202211098141.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-08
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2042-09-08
AI Technical Summary
In the prior art, the installation angle of the camera often depends on the subjective judgment of the installer, and there is a possibility of misjudgment, resulting in inaccurate installation angle.
By comparing the pre-stored standard image with the image of the detecting object in the detection image, it is determined whether there is a deviation in the installation angle of the camera, and information on adjusting the installation angle is output.
It realizes accurate judgment of whether there is a deviation in the camera installation angle, avoids misjudgment caused by subjective judgment, and ensures the accuracy of the installation angle.
Smart Images

Figure CN115604568B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of household appliances, and in particular to a method, storage medium and device for detecting the installation angle of a camera. Background Art
[0002] With the advancement of science and technology, users have higher and higher requirements for refrigeration equipment, and intelligent transformation has become a new research and development direction for refrigeration equipment. Intelligent refrigeration equipment is generally equipped with an image recognition system. The image recognition system usually includes an image acquisition module. The image acquisition module includes a camera, which is used to collect images of items stored in the refrigeration equipment. The refrigeration equipment recognizes and manages the items stored in its storage space by identifying the items in the image of the items. In the prior art, the installation of the camera is often based on the subjective judgment of the installer's naked eye that the installation angle is incorrect. This design has the following defects: it is too subjective, and there may be misjudgments that lead to inaccurate camera installation angles. Summary of the invention
[0003] The object of the present invention is to provide a method, storage medium and device for detecting the installation angle of a camera. By comparing the image of the detection object in the standard image and the detection image, it is possible to accurately determine whether there is a deviation in the installation angle of the camera.
[0004] To achieve the above-mentioned object of the invention, an embodiment of the present invention provides a method for detecting the installation angle of a camera, which includes:
[0005] Acquire a pre-stored standard image, wherein the standard image is an image obtained by photographing a detection object located at a preset position of the accommodating space when the installation position of the camera on the installation surface of the accommodating space is at a standard installation angle;
[0006] When the camera is installed at the installation position of the installation surface, the camera is controlled to photograph the detection object and obtain a detection image;
[0007] Comparing the standard image with the image of the detection object in the detection image to determine whether there is a deviation in the installation angle of the camera;
[0008] If so, output information for adjusting the installation angle of the camera.
[0009] As a further improvement of an embodiment of the present invention, “comparing the image of the detection object in the standard image and the detection image to determine whether there is a deviation in the installation angle of the camera” includes:
[0010] Compare whether there is a position deviation and / or a shape deviation of the detection object in the detection image relative to the detection object in the standard image.
[0011] As a further improvement of an embodiment of the present invention, wherein:
[0012] The accommodating space includes a mounting surface, an opposing surface spaced apart from the mounting surface, a first surface and a second surface connecting the mounting surface and the opposing surface, the first surface and the second surface intersect, an intersection line of the first surface and the opposing surface is a first edge, and an intersection line of the second surface and the opposing surface is a second edge.
[0013] The camera can be rotated toward or away from the first surface to adjust the installation angle, and the camera can be rotated toward or away from the second surface to adjust the installation angle.
[0014] The detection object is a strip, and the strip extends obliquely on the first surface from an intersection point close to the first edge and the second edge.
[0015] As a further improvement of an embodiment of the present invention, wherein the position deviation includes a relative angle deviation, “comparing whether there is a position deviation and / or shape deviation of the detection object in the detection image relative to the image of the detection object in the standard image, and determining whether there is a deviation in the installation angle of the camera” includes:
[0016] Acquire a standard relative angle between the strip and the second edge in the standard image;
[0017] Acquire a detection relative angle between the strip and the second edge in the detection image;
[0018] Obtaining a relative angle deviation value between the detected relative angle and the standard relative angle;
[0019] If the relative angle deviation value between the detected relative angle and the standard relative angle is greater than a preset angle value, and the detected relative angle is greater than the standard relative angle, outputting information for adjusting the installation angle of the camera by rotating toward the second surface;
[0020] If the relative angle deviation value between the detected relative angle and the standard relative angle is greater than the preset angle value, and the detected relative angle is smaller than the standard relative angle, information for adjusting the installation angle of the camera by rotating away from the second surface is output.
[0021] As a further improvement of an embodiment of the present invention, wherein:
[0022] The method for obtaining the standard relative angle or the detected relative angle includes:
[0023] Obtaining pixel coordinates of pixel points of the strip in the standard image or the detection image, wherein the pixel coordinates are coordinates in an image coordinate system in units of pixels, wherein the image coordinate system includes a coordinate axis u and a coordinate axis v, wherein the coordinate axis v extends along the first edge, and the coordinate axis u extends along the second edge;
[0024] Obtaining a first pixel point with the smallest v coordinate and a second pixel point with the largest v coordinate in the pixel coordinates of the strip;
[0025] Take a first average pixel coordinate of the pixel coordinates of all the strips within a distance of F pixels from the first pixel point along the positive direction of the coordinate axis v;
[0026] Taking a second average pixel coordinate of the pixel coordinates of all the strips within a distance of F pixels from the second pixel point along the negative direction of the coordinate axis v;
[0027] The standard relative angle or the detected relative angle of the strip with respect to the second edge is calculated according to the first average pixel coordinate and the second average pixel coordinate.
[0028] As a further improvement of an embodiment of the present invention, wherein:
[0029] If the angle deviation value between the detected relative angle and the standard relative angle is less than or equal to the preset angle value, then the average value u of the u coordinates of all pixel coordinates of the strip with the v coordinate v1 in the standard image is obtained. 检测 , obtain the u coordinate average value u of all pixel coordinates of the strip with v coordinate v1 in the detection image 标准 ;
[0030] Get the u 检测 and the u 标准 Position deviation value;
[0031] If the u 检测 and the u 标准 The position deviation value of is greater than the preset pixel value, and the u 检测 Greater than u 标准 , then output information for adjusting the installation angle of the camera by rotating away from the first surface;
[0032] If the u 检测 and the u 标准 The position deviation value of is greater than the preset pixel value, and the u 检测 Less than or equal to u 标准 , then output information for adjusting the installation angle of the camera by rotating toward the first surface.
[0033] As a further improvement of an embodiment of the present invention, wherein,
[0034] The width of the bar-shaped strip is M pixel points, 5 ≤ M ≤ 20, 10 < F < 100, the preset angle value is any value between [0.5°, 1°], and the preset pixel value is P pixel points, 10 ≤ P ≤ 20.
[0035] As a further improvement of an embodiment of the present invention, wherein the shape deviation includes a length deviation, and the method further includes:
[0036] If the angle deviation value between the detected relative angle and the standard relative angle is less than or equal to the preset angle value, obtain the detected length value of the bar-shaped strip in the detected image, and obtain the standard length value of the standard line segment in the standard image;
[0037] Obtain the length deviation value between the detected length value and the standard length value;
[0038] Obtain the ratio of the length deviation value to the standard length value;
[0039] If the ratio of the length deviation value to the standard length value is greater than the preset ratio and the detected length value is greater than the standard length value, output information for rotating and adjusting the installation angle of the camera away from the first surface;
[0040] If the ratio of the length deviation value to the standard length value is greater than the preset ratio and the detected length value is less than the standard length value, output information for rotating and adjusting the installation angle of the camera towards the first surface.
[0041] As a further improvement of an embodiment of the present invention, wherein,
[0042] The preset ratio is 0.1.
[0043] To achieve the above-mentioned invention purpose, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps in the method for detecting the installation angle of a camera described in any of the above embodiments are implemented.
[0044] To achieve the above-mentioned invention purpose, an embodiment of the present invention provides a refrigeration device, wherein the refrigeration device includes an image recognition system, the image recognition system includes a memory and a processor, the memory stores a computer program that can run on the processor, and when the processor executes the computer program, the steps in the method for detecting the installation angle of a camera described in any of the above embodiments are implemented.
[0045] As a further improvement of one embodiment of the present invention, the refrigeration equipment includes a box body and a door body pivotably arranged on the box body, the accommodating space is formed inside the door body, the accommodating space includes an upper wall, a bottom wall, a left wall, and a right wall, the camera is installed on the upper wall, the left wall or the right wall of the accommodating space is removably covered with a tooling plate, the surface of the tooling plate facing the accommodating space is provided with a strip belt, the strip belt is red, green or blue, and the strip belt extends along the diagonal of the tooling plate.
[0046] Compared with the prior art, the present invention has the beneficial effect of being able to accurately determine whether there is a deviation in the installation angle of the camera by comparing the image of the detection object in the standard image and the detection image. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 is a schematic structural diagram of a refrigeration device according to an embodiment of the present invention;
[0048] Figure 2 yes Figure 1 A schematic diagram of the structure of the refrigeration equipment accommodation space shown;
[0049] Figure 3 yes Figure 1 The structural schematic diagram of the refrigeration equipment tooling plate shown;
[0050] Figure 4 is a schematic diagram of a standard image and a detection image according to an embodiment of the present invention;
[0051] Figure 5 It is a flow chart of a method for detecting a camera installation angle according to an embodiment of the present invention. DETAILED DESCRIPTION
[0052] The present invention will be described in detail below in conjunction with the specific embodiments shown in the accompanying drawings. However, these embodiments do not limit the present invention, and any structural, methodological, or functional changes made by a person skilled in the art based on these embodiments are all within the scope of protection of the present invention.
[0053] Reference Figure 1 and Figure 2 In one embodiment of the present invention, a refrigeration device 100 is provided, and the refrigeration device 100 may be a refrigerator, a freezer, a commercial display cabinet, etc. The refrigeration device 100 may include a box body 2 and a door body 3 pivotably disposed on the box body 2. A storage space 1 for storing items may be provided in the refrigeration device 100. The storage space 1 may be formed inside the box body 2, such as a refrigerator compartment or a freezer compartment disposed in the box body 2, or may be formed on the door body 3, such as a bottle holder structure or a door compartment disposed in the door body 3.
[0054] The accommodating space 1 may be provided with an opening 4 for taking in and putting in items.
[0055] In this embodiment, the front may refer to the direction toward which the opening 4 of the accommodating space 1 faces. The rear may refer to the direction away from the opening 4 of the accommodating space 1. The left may refer to the left hand side of a person when the person faces the opening 4 of the accommodating space 1. The right may refer to the right hand side of a person when the person faces the opening 4 of the accommodating space 1. The top may refer to the position where the top of the refrigeration device 100 is located. The bottom may refer to the position where the bottom of the refrigeration device 100 is located.
[0056] A camera 5 may be provided in the refrigeration device 100, and the camera 5 may be used to photograph items stored in the accommodating space 1. One camera 5 may be provided in the accommodating space 1, or a plurality of cameras 5 may be provided.
[0057] The accommodating space 1 may be provided with an installation surface 6 for installing the camera 5. The installation surface 6 may be formed by the side walls of the accommodating space 1, for example, the upper wall 101, the bottom wall 102, the rear wall 105, the left side wall 103, the right side wall 104, etc. of the accommodating space 1.
[0058] The mounting surface 6 may be provided with a mounting position 9 for mounting the camera 5. The mounting angle of the camera 5 at the mounting position 9 of the mounting surface 6 may be adjustable. The shooting range of the camera 5 may be adjusted by adjusting the mounting angle of the camera 5 so that the shooting range of the camera 5 meets the use requirements.
[0059] There are many ways to adjust the installation angle of the camera 5 at the installation position 9. For example, a remotely controlled angle adjustment structure can be provided, and the camera 5 can be rotated by operating the angle adjustment structure to adjust the installation angle of the camera 5. For another example, if the camera 5 is fixed, the installation angle of the camera 5 can be adjusted manually, for example, the installer can adjust the shooting angle of the camera 5 by raising a certain part of the installation position 9.
[0060] Reference Figure 4 and Figure 5 Furthermore, in this embodiment, a method for detecting the installation angle of the camera 5 is provided, which may include:
[0061] Acquire a pre-stored standard image 7, wherein the standard image 7 is an image obtained by photographing a detection object 10 located at a preset position in the accommodating space 1 when the camera 5 is at an installation position 9 of the installation surface 6 of the accommodating space 1 at a standard installation angle;
[0062] When the camera 5 is installed at the installation position 9 of the installation surface 6, the camera 5 is controlled to photograph the detection object 10 and obtain a detection image 8;
[0063] Comparing the images of the detection object 10 in the standard image 7 and the detection image 8, and determining whether there is a deviation in the installation angle of the camera 5;
[0064] If so, the information for adjusting the installation angle of the camera 5 is output.
[0065] In this embodiment, the standard installation angle may refer to the angle at which the camera 5 is located when the shooting range of the camera 5 reaches a preset optimal shooting range.
[0066] In actual use, in order to ensure that the items stored at a specific position of the refrigeration device 100 can be accurately photographed, the optimal shooting range of each camera 5 in the refrigeration device 100 is often pre-set. Since the installation angle of the camera 5 determines the shooting range of the camera 5, when the installation angle of the camera 5 is deflected, the shooting range of the camera 5 will often be offset accordingly. Therefore, the installation angle of the camera 5 can be limited to ensure that the camera 5 can reach the preset optimal shooting range.
[0067] In the process of manufacturing refrigeration equipment 100, enterprises often go through a trial production stage first. During the trial production stage, the staff will perform preliminary assembly, debugging, performance testing and other operations on the refrigeration equipment 100 to make all aspects of it meet the pre-set standards. Once the trial production is qualified, the same model of refrigeration equipment 100 can be manufactured and produced in large quantities based on the products that have been debugged and qualified.
[0068] In this embodiment, the standard image 7 may be an image obtained by a worker during an assembly and debugging phase, ie, a trial production phase, before mass production of the refrigeration equipment 100.
[0069] For example, during the trial production stage, the staff can adjust the installation angle of the camera 5 in various ways to make the shooting range of the camera 5 reach the optimal shooting range, and can set the installation angle of the camera 5 when the optimal shooting range is obtained as the standard installation angle, and then can control the camera 5 to shoot and obtain a standard image 7 of the camera 5 at the standard installation angle.
[0070] In this embodiment, the detection image 8 may refer to an image taken when the camera 5 is in the installation position 9 and is used to compare with the standard image 7 to determine whether there is a deviation between the installation angle of the camera 5 and the standard installation angle.
[0071] For example, in the mass production stage, after the on-site staff installs the camera 5 at the installation position 9, they can observe with the naked eye and make the camera 5 at a roughly appropriate installation angle, and then control the camera 5 to shoot and obtain the detection image 8.
[0072] After acquiring the detection image 8, it is possible to use the standard image 7 as a basis and determine through image comparison whether there is a deviation between the installation angle of the camera 5 and the standard installation angle. If there is a deviation, it is also possible to use the standard image 7 as a basis to determine which specific position of the installation angle of the camera 5 has a deviation, so as to determine how to adjust the installation angle of the camera 5 so that the installation angle of the camera 5 can reach the standard installation angle and the shooting range of the camera 5 can obtain the optimal shooting range.
[0073] In addition, during the after-sales use or maintenance of the refrigeration equipment 100, the user or maintenance personnel can also use the standard image 7 as a basis to determine whether there is a deviation between the installation angle of the camera 5 and the standard installation angle by image comparison. When there is a deviation, adjust the installation angle of the camera 5 based on the standard image 7 so that the installation angle of the camera 5 reaches the standard installation angle and the shooting range of the camera 5 obtains the optimal shooting range.
[0074] In order to facilitate comparison with the standard image 7, the detection object 10 can be set at a preset position of the accommodating space 1. The preset position can refer to a specific position in the accommodating space 1. In the standard image 7 and the detection image 8, the detection object 10 is within the shooting range of the camera 5. The detection object 10 in the standard image 7 and the detection image 8 can be the same object, or the same kind of object with the same appearance and size.
[0075] The detection object 10 may be an inherent structure of the refrigeration device 100, such as the boundary between the side walls of the accommodating space 1, an identification pattern arranged on the wall of the accommodating space 1, etc. It may also be an object placed in the accommodating space 1 that can be taken out and placed, such as an apple placed at the left rear corner of the bottom wall 102 of the accommodating space 1. It may also be a detachable tooling arranged in the accommodating space 1 and specifically used to detect whether the installation angle of the camera 5 is correct.
[0076] Such a setting can realize judging whether the current installation angle of the camera 5 is correct by image comparison, which is simple, convenient, fast and highly accurate, and is conducive to quickly and accurately adjusting the camera 5 to the standard installation position 9 to ensure that the shooting range of the camera 5 is the optimal shooting range.
[0077] Reference Figure 4 Further, in another embodiment of the present invention, the method for detecting the installation angle of the camera 5, wherein "comparing the image of the detection object 10 in the standard image 7 and the detection image 8 to determine whether there is a deviation in the installation angle of the camera 5" may include:
[0078] A comparison is made as to whether there is a position deviation and / or a shape deviation of the inspection object 10 in the inspection image 8 relative to the inspection object 10 in the standard image 7 .
[0079] When there is a deviation between the installation angle of the camera 5 and the standard installation angle, the position of the inspection object 10 presented in the inspection image 8 will usually be offset to a certain extent relative to the position of the inspection object 10 presented in the standard image 7 .
[0080] For example, the detection object 10 is located in the middle position of the standard image 7 in the standard image 7, while the detection object 10 is located in the lower left corner of the detection image 8 in the detection image 8. The obvious position deviation of the detection object 10 in the detection image 8 relative to the detection object 10 in the standard image 7 can easily determine that there is a deviation in the installation angle of the camera 5.
[0081] In addition, when there is a deviation between the installation angle of the camera 5 and the standard installation angle, the external shape of the detection object 10 in the detection image 8 will usually be deformed to a certain extent, such as being elongated or shortened, relative to the external shape of the detection object 10 in the standard image 7. Therefore, the deviation in the installation angle of the camera 5 can be determined by comparing the shape deviation of the detection object 10 in the detection image 8 relative to the shape deviation of the detection object 10 in the standard image 7.
[0082] Such a setting can realize judging whether the current installation angle of the camera 5 is correct by comparing the position or shape of the detected object in the image. This is simple, convenient, fast and highly accurate, and is conducive to quickly and accurately adjusting the camera 5 to the standard installation position 9 to ensure that the shooting range of the camera 5 is the optimal shooting range.
[0083] Reference Figure 4 Further, in another embodiment of the present invention, the method for detecting the installation angle of the camera 5, wherein the accommodating space 1 may include a mounting surface 6, an opposing surface 11 spaced and arranged opposite to the mounting surface 6, a first surface 12 and a second surface 13 connecting the mounting surface 6 and the opposing surface 11, the first surface 12 and the second surface 13 intersect, the intersection line of the first surface 12 and the opposing surface 11 is a first edge 14, and the intersection line of the second surface 13 and the opposing surface 11 is a second edge 15. The camera 5 can be rotated toward or away from the first surface 12 to adjust the installation angle. The camera 5 can be rotated toward or away from the second surface 13 to adjust the installation angle. The detection object 10 is a strip 10, and the strip 10 extends obliquely on the first surface 12 from the intersection point close to the first edge 14 and the second edge 15.
[0084] Reference Figure 1-Figure 4Furthermore, in another embodiment of the present invention, the accommodating space 1 may include an upper wall 101, a bottom wall 102, a left side wall 103, and a right side wall 104. The camera 5 may be installed on the upper wall 101. The left side wall 103 or the right side wall 104 of the accommodating space 1 may be detachably covered with a tooling plate 16. The surface of the tooling plate 16 facing the accommodating space 1 may be provided with a strip 10. The strip 10 is red, green, or blue. The strip 10 extends along the diagonal of the tooling plate 16.
[0085] The tooling plate 16 can be arranged in cooperation with the right side wall 104 or the left side wall 103 of the accommodating space 1. For example, the length and width of the tooling plate 16 can be consistent with the left side wall 103 or the right side wall 104 of the accommodating space 1, so that the tooling plate 16 can completely cover the left side wall 103 or the right side wall 104 of the accommodating space 1.
[0086] The tooling plate 16 is detachably arranged on the side wall of the accommodating space 1. When the tooling plate 16 is needed, the tooling plate 16 can be set in the accommodating space 1. When the tooling plate 16 is not needed, the tooling plate 16 can be removed from the refrigeration equipment 100 to avoid the tooling plate affecting the normal use and appearance of the accommodating space.
[0087] The strip 10 is set on the tooling board 16. When it is necessary to obtain the standard image 7, the tooling board 16 can be placed in the accommodating space 1 for shooting, and removed after the shooting. When it is necessary to obtain the detection image 8, the same tooling board 16 can be placed in the same type of accommodating space 1 for shooting. Such a setting can ensure the consistency of the detection object 10 and the consistency of the preset position of the detection object 10 in the accommodating space 1 when obtaining the standard image 7 and the detection image 8, reduce errors, so as to more accurately determine whether the current installation angle of the camera 5 is correct.
[0088] The strip 10 is extended along the diagonal of the tooling plate 16 to ensure that the strip 10 has a sufficient length. The longer the strip 10 is, the more obvious the position deviation and shape deviation of the strip 10 in the image will be when the installation angle of the camera 5 deviates from the standard installation angle, which is beneficial for image comparison. Of course, the extension direction of the strip 10 can also be other directions.
[0089] In this embodiment, the strip 10 can be a strip of adhesive tape or a strip pattern formed by drawing or spraying. The strip 10 can be set on the tooling board 16, or it can be directly set on the wall of the accommodating space 1 without the tooling board 16.
[0090] The color of the strip 10 may also be other colors that are easily distinguished from the tooling plate 16 or the side wall of the accommodating space 1 , so as to facilitate the comparison between the detection image 8 and the standard image 7 .
[0091] In this embodiment, the mounting surface 6 may be the upper wall 101 of the accommodating space 1, the opposite surface 11 may be the bottom wall 102 of the accommodating space 1, the first surface 12 may be the left side wall 103 of the accommodating space 1, or may be the rear wall 105 of the accommodating space 1. The first edge 14 may be the intersection of the left side wall 103 and the bottom wall 102 of the accommodating space 1, and the second edge 15 may be the intersection of the rear wall 105 and the bottom wall 102 of the accommodating space 1. The tooling plate 16 may be disposed on the left side wall 103 of the accommodating space 1.
[0092] After the camera 5 is installed on the upper wall 101 of the accommodating space 1, its installation angle can be rotated toward the left wall 103 to adjust the shooting range of the camera 5 toward the left wall 103, or it can be rotated away from the left wall 103 to adjust the shooting range of the camera 5 toward the right wall 104, or it can be rotated toward the rear wall 105 to adjust the shooting range of the camera 5 toward the rear wall 105, or it can be rotated away from the rear wall 105 to adjust the shooting range of the camera 5 toward the opening 4 of the accommodating space 1.
[0093] Such a setting can realize judging whether the current installation angle of the camera 5 is correct by image comparison, which is simple, convenient, fast and highly accurate, and is conducive to quickly and accurately adjusting the camera 5 to the standard installation position 9 to ensure that the shooting range of the camera 5 is the optimal shooting range.
[0094] Reference Figure 4 Further, in another embodiment of the present invention, in the method for detecting the installation angle of the camera 5, the position deviation may include a relative angle deviation, and “comparing whether there is a position deviation and / or shape deviation of the detection object 10 in the detection image 8 relative to the image of the detection object 10 in the standard image 7, and determining whether there is a deviation in the installation angle of the camera 5” may include:
[0095] Acquire a standard relative angle a between the strip 10 and the second edge 15 in the standard image 7;
[0096] Acquire a detection relative angle b between the strip 10 and the second edge 15 in the detection image 8;
[0097] Obtaining a relative angle deviation value between the detected relative angle b and the standard relative angle a;
[0098] If the relative angle deviation value between the detected relative angle b and the standard relative angle a is greater than a preset angle value, and the detected relative angle b is greater than the standard relative angle a, information for adjusting the installation angle of the camera 5 by rotating toward the second surface 13 is output;
[0099] If the relative angle deviation value between the detected relative angle b and the standard relative angle a is greater than the preset angle value, and the detected relative angle b is smaller than the standard relative angle a, information for adjusting the installation angle of the camera 5 by rotating away from the second surface 13 is output.
[0100] The preset angle value may be any value between [0.5°, 1°].
[0101] In this embodiment, when the installation angle of the camera 5 deviates from the standard installation angle, the inclination angle of the strip 10 in the detection image 8 will change significantly relative to the inclination angle of the strip 10 in the standard image 7 .
[0102] Therefore, it is possible to determine whether there is a deviation in the installation angle of the camera 5 in the front-to-back direction by comparing the changes in the tilt angle of the strip 10 in the two images.
[0103] In this embodiment, the preset angle value may be a preset allowable deviation value of the inclination angle of the strip 10 in the detection image 8 relative to the inclination angle of the strip 10 in the standard pattern.
[0104] Since there is a slight deviation between the installation angle of the camera 5 and the standard installation angle, it will not seriously affect the shooting effect of the camera 5. Therefore, when the relative angle deviation value is within the preset angle value range, the installation angle of the camera 5 can be judged as having no deviation, and there is no need to adjust the installation angle of the camera 5. When the relative angle deviation value exceeds the preset angle value range, the installation angle of the camera 5 can be judged as having a deviation, and the installation angle of the camera 5 can be adjusted.
[0105] In addition, when the installation angle of the camera 5 needs to be adjusted, how to adjust the installation angle of the camera 5 can be determined based on the size relationship between the detected relative angle b and the standard relative angle a, and the corresponding information can be output, so that the staff and others can quickly and accurately adjust the installation angle of the camera 5 based on the output information.
[0106] When the relative angle deviation between the detected relative angle b and the standard relative angle a is greater than the preset angle value, and the detected relative angle b is greater than the standard relative angle a, information on adjusting the installation angle of the camera 5 by rotating toward the rear wall 105 of the accommodating space 1 can be output.
[0107] When the relative angle deviation value between the detected relative angle b and the standard relative angle a is greater than the preset angle value, and the detected relative angle b is smaller than the standard relative angle a, information on rotating the installation angle of the camera 5 away from the rear wall 105 of the accommodating space 1 can be output to achieve forward and backward adjustment of the installation angle of the camera 5.
[0108] With such a setting, it is possible to automatically determine whether there is a deviation in the installation angle of the camera 5 in the front-to-back direction by means of image comparison, and when there is a deviation, automatically output prompt information on how to adjust the installation angle of the camera 5. This is simple, convenient, fast, and highly accurate, and is conducive to quickly and accurately adjusting the camera 5 to the standard installation position 9 to ensure that the shooting range of the camera 5 is the optimal shooting range.
[0109] Reference Figure 4 Further, in another embodiment of the present invention, the method for detecting the installation angle of the camera 5, wherein the method for obtaining the standard relative angle a or the detection relative angle b may include:
[0110] Obtaining pixel coordinates of a pixel point of the strip 10 in the standard image 7 or the detection image 8, wherein the pixel coordinates are coordinates in an image coordinate system in units of pixels, and the image coordinate system may include a coordinate axis u and a coordinate axis v, wherein the coordinate axis v extends along the first edge 14, and the coordinate axis u extends along the second edge 15;
[0111] Obtaining a first pixel point with the smallest v coordinate and a second pixel point with the largest v coordinate in the pixel coordinates of the strip 10;
[0112] Take the first average pixel coordinate of the pixel coordinates of all the strips 10 within a distance of F pixels from the first pixel along the positive direction of the coordinate axis v;
[0113] Taking a second average pixel coordinate of the pixel coordinates of all the strips 10 within a distance of F pixels from the second pixel point along the negative direction of the coordinate axis v;
[0114] The standard relative angle a or the detection relative angle b of the strip 10 relative to the second edge 15 is calculated according to the first average pixel coordinate and the second average pixel coordinate.
[0115] Furthermore, in this embodiment, the value of F can be 10 <F<100。
[0116] Since images are composed of pixels, pixel coordinates represent the positions of pixels in the image, and thus the standard relative angle a and the detection relative angle b of the strip 10 can be directly obtained through the pixel coordinates of the strip 10 in the standard image 7 and the detection coordinates.
[0117] An image coordinate system in pixels can be established with the upper left corner of the image as the origin. The horizontal coordinate u and the vertical coordinate v of the pixel point represent the column number and the row number of the pixel point in its image array, respectively. The direction of the coordinate axis v can be toward the extension direction of the first edge 14, and the positive direction of the coordinate axis u can be toward the extension direction of the second edge 15.
[0118] The average coordinates of several pixel points, i.e., the first average pixel coordinates and the second average pixel coordinates, can be obtained at both ends of the strip 10 respectively, and the standard relative angle a or the detection relative angle b can be obtained by calculating the angle between the first average pixel coordinates and the second average pixel coordinates and the coordinate axis u.
[0119] With such an arrangement, the inclination angle of the strip 10 in the image can be directly calculated by using the pixel coordinates of the strip 10 in the image, which is simple, convenient, fast and highly accurate.
[0120] Reference Figure 4 Further, in another embodiment of the present invention, the method for detecting the installation angle of the camera 5, wherein:
[0121] If the angle deviation value between the detection relative angle b and the standard relative angle a is less than or equal to the preset angle value, then the average value u of the u coordinates of all pixel coordinates of the strip 10 with the v coordinate v1 in the standard image 7 is obtained. 检测 , obtain the u coordinate average value u of all pixel coordinates of the strip band 10 with v coordinate v1 in the detection image 8 标准 ;
[0122] Get the u 检测 and the u 标准 Position deviation value;
[0123] If the u 检测 and the u 标准 The position deviation value of is greater than the preset pixel value, and the u 检测 Greater than u 标准 , then output information for adjusting the installation angle of the camera 5 by rotating away from the first surface 12;
[0124] If the u 检测 and the u 标准 The position deviation value of is greater than the preset pixel value, and the u 检测Less than or equal to u 标准 , then output information for adjusting the installation angle of the camera 5 by rotating toward the first surface 12.
[0125] In this implementation, the preset pixel value may be P pixel points, 10≤P≤20.
[0126] In this embodiment, when the installation angle of the camera 5 in the front-to-back direction does not deviate from the standard installation angle, and the installation angle of the camera 5 in the left-to-right direction deviates from the standard installation angle, the coordinate value of the strip band 10u coordinate will usually produce a more obvious change.
[0127] Therefore, by comparing the change in the u coordinate of the strip 10 in the two images when the v coordinate is the same, it is possible to determine whether there is a deviation in the installation angle of the camera 5 in the left and right directions.
[0128] In this embodiment, the preset pixel value may be a preset allowable deviation value of the u coordinate of the pixel coordinate of the strip 10 in the detection image 8 relative to the u coordinate of the pixel coordinate of the strip 10 in the standard pattern when the v coordinates of the pixel coordinates are the same.
[0129] Since there is a slight deviation between the installation angle of the camera 5 and the standard installation angle, it will not seriously affect the shooting effect of the camera 5. Therefore, when the position deviation value is within the preset pixel value range, the installation angle of the camera 5 can be judged as having no deviation, and there is no need to adjust the installation angle of the camera 5. When the position deviation value exceeds the preset pixel value range, the installation angle of the camera 5 can be judged as having a deviation, and the installation angle of the camera 5 can be adjusted.
[0130] Such a setting can realize automatic judgment whether there is any deviation in the installation angle of the camera 5 in the left and right directions through image comparison, and when there is a deviation, automatically output prompt information on how to adjust the installation angle of the camera 5. It is simple, convenient, fast and highly accurate, and is conducive to quickly and accurately adjusting the camera 5 to the standard installation position 9 to ensure that the shooting range of the camera 5 is the optimal shooting range.
[0131] Furthermore, in another embodiment of the present invention, in the method for detecting the installation angle of the camera 5, the width of the strip 10 is M pixels, 5≤M≤20. Such a setting is conducive to calculating the inclination angle of the strip 10, and can reduce the amount of calculation and improve the calculation efficiency.
[0132] Reference Figure 4 Further, in another embodiment of the present invention, the method for detecting the installation angle of the camera 5, wherein the shape deviation may include a length deviation, the method may further include:
[0133] If the angle deviation value between the detection relative angle b and the standard relative angle a is less than or equal to the preset angle value, the detection length value of the strip 10 in the detection image 8 is obtained, and the standard length value of the standard line segment in the standard image 7 is obtained;
[0134] Obtaining a length deviation value between the detected length value and the standard length value;
[0135] Obtaining a ratio of the length deviation value to the standard length value;
[0136] If the ratio of the length deviation value to the standard length value is greater than the preset ratio, and the detected length value is greater than the standard length value, outputting information for adjusting the installation angle of the camera 5 by rotating away from the first surface 12;
[0137] If the ratio of the length deviation value to the standard length value is greater than the preset ratio, and the detected length value is less than the standard length value, information for adjusting the installation angle of the camera 5 by rotating toward the first surface 12 is output.
[0138] Furthermore, in another embodiment of the present invention, the preset ratio is 0.1.
[0139] In this embodiment, when the installation angle of the camera 5 in the front-to-back direction does not deviate from the standard installation angle, and the installation angle of the camera 5 in the left-to-right direction deviates from the standard installation angle, the overall length of the strip 10 will usually change significantly.
[0140] Therefore, it is possible to determine whether there is a deviation in the installation angle of the camera 5 in the left and right directions by comparing the change in the length of the strip 10 in the two images.
[0141] The preset pixel value may be an allowable deviation value of a ratio of a preset length deviation value between a detection length value and a standard length value relative to the standard length value.
[0142] Such a setting can realize automatic judgment whether there is any deviation in the installation angle of the camera 5 in the left and right directions through image comparison, and when there is a deviation, output prompt information on how to adjust the installation angle of the camera 5. It is simple, convenient, fast and highly accurate, and is conducive to quickly and accurately adjusting the camera 5 to the standard installation position 9 to ensure that the shooting range of the camera 5 is the optimal shooting range.
[0143] Furthermore, in another embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps in the method for detecting the installation angle of the camera 5 described in any of the above embodiments are implemented.
[0144] Furthermore, in another embodiment of the present invention, the refrigeration equipment 100 may include an image recognition system, and the image recognition system may include a memory and a processor, the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, it implements the steps in the method for detecting the installation angle of the camera 5 described in any of the above embodiments.
[0145] In summary, the method, storage medium and device for detecting the installation angle of the camera 5 in the present invention can determine whether there is a deviation in the installation angle of the camera 5 by comparing the image of the detection object 10 in the standard image 7 and the detection image 8, thereby solving the problem in the prior art that the installation of the camera 5 is often based on the subjective judgment of the installer with the naked eye, and the installation angle is incorrect. This is too subjective and may lead to misjudgment, resulting in an inaccurate installation angle of the camera 5.
[0146] The technical solution in the present application can be used to determine whether there is a deviation in the installation angle of the camera 5 by means of image comparison, and when there is a deviation, automatically output prompt information on how to adjust the installation angle of the camera 5, including prompts to adjust the camera 5 front and back and left and right. This is simple, convenient, fast and highly accurate, and is conducive to quickly and accurately adjusting the camera 5 to the standard installation position 9 to ensure that the shooting range of the camera 5 is the optimal shooting range.
[0147] It should be understood that although this specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each implementation mode may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
[0148] The series of detailed descriptions listed above are only specific descriptions of feasible implementation methods of the present invention. They are not intended to limit the scope of protection of the present invention. Any equivalent implementation methods or changes that do not deviate from the technical spirit of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for detecting a camera installation angle, characterized in that: include: Acquire a pre-stored standard image, wherein the standard image is an image obtained by photographing a detection object located at a preset position of the accommodating space when the installation position of the camera on the installation surface of the accommodating space is at a standard installation angle; When the camera is installed at the installation position of the installation surface, the camera is controlled to photograph the detection object and obtain a detection image; Comparing the standard image with the image of the detection object in the detection image to determine whether there is a deviation in the installation angle of the camera; If yes, then output information for adjusting the installation angle of the camera, The accommodating space includes a mounting surface, an opposing surface spaced apart from the mounting surface, a first surface and a second surface connecting the mounting surface and the opposing surface, the first surface and the second surface intersect, an intersection line of the first surface and the opposing surface is a first edge, and an intersection line of the second surface and the opposing surface is a second edge. The camera can be rotated toward or away from the first surface to adjust the installation angle, and the camera can be rotated toward or away from the second surface to adjust the installation angle. The detection object is a strip, and the strip extends obliquely on the first surface from the intersection point close to the first edge and the second edge. Acquire a standard relative angle between the strip and the second edge in the standard image; Acquire a detection relative angle between the strip and the second edge in the detection image; Obtaining a relative angle deviation value between the detected relative angle and the standard relative angle; If the angle deviation between the detected relative angle and the standard relative angle is less than or equal to the preset angle value, then the average value u of the u coordinates of all pixel coordinates of the strip with the v coordinate v1 in the standard image is obtained. 检测 , obtain the u coordinate average value u of all pixel coordinates of the strip with v coordinate v1 in the detection image 标准 ; Get the u 检测 and the u 标准 Position deviation value; If the u 检测 and the u 标准 The position deviation value of is greater than the preset pixel value, and the u 检测 Greater than u 标准 , then output information for adjusting the installation angle of the camera by rotating away from the first surface; If the u 检测 and the u 标准 The position deviation value of is greater than the preset pixel value, and the u 检测 Less than or equal to u 标准 , then output information for adjusting the installation angle of the camera by rotating toward the first surface.
2. The method for detecting the camera installation angle according to claim 1, characterized in that: “Comparing the image of the detection object in the standard image and the detection image to determine whether there is a deviation in the installation angle of the camera” includes: Compare whether there is a position deviation and / or a shape deviation of the detection object in the detection image relative to the detection object in the standard image.
3. The method for detecting the camera installation angle according to claim 2, characterized in that: The position deviation includes a relative angle deviation, If the relative angle deviation value between the detected relative angle and the standard relative angle is greater than a preset angle value, and the detected relative angle is greater than the standard relative angle, outputting information for adjusting the installation angle of the camera by rotating toward the second surface; If the relative angle deviation value between the detected relative angle and the standard relative angle is greater than the preset angle value, and the detected relative angle is smaller than the standard relative angle, information for adjusting the installation angle of the camera by rotating away from the second surface is output.
4. The method for detecting the camera installation angle according to claim 3, characterized in that: The method for obtaining the standard relative angle or the detected relative angle includes: Obtaining pixel coordinates of pixel points of the strip in the standard image or the detection image, wherein the pixel coordinates are coordinates in an image coordinate system in units of pixels, wherein the image coordinate system includes a coordinate axis u and a coordinate axis v, wherein the coordinate axis v extends along the first edge, and the coordinate axis u extends along the second edge; Obtaining a first pixel point with the smallest v coordinate and a second pixel point with the largest v coordinate in the pixel coordinates of the strip; Take the first average pixel coordinate of the pixel coordinates of all the strip bands within a distance of F pixel points from the first pixel point along the positive direction of the coordinate axis v; Take the second average pixel coordinate of the pixel coordinates of all the strip bands within a distance of F pixel points from the second pixel point along the negative direction of the coordinate axis v; Calculate the standard relative angle or the detected relative angle of the strip band with respect to the second edge according to the first average pixel coordinate and the second average pixel coordinate.
5. The method for detecting the installation angle of a camera according to claim 4, wherein The width of the strip band is M pixel points, 5 ≤ M ≤ 20, 10 < F < 100, the preset angle value is any value between [0.5°, 1°], and the preset pixel value is P pixel points, 10 ≤ P ≤ 20.
6. The method for detecting the camera installation angle according to claim 3, characterized in that: The shape deviation includes a length deviation, and the method further includes: If the angle deviation value between the detected relative angle and the standard relative angle is less than or equal to the preset angle value, obtain the detected length value of the strip band in the detected image, and obtain the standard length value of the standard line segment in the standard image; Obtain the length deviation value between the detected length value and the standard length value; Obtain the ratio of the length deviation value to the standard length value; If the ratio of the length deviation value to the standard length value is greater than the preset ratio and the detected length value is greater than the standard length value, output information for adjusting the installation angle of the camera by rotating away from the first surface; If the ratio of the length deviation value to the standard length value is greater than the preset ratio and the detected length value is less than the standard length value, output information for adjusting the installation angle of the camera by rotating towards the first surface.
7. The method for detecting the installation angle of a camera according to claim 6, wherein The preset ratio is 0.
1.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the steps in the method for detecting the installation angle of a camera according to any one of claims 1-7.
9. A refrigeration device, characterized in that: The refrigeration device includes an image recognition system, the image recognition system includes a memory and a processor, the memory stores a computer program that can run on the processor, and when the processor executes the computer program, it implements the steps in the method for detecting the installation angle of a camera according to any one of claims 1-7.
10. The refrigeration device according to claim 9, characterized in that: The refrigeration device includes a box body and a door body pivotally arranged on the box body. An accommodation space is formed inside the door body. The accommodation space includes an upper wall, a bottom wall, a left side wall, and a right side wall. The camera is installed on the upper wall. A tooling plate is detachably covered on the left side wall or the right side wall of the accommodation space. A strip band is arranged on the surface of the tooling plate facing the accommodation space. The strip band is red or green or blue, and the strip band extends along the diagonal of the tooling plate.
Citation Information
Patent Citations
Method, controller and system for automatically correcting zero position of wind generating set
CN113818999A
Camera detection method and device, computer equipment and storage medium
CN114078124A
Method for measuring calibration value of image pickup unit for measurement
JP1999006711A