Object detection method and device and electronic equipment
By comparing and identifying and blocking the mis-detected areas when the camera detects an object, the problem of poor consumption and user experience caused by mis-detecting of the camera is solved, and higher detection accuracy and lower consumption are achieved.
Patent Information
- Application Number
- CN202410128798.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-29
- Publication Date
- 2025-07-29
AI Technical Summary
In the prior art, there are many false detections in the detection of cameras, resulting in an increase in invalid videos, which consumes hugely and has poor user experience.
When the target camera detects an object, it determines the object detection area and compares it with the comparison detection area at other shooting angles, identifys and blocks the error detection area to perform object detection.
It improves the accuracy of object detection, reduces camera consumption, and improves user experience.
Smart Images

Figure CN120390078A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of intelligent devices, and particularly to an object detection method, apparatus, and electronic device. Background Art
[0002] With the development of society, security issues have attracted more and more attention. In order to improve the security of their living environment, people often install multiple cameras in their living environment. With the development of cameras, cameras are becoming more and more intelligent, and they can detect objects in the field of view based on deep learning models, enabling users to timely understand the objects captured by the cameras.
[0003] In practical applications, there are often many false detections in the detection of intelligent cameras, and too many false detections will generate a large number of invalid videos, which will cause huge consumption to the cameras and generate too many error message push notifications, which have a serious negative impact on the user experience. Summary of the Invention
[0004] This application provides an object detection method, apparatus, and electronic device to solve the technical problem that there are often many false detections in the detection of intelligent cameras in the prior art, and too many false detections will generate a large number of invalid videos, which will cause huge consumption to the cameras and generate too many error message push notifications, which have a serious negative impact on the user experience.
[0005] In a first aspect, this application provides an object detection method, and the method includes:
[0006] When a target camera detects an object, determining a target detection area of the object by the target camera at the current shooting angle;
[0007] Determining a comparison detection area of the object at other shooting angles;
[0008] When it is determined that there is a false detection in the target detection area according to the target detection area and the comparison detection area, determining a false detection area of the target camera based on the target detection area, and masking the false detection area;
[0009] Performing object detection on other detection areas of the target camera except the false detection area.
[0010] As a possible implementation, the determining the target detection area of the object by the target camera at the current shooting angle includes:
[0011] Determining at least one detection frame of the object by the target camera at the current shooting angle;
[0012] Determine the minimum abscissa value, the maximum abscissa value, the minimum ordinate value, and the maximum ordinate value among all the detected frames;
[0013] Determine the area composed of the minimum abscissa value, the maximum abscissa value, the minimum ordinate value, and the maximum ordinate value as the target detection area of the object by the target camera at the current shooting angle.
[0014] As a possible implementation, the target camera is a fixed camera, and the scene where the target camera is located includes at least one other fixed camera. Determining the comparison detection area of the object at other shooting angles includes:
[0015] Determine the shooting areas of at least one of the other fixed cameras for the object at the same moment;
[0016] Intercept multiple initial comparison detection areas from the shooting areas, and the initial comparison detection areas are the same size as the target detection area;
[0017] Determine the similarity between the target detection area and each of the initial comparison detection areas;
[0018] Determine the initial comparison detection area with the maximum similarity as the comparison detection area of the object at other shooting angles.
[0019] As a possible implementation, the intercepting multiple initial comparison detection areas from the shooting areas includes:
[0020] Taking the upper left corner of the shooting area as the starting point, traversing sequentially along the width and height of the shooting area with a single pixel as the step size;
[0021] Taking the traversed pixel point as the upper left corner of the initial comparison detection area, and intercepting the shooting area with the length and width of the target detection area as the length and width of the initial comparison detection area to obtain the initial comparison detection area.
[0022] As a possible implementation, the target camera is a pan-tilt camera. Determining the comparison detection area of the object at other shooting angles includes:
[0023] Obtain the coordinate data of the target detection area at the current shooting angle;
[0024] Rotate the target camera according to a preset angle to obtain the shooting area of the object at the new shooting angle, and the shooting area includes the target detection area;
[0025] Determine the coordinate mapping relationship between the shooting area of the target camera at the shooting angle corresponding to the target detection area and the new shooting angle;
[0026] Determine the new coordinate data of the target detection area at the new shooting angle according to the coordinate mapping relationship and the coordinate data of the target detection area at the current shooting angle;
[0027] Determine the area corresponding to the new coordinate data as the comparison detection area.
[0028] As a possible implementation, the determination that there is a misdetection in the target detection area according to the target detection area and the comparison detection area includes:
[0029] Obtain the target detection image corresponding to the target detection area and the comparison detection image corresponding to the comparison detection area respectively;
[0030] Perform object detection on the target detection image and the comparison detection image respectively to obtain the target detection result and the comparison detection result;
[0031] Determine the detection confidence of the target detection area according to the target detection result and the comparison detection result;
[0032] When it is determined that the detection confidence is less than the preset confidence threshold, it is determined that there is a misdetection in the target detection area.
[0033] As a possible implementation, the determination of the detection confidence of the target detection area according to the target detection result and the comparison detection result includes:
[0034] Determine the detected target detection object, the number of target detection objects, and the size of the target detection frame from the target detection result;
[0035] Determine the detected comparison detection object, the number of comparison detection objects, and the size of the comparison detection frame from the comparison detection result;
[0036] When the target detection area meets one or more of the following conditions, it is determined that the detection confidence of the target detection area is less than the preset confidence threshold:
[0037] The target detection object is inconsistent with the comparison detection object, the number of target detection objects is inconsistent with the number of comparison detection objects, and the difference between the size of the target detection frame and the size of the comparison detection frame is greater than the preset threshold.
[0038] As a possible implementation, the determination of the misdetection area of the target camera based on the target detection area includes:
[0039] Determine the target detection area as the misdetection area of the target camera.
[0040] As a possible implementation, determining the misdetection area of the target camera based on the target detection area includes:
[0041] Determine one or more of the following misdetection areas from the target detection area:
[0042] In the case where it is determined that the target detection object is inconsistent with the comparison detection object, determine the detection area where the target detection object is inconsistent with the comparison detection object as the misdetection area of the target camera;
[0043] In the case where it is determined that the number of target detection objects is inconsistent with the number of comparison detection objects, determine the first difference area between the target detection area and the comparison detection area, and determine the first difference area as the misdetection area of the target camera;
[0044] In the case where it is determined that the size of the target detection box is inconsistent with the size of the comparison detection box, determine the second difference area between the target detection box and the comparison detection box, and determine the second difference area as the misdetection area of the target camera.
[0045] As a possible implementation, after masking the misdetection area, it further includes:
[0046] Obtain the misdetection area image corresponding to the misdetection area;
[0047] Send the misdetection area image to the object detection model of the target camera, so that the object detection model performs self-learning based on the misdetection area image.
[0048] In a second aspect, an embodiment of the present application provides an object detection device, and the device includes:
[0049] A first determination module, configured to determine the target detection area of the object by the target camera at the current shooting angle when the target camera detects an object;
[0050] A second determination module, configured to determine the comparison detection area of the object at other shooting angles;
[0051] A masking module, configured to determine the misdetection area of the target camera based on the target detection area and mask the misdetection area when it is determined that there is a misdetection in the target detection area according to the target detection area and the comparison detection area;
[0052] A detection module for performing object detection on other detection regions in the target camera except the misdetection region.
[0053] In a third aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory, where the processor is configured to execute an object detection program stored in the memory to implement the object detection method according to any one of the first aspects.
[0054] In a fourth aspect, an embodiment of the present application provides a storage medium storing one or more programs, where the one or more programs can be executed by one or more processors to implement the object detection method according to any one of the first aspects.
[0055] The technical solution provided by the embodiment of the present application, when the target camera detects an object, determines the target detection region of the object by the target camera at the current shooting angle, determines the comparison detection region of the object at other shooting angles, and when it is determined that there is a misdetection in the target detection region according to the target detection region and the comparison detection region, determines the misdetection region of the target camera based on the target detection region, shields the misdetection region, and performs object detection on other detection regions in the target camera except the misdetection region. This technical solution performs object detection on the same object in the same region at different shooting angles, and verifies according to the object detection results, so as to determine the misdetection region of the camera during the object detection process, and on this basis, shields the misdetection region for object detection, realizing automatic and accurate identification of misdetection, improving the accuracy of object detection, reducing the consumption of the camera, and enhancing the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] The accompanying drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present invention and used together with the specification to explain the principles of the present invention.
[0057] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0058] One or more embodiments are exemplarily illustrated by the pictures in the corresponding accompanying drawings. These exemplary illustrations do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements, unless otherwise stated, and the drawings in the drawings do not constitute a proportional limitation.
[0059] Figure 1 It is a schematic diagram of an application scenario of an object detection method provided by an embodiment of the present application;
[0060] Figure 2 Schematic diagram of an application scenario for another object detection method provided by an embodiment of the present application;
[0061] Figure 3 Flowchart of an embodiment of an object detection method provided by an embodiment of the present application;
[0062] Figure 4 Flowchart of an embodiment of a method for determining a comparison detection region provided by an embodiment of the present application;
[0063] Figure 5 Flowchart of an embodiment of another object detection method provided by an embodiment of the present application;
[0064] Figure 6 Flowchart of an embodiment of another method for determining a comparison detection region provided by an embodiment of the present application;
[0065] Figure 7 Flowchart of an embodiment of yet another object detection method provided by an embodiment of the present application;
[0066] Figure 8 Block diagram of an embodiment of an object detection device provided by an embodiment of the present application;
[0067] Figure 9 Schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0068] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Apparently, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the scope of protection of the present application.
[0069] The following disclosure provides many different embodiments or examples for implementing different structures of the present invention. To simplify the disclosure of the present invention, components and settings of specific examples are described below. Of course, they are only examples and are not intended to limit the present invention. In addition, the present invention may repeat reference numerals and / or letters in different examples. This repetition is for the purpose of simplification and clarity and does not in itself indicate the relationship between the various embodiments and / or settings discussed.
[0070] To solve the technical problem that in the prior art, object detection by cameras often has many false detections, and excessive false detections will generate a large number of invalid videos, which will cause huge consumption to the cameras and generate excessive error message push, having a serious negative impact on the user experience, the present application provides an object detection method, device and electronic device, which can perform object detection on the same object in the same area from different shooting angles, and perform verification according to the object detection results, so as to determine the false detection area of the camera during object detection, and on this basis, shield the false detection area for object detection, realizing automatic and accurate identification of false detections, improving the accuracy of object detection, reducing camera consumption, and enhancing the user experience.
[0071] To facilitate the understanding of the object detection method provided by the embodiments of the present application, the application scenarios involved in the embodiments of the present application will be described below:
[0072] See Figure 1 , which is a schematic diagram of an application scenario of an object detection method provided by an embodiment of the present application. As Figure 1 shown, the application scenario 10 may include cameras 11, 12, 13, and objects 14 and 15.
[0073] The above cameras 11, 12, and 13 may be intelligent cameras capable of object recognition, which may be pan-tilt cameras with changeable shooting angles or fixed cameras with unchangeable shooting angles. The embodiments of the present application do not limit this.
[0074] Among them, when the above cameras include fixed cameras with unchangeable shooting angles, in order to detect the objects in the application scenario 10 from different shooting angles, the number of cameras in the application scenario 10 may be at least two, and the specific number is not limited by the embodiments of the present application. Figure 1 Shown by taking three cameras, all of which are fixed cameras, as an example.
[0075] The above objects 14 and 15 are objects located in the application scenario 10 and can be captured by at least two of the cameras 11, 12, and 13. The above objects may be animals, people, vehicles, etc. The above objects 14 and 15 may be the same object, such as both being people, or different objects, such as object 14 being a person and object 15 being a pet. The embodiments of the present application do not limit this. Figure 1 Taking objects 14 and 15 both being people as an example. It should be noted that the present application does not limit the number of objects in the application scenario 10, which may be one or multiple.
[0076] In one embodiment, the application scenario 10 may include the above-mentioned cameras 11, 12, and 13. The three cameras may each capture the application scenario 10 from different angles, and there is a common capture area.
[0077] Based on this, when the objects 14 and 15 enter the above application scenario 10, the above-mentioned cameras 11, 12, and 13 can simultaneously perform object recognition on the objects 14 and 15 to determine the identities of the objects 14 and 15.
[0078] See Figure 2 , which is a schematic diagram of the application scenario of another object detection method provided by the embodiments of the present application. As Figure 2 shown, the application scenario 20 may include a camera 21, an object 22, and an object 23.
[0079] The above-mentioned camera 21 may be an intelligent camera capable of performing object recognition, and it may be a pan-tilt camera whose shooting angle can be changed.
[0080] Among them, since the camera 21 is a pan-tilt camera whose shooting angle can be changed, it can perform object detection on the objects 22 and 23 in the application scenario 20 from different shooting angles.
[0081] The above-mentioned objects 22 and 23 are objects located in the application scenario 20 and can be captured by the camera 21 from different shooting angles. The above-mentioned objects can be animals, people, vehicles, etc. The above-mentioned objects 22 and 23 can be the same object, such as both being people, or different objects, such as object 22 being a person and object 23 being a pet. The embodiments of the present application do not limit this. Figure 1 Taking the example where both objects 22 and 23 are people for illustration. It should be noted that the present application does not limit the number of objects in the application scenario 20, which can be one or multiple.
[0082] In one embodiment, the application scenario 20 may include the above-mentioned camera 21. The camera 21 may be a pan-tilt camera, and it can perform detection on the objects in the application scenario 20 from different shooting angles by changing the shooting angle.
[0083] Based on this, when the objects 22 and 23 enter the above application scenario 20, the above-mentioned camera 21 can perform object detection on the objects 22 and 23 from different shooting angles to determine the identities of the objects 22 and 23.
[0084] For the above two application scenarios, in actual applications, when each camera performs object recognition, there are often many false detections. For example, the camera may recognize a fixed building in the application scenario as a person, or recognize object 14, who is an adult, as a child. If there are too many false detections by the camera, then there will often be a large number of invalid videos, which not only causes huge consumption to the camera, but also generates too many error message push notifications, which will have a serious negative impact on the user experience.
[0085] In response to this, in the prior art, the following three methods are usually adopted to avoid the above-mentioned problem of false detection by the camera: First, set up a hot zone for shielding; second, manually collect false detection video data for model optimization; third, establish a false detection feature set.
[0086] However, although the above methods can reduce the probability of false detection to a certain extent, each of them has certain problems. First, by setting up a hot zone to shield the area where false detections are frequently triggered, this method can only temporarily solve the problem of false detection in the current scenario. Once the hot zone of the device is reset, or the trigger of false detection becomes random, that is, the false detection area changes, this method will become ineffective. Second, optimizing the detection model, although this method can theoretically solve the problem of false detection, the accuracy in the actual model cannot be optimized to 100%, and false detections will always exist, and manual discrimination and collection of false detection videos themselves also have great challenges and inefficiencies. Finally, establishing a false detection feature set, since the construction of the false detection feature set itself is a process of experience accumulation, therefore, this method can only identify some false detections when the feature set is rich.
[0087] In response to this, the embodiment of the present application provides an object detection method, which can, when performing object detection, detect the false detection area of the camera in real time, and perform object detection after shielding the false detection area. This can not only accurately identify the false detection area of the camera to timely shield the false detection area, but also improve the accuracy of object detection, reduce the consumption of the camera, and enhance the user experience.
[0088] The following further explains the object detection method provided by the present application with specific embodiments in conjunction with the accompanying drawings. The embodiments do not constitute a limitation to the embodiments of the present invention.
[0089] Refer to Figure 3 , which is a flowchart of an embodiment of an object detection method provided by an embodiment of the present application. As Figure 3 shown, the process may include the following steps:
[0090] Step 301, when the target camera detects an object, determine the target detection area of the target camera for the above object at the current shooting angle.
[0091] The above-mentioned target camera refers to an intelligent camera that can detect and identify an object after capturing the object. It can be a fixed camera with an unchangeable shooting angle or a pan-tilt camera with a changeable shooting angle. For example Figure 1 any one of the cameras 11, 12, and 13 in the application scenario 10 shown, or can also be Figure 2 the camera 21 in the application scenario 20 shown. The embodiments of the present application do not limit this
[0092] The above-mentioned object refers to an object that enters the shooting area of the target camera. It can be an animal, a person, or a movable object such as a vehicle. The embodiments of the present application do not limit this
[0093] The above-mentioned target detection area refers to the detection area in the captured image that includes the captured object when the target camera detects and identifies the captured object. Among them, when the target camera detects the captured object, it may include one or more detection frames. Then, the target detection area can be the area including all the detection frames or the area corresponding to each detection frame. The embodiments of the present application do not limit this
[0094] In one embodiment, each camera included in the application scenario can be used as the target camera. The target camera can perform real-time detection on the application scenario. When the target camera detects an object that appears in the application scenario, an existing object detection model can be used to perform object detection on the object
[0095] Based on this, during the process of the target camera detecting the above-mentioned object, multiple detection frames can be output in the captured image. Based on this, the execution entity of the embodiments of the present application can determine the target detection area of the target camera for detecting the above-mentioned object according to the multiple detection frames in the captured image
[0096] As an exemplary implementation manner, the execution entity of the embodiments of the present application can determine at least one detection frame of the target camera for the above-mentioned object at the current shooting angle
[0097] After that, the minimum abscissa value, the maximum abscissa value, the minimum ordinate value, and the maximum ordinate value among all the detection frames can be determined, and the area composed of the above-mentioned minimum abscissa value, maximum abscissa value, minimum ordinate value, and maximum ordinate value is determined as the target detection area of the target camera for the above-mentioned object at the current shooting angle
[0098] The target detection area determined according to the above method can be the maximum circumscribed rectangle of all detection frames in the target camera, that is, the rectangle containing all detection frames. Since this target detection area contains all the detection frames of the above object, object detection can be carried out more comprehensively in this target detection area. In this way, if there is a misdetection during the detection process, the area corresponding to the misdetection can be within this target detection area.
[0099] Step 302: Determine the comparison detection area of the above object at other shooting angles.
[0100] The above comparison detection area is the detection area at different shooting angles corresponding to the target detection area.
[0101] In one embodiment, the above target camera can be a fixed camera, and the scene where the target camera is located can also include at least one other fixed camera. Based on this, the execution entity of the embodiment of the present application can obtain the comparison detection area of the above object at other shooting angles at the same time or with a time difference less than a preset threshold from other fixed cameras.
[0102] As for how to obtain the comparison detection area of the above object at other shooting angles from other fixed cameras, it will be described in the following through Figure 4 the shown process, which will not be elaborated here.
[0103] In another embodiment, the above target camera can be a pan-tilt camera, and the pan-tilt camera can change the shooting angle to detect the above object from other shooting angles. Based on this, the execution entity of the embodiment of the present application can directly obtain the comparison detection area of the above object at other shooting angles at the same time or with a time difference less than a preset threshold from the target camera.
[0104] As for how to obtain the comparison detection area of the above object at other shooting angles from the target camera, it will be described in the following through Figure 6 the shown process, which will not be elaborated here.
[0105] Step 303: In the case where it is determined that there is a misdetection in the target detection area according to the target detection area and the comparison detection area, determine the misdetection area of the target camera based on the target detection area, and mask this misdetection area.
[0106] Step 304: Perform object detection on other detection areas in the target camera except the misdetection area.
[0107] The following is a unified description of Step 303 and Step 304:
[0108] The above misdetection area refers to the area where there is a misdetection when the target camera detects the above object.
[0109] In one embodiment, the execution entity of the embodiments of the present application can determine whether there is a misdetection in the target detection area based on the above-mentioned target detection area and the above-mentioned comparison detection area. When it is determined that there is a misdetection, the misdetection area of the target camera is determined based on the above-mentioned target detection area, so as to shield the misdetection area, prevent the huge consumption of the camera caused by the misdetection, and since too many error message push is generated, it has a serious negative impact on the user experience.
[0110] As an exemplary implementation manner, the execution entity of the embodiments of the present application can determine whether there is a misdetection of the target camera in the above-mentioned target detection area according to the detection results corresponding to the target detection area and the comparison detection area respectively.
[0111] Further, the execution entity of the embodiments of the present application can respectively obtain the target detection image corresponding to the target detection area and the comparison detection image corresponding to the comparison detection area.
[0112] Based on this, object detection can be performed on the above-mentioned target detection image and comparison detection image respectively to obtain a target detection result and a comparison detection result.
[0113] After that, the detection confidence of the target detection area can be determined according to the above-mentioned target detection result and comparison detection result. Optionally, when it is determined that the above-mentioned detection confidence is less than a preset confidence threshold, it can be determined that there is a misdetection in the above-mentioned target detection area.
[0114] In practical applications, when the camera performs object detection, the main purpose is to detect the specific objects captured and the number of objects, etc. Therefore, the above-mentioned detection result can include the detected objects and the number of objects. Further, in order to determine the accuracy of the detection result from multiple dimensions, in the embodiments of the present application, the above-mentioned detection result can also include the size of the detection frame.
[0115] Further, the detected objects included in the above-mentioned detection result can be represented by the attributes of the objects. For example, the object is an animal, a person or a vehicle. If it is a person, the specific gender attribute of the person. If it is an animal, what specific animal it is. If it is a vehicle, it can be the specific color, model and other attributes of the vehicle.
[0116] Based on this, the execution entity of the embodiments of the present application can determine the detected target detection objects, the number of target detection objects, and the size of the target detection frame from the above-mentioned target detection result. And determine the detected comparison detection objects, the number of comparison detection objects, and the size of the comparison detection frame from the comparison detection result.
[0117] After that, the execution entity of the embodiment of the present application can respectively compare the target detection object with the comparison detection object, compare the number of target detection objects with the number of comparison detection objects, and compare the size of the target detection box with the size of the comparison detection box, and determine the detection confidence of the target detection area according to the above comparison results.
[0118] Optionally, when it is determined that the target detection object is the same as the comparison detection object, the number of target detection objects is the same as the number of comparison detection objects, and the difference between the size of the target detection box and the size of the comparison detection box is less than or equal to a preset threshold, it indicates that the target detection result of the object captured by the target detection area of the target camera is consistent with the comparison detection result of the object from other shooting angles. Therefore, it can be determined that the detection confidence of the target detection area of the target camera is relatively high (greater than the preset confidence threshold), and there is no misdetection.
[0119] On the contrary, when it is determined that the target detection area meets at least one misdetection condition, it can be determined that the detection confidence of the target detection area is relatively low, that is, less than the preset confidence threshold. Among them, the above misdetection conditions may include but are not limited to: the target detection object is different from the comparison detection object, the number of target detection objects is different from the number of comparison detections, and the difference between the size of the target detection box and the size of the comparison detection box is greater than the preset threshold. When the above target detection area meets at least one of the above conditions, it indicates that the target detection result of the object captured by the target detection area of the target camera is inconsistent with the comparison detection result of the object from other shooting angles. Therefore, it can be determined that the detection confidence of the target detection area of the target camera is relatively low, which is less than the preset confidence threshold, and there is misdetection in the above target detection area.
[0120] In one embodiment, when it is determined that there is misdetection in the target detection area according to the above method, the execution entity of the embodiment of the present application can determine the misdetection area of the target camera based on the target detection area and shield the misdetection area. After that, object detection can be performed based on other detection areas in the target camera except the misdetection area, so as to exclude the misdetection in the misdetection area and improve the accuracy of object detection by the target camera.
[0121] As an exemplary implementation manner, in order to ensure that the misdetection area is accurately shielded, the execution entity of the embodiment of the present application can directly determine the above target detection area as the misdetection area of the target camera.
[0122] As another exemplary implementation manner, in order to prevent the target detection area from being too large, if the entire misdetection area is shielded, it may result in too few detection areas of the target camera, thereby reducing the detection efficiency of object detection. The execution entity of the embodiment of the present application can determine a specific misdetection area from the target detection area according to the above target detection result and comparison detection result.
[0123] Optionally, as can be seen from the above description, the above object detection results may include the object detection target, the number of object detection targets, and the size of the object detection frame. The above comparison detection results may include the comparison detection target, the number of comparison detection targets, and the size of the comparison detection frame.
[0124] Based on this, the execution subject of the embodiment of the present application may determine one or more misdetection regions from the object detection region according to the above object detection results and comparison detection results:
[0125] Optionally, the object detection target and the comparison detection target may be compared, and in the case where it is determined that the object detection target and the comparison detection target are inconsistent, the detection region where the object detection target and the comparison detection target are inconsistent is determined as the misdetection region of the target camera.
[0126] For example, assume that the object detection target includes two objects, an adult and a child, while the comparison detection target includes two adults. Then, the detection region in the object detection region where the detected object is a child can be determined as the misdetection region.
[0127] Optionally, the number of object detection targets and the number of comparison detection targets may be compared. In the case where it is determined that the number of object detection targets and the number of comparison detections are inconsistent, the first difference region between the object detection region and the comparison detection region is determined, and this first difference region is determined as the misdetection region of the target camera. The above first difference region refers to the region in the object detection region where there is a difference in the number of objects compared to the comparison detection region.
[0128] For example, assume that there are three detection frames in the object detection region detecting a total of three objects, and there are two detection frames in the comparison detection region detecting a total of two objects. Then, the three detection frames in the object detection region can be compared with the two detection frames in the comparison detection region to determine the detection region corresponding to the extra detection frame in the object detection region, and thus this detection region is used as the first difference region.
[0129] For another example, assume that there are two detection frames in the object detection region detecting a total of two objects, and there are three detection frames in the comparison detection region detecting a total of three objects. Then, the two detection frames in the object detection region can be compared with the three detection frames in the comparison detection region to determine the detection region corresponding to the missing detection frame in the object detection region compared to the comparison detection frames, and thus this detection region is used as the first difference region.
[0130] Optionally, the size of the target detection box and the size of the comparison detection box can be compared. When it is determined that the size of the target detection box is inconsistent with the size of the comparison detection box, the second difference region between the target detection box and the comparison detection box is determined, and this second difference region is determined as the misdetection region of the target camera. The above-mentioned second difference region is the difference region of the target detection box relative to the comparison detection box.
[0131] For example, assume that the size of the target detection box is 10 cm in length and 15 cm in width, and the size of the comparison detection box is 8 cm in length and 10 cm in width. Then, the above-mentioned target detection box and the comparison detection box can be subtracted from each other to determine a difference region of 2 cm in length and 5 cm in width, and this difference region is determined as the second difference region.
[0132] In addition, in order to further optimize the object detection model of the target camera, after masking the misdetection region, the execution entity of the embodiment of the present application can obtain the misdetection region image corresponding to the misdetection region and send this misdetection region image to the object detection model of the target camera, so that the target object detection model performs self-learning based on the above-mentioned misdetection region image.
[0133] The technical solution provided by the embodiment of the present application, when the target camera detects an object, determines the target detection region of the object by the target camera at the current shooting angle, determines the comparison detection region of the object at other shooting angles, and when it is determined that there is a misdetection in the target detection region according to the target detection region and the comparison detection region, determines the misdetection region of the target camera based on the target detection region, masks the misdetection region, and performs object detection on other detection regions except the misdetection region in the target camera. This technical solution performs object detection on the same object in the same area from different shooting angles, and verifies according to the object detection results, so as to determine the misdetection region during the object detection process of the camera, and on this basis, masks the misdetection region to perform object detection, realizing automatic and accurate identification of misdetection, improving the accuracy of object detection, reducing the consumption of the camera, and enhancing the user experience.
[0134] See Figure 4 , which is a flowchart of an embodiment for determining a comparison detection region provided by the embodiment of the present application. Figure 4 The process shown Figure 3 On the basis of the process shown, it describes how to obtain the comparison detection region of the object at other shooting angles from other fixed cameras when the target camera is a fixed camera and the scene where the target camera is located includes at least one other fixed camera, for example Figure 1 the application scenario shown. As Figure 4 shown, this process may include the following steps:
[0135] Step 401: Determine the shooting areas of at least one other fixed camera for the above object at the same time.
[0136] The above shooting area refers to the shooting picture of the other fixed camera for the object at the corresponding shooting angle. For example, in the Figure 1 shown application scenario, each fixed camera can shoot the object in the scene, and the above shooting area is the shooting picture of the object in the scene by the other fixed cameras except the target camera.
[0137] In the embodiment of the present application, if you want to obtain a comparison detection area corresponding to the target detection area of the target camera from other fixed cameras, the execution subject of the embodiment of the present application can first determine the shooting areas of at least one other fixed camera for the shot object at the same time.
[0138] Among them, the above same time means that the detection time of the target camera for the object is the same as the detection time of other fixed cameras for the same object. Further, due to reasons such as network delay and light difference, there may be a difference in the detection time of different cameras for the object. Therefore, a certain error is allowed here for the same time, for example, the error time is within 20 seconds.
[0139] As an exemplary implementation method, in order to improve efficiency, the execution subject of the embodiment of the present application can determine the distance between the target camera and each other fixed camera, and obtain the shooting area of the fixed camera from the fixed cameras with a distance less than the preset distance threshold.
[0140] As another exemplary implementation method, in order to improve the accuracy of identifying false detections, the execution subject of the embodiment of the present application can determine the shooting areas of all fixed cameras in the scene where the target camera is located for the object at the same time, so as to obtain the comparison detection area more comprehensively, and more accurately determine whether there is a false detection in the target detection area according to the target detection area and the comparison detection area.
[0141] Step 402: Intercept multiple initial comparison detection areas from the shooting area, and the initial comparison detection area is the same size as the target detection area.
[0142] The above initial comparison detection area is the area in the shooting area that is the same size as the target detection area.
[0143] In the embodiments of the present application, since the comparison detection regions are the detection regions of the same object at different shooting angles, that is, the comparison detection regions include the objects in the target detection region, when the execution entity of the embodiments of the present application determines the comparison detection regions from the shooting regions, for each shooting region, multiple initial comparison detection regions having the same size as the target detection region can be intercepted from the shooting region, and the comparison detection regions containing the objects can be determined from the multiple initial comparison detection regions.
[0144] As an exemplary implementation manner, the execution entity of the embodiments of the present application can start from the upper left corner of the shooting region and traverse along the width and height of the shooting region step by step with a single pixel as the step size.
[0145] After that, the pixel points traversed can be used as the upper left corners of the initial comparison detection regions, and the shooting region can be intercepted with the length and width of the target detection region as the length and width of the initial comparison detection regions, so as to obtain the initial comparison detection regions.
[0146] Among them, when intercepting the above initial comparison detection regions, multiple initial comparison detection regions can be intercepted from the shooting region through a preset screenshot tool.
[0147] According to the above method, the comparison detection regions corresponding to each shooting region can be obtained.
[0148] Step 403: Determine the similarity between the target detection region and each initial comparison detection region.
[0149] Step 404: Determine the initial comparison detection region with the maximum similarity as the comparison detection region of the above object at other shooting angles.
[0150] The following is a unified description of step 403 and step 404:
[0151] As can be seen from the description in step 302, the above comparison detection region is the region containing the object in the target detection region, and as can be seen from the description in step 402, the above initial comparison detection region is the region intercepted from the shooting region and having the same size as the target detection region. Then this initial comparison detection region may or may not contain the object in the target detection region.
[0152] Based on this, the execution entity of the embodiments of the present application can determine the comparison detection regions containing the objects in the target detection region from multiple initial comparison detection regions.
[0153] As an exemplary implementation manner, the execution entity of the embodiments of the present application can determine the similarity between the target detection region and each initial comparison detection region, and determine the initial comparison detection region with the maximum similarity as the comparison detection region of the object at other shooting angles.
[0154] Further, when determining the similarity between the target detection region and each initial comparison detection region, the target detection image of the target detection region and the initial comparison detection image of each initial comparison detection region can be determined respectively.
[0155] After that, by determining the similarity between the target detection image and each initial comparison detection image, the similarity between the target detection region and each initial comparison detection region can be obtained.
[0156] Optionally, the similarity between the target detection image and each initial comparison detection image can be determined by the shortest distance similarity matching algorithm.
[0157] In addition, for the sake of easy understanding of how to apply the object detection method provided by the embodiments of the present application to perform object detection in the Figure 1 application scenario shown below, the following is an example for illustration:
[0158] Refer to Figure 5 , which is a flowchart of an embodiment of another object detection method provided by the embodiments of the present application. As Figure 5 shown, this process may include the following steps:
[0159] 1. Trigger area marking: When an object appears within the field of view of the intelligent camera, the intelligent camera is triggered to perform object detection. One of the triggered cameras is selected as the target camera, and the detection frame detected by it is obtained. After that, the maximum bounding rectangle of all detection frames can be calculated, which is Figure 3 the target detection region involved, which can be denoted as A0.
[0160] 2. Same area marking: First, crop the target detection region from the target camera selected in step 1, denoted as CImg (that is, the target detection image). Secondly, read the full-view pictures of the remaining intelligent cameras (numbered i, with values 1, 2, 3...) at the same time point or within a very small time threshold, denoted as Img_i. Then, starting from the upper left corner of the picture Img_i, slide along the width and height of the picture with a single pixel as the step size; when reaching a new pixel, obtain a crop with the same size as the maximum bounding rectangle in step 1, denoted as CImg_i. Finally, the shortest distance similarity matching algorithm can be used to calculate the similarity between CImg and CImg_i; when the entire picture is traversed, the position of the maximum matching similarity can be obtained, and the same area can be located, denoted as A1_i.
[0161] 3. Mutual verification of detected objects: Obtain the object detection results of the trigger area A0 and the same area A1_i respectively. After that, the consistency of the detection results in the same area in the fields of view of different intelligent cameras can be verified according to indicators such as the detected objects, the number of detected objects, and the size of the detection frame included in the detection results.
[0162] 4. False detection automatic capture: If there is no detection object in area A1_i, or the number of object detections is inconsistent, or there are obvious differences in the sizes of the detection frames, it can be considered that the confidence level of target detection in area A0 is low, so there is a false detection.
[0163] 5. False detection adaptive processing and feedback: If a false detection is captured, a shielding area is automatically generated based on the size of the trigger area to prevent high-frequency false triggers in the same area subsequently, saving power consumption. After that, a cutout of the false detection area can be obtained and fed back to the self-learning module of the object detection model, thereby triggering the self-learning optimization process of the object detection model.
[0164] The technical solution provided by the embodiments of the present application determines the shooting areas of at least one other fixed camera for the above object at the same moment, intercepts multiple initial comparison detection areas from the shooting areas, where the initial comparison detection areas are the same size as the target detection area, determines the similarity between the target detection area and each initial comparison detection area, and determines the initial comparison detection area with the maximum similarity as the comparison detection area of the above object at other shooting angles. This technical solution, when the target camera is a fixed camera, intercepts the comparison detection area from the shooting areas of other fixed cameras in the scene where the target camera is located, realizes a more comprehensive and accurate determination of the comparison detection area, thereby realizing the automatic and accurate identification of false detections, improving the accuracy of object detection, reducing the consumption of the camera, and enhancing the user experience.
[0165] See Figure 6 , which is a flowchart of another embodiment for determining the comparison detection area provided by the embodiments of the present application. Figure 6 The process shown in Figure 3 On the basis of the process shown, it describes how to obtain the comparison detection area of the above object at other shooting angles from the target camera when the target camera is a pan-tilt camera, for example Figure 2 The application scenario shown. As Figure 6 shown, the process may include the following steps:
[0166] Step 601, obtain the coordinate information of the target detection area at the current shooting angle.
[0167] The above coordinate data refers to the coordinate data corresponding to the shooting area of the target detection area at the current shooting angle of the target camera, and the coordinate data can be spatial coordinate data with the target camera as the original coordinate.
[0168] In the embodiments of the present application, in order to mark the position of the target detection area in the target camera, after determining the target detection area, the execution entity of the embodiments of the present application may establish a spatial coordinate system for the target camera and determine the coordinate data of the target detection area in the spatial coordinate system.
[0169] Optionally, it may establish a three-dimensional coordinate system with the center point of the target camera in space (such as the center of the pan-tilt) as the original coordinate.
[0170] Step 602: Rotate the target camera by a preset angle to obtain the shooting area of the object at the new shooting angle, and the shooting area includes the target detection area.
[0171] The above-mentioned shooting area refers to the shooting picture displayed after the target camera rotates by a preset angle. Further, in order to determine the comparison detection area corresponding to the target detection area therefrom, the shooting area may include the target detection area, that is, the detection area of the above-mentioned object, which can illustrate the existence of the object in the shooting area.
[0172] The above-mentioned preset angle may be the rotation angle of the target camera preset by the user, or the rotation angle determined according to the movement of the object after the target camera is triggered. The embodiments of the present application do not limit this. It should be noted that after the target camera rotates, its shooting area includes the object photographed before rotation.
[0173] In one embodiment, since the pan-tilt camera can rotate to change the shooting angle, therefore, when the execution entity of the embodiments of the present application detects an object, it can obtain the shooting pictures of the above-mentioned object at different shooting angles by rotating the target camera, so as to determine the shooting area from the shooting pictures.
[0174] It can be understood that if the shooting area of the target camera after rotation does not include the object, the target camera can make self-adjustment so that the shooting area of the target camera includes the object.
[0175] Step 603: Determine the coordinate mapping relationship between the shooting area of the target camera at the shooting angle corresponding to the target detection area and at the new shooting angle.
[0176] Step 604: Determine the new coordinate data of the target detection area at the new shooting angle according to the coordinate mapping relationship and the coordinate data of the target detection area at the current shooting angle.
[0177] Step 605: Determine the area corresponding to the new coordinate data as the comparison detection area.
[0178] The following is a unified description of steps 603 to 605:
[0179] The above coordinate mapping relationship refers to the mapping relationship between the coordinates of the target camera at the current shooting angle and the shooting angle after rotation in the same coordinate system. Since the target detection area is located within the shooting area of the target camera, the above coordinate mapping relationship can also represent the mapping relationship between the coordinates of the target detection area at the current shooting angle and the new shooting angle after rotation.
[0180] In the embodiments of the present application, in Figure 2 the application scenario shown, since the pan-tilt camera can rotate to different shooting angles, in practical applications, generally one pan-tilt camera is installed in this application scenario. Therefore, when determining the comparison detection area corresponding to the target detection area of the target camera, it can be obtained from the target camera.
[0181] As an alternative implementation, the execution subject of the embodiments of the present application can control the target camera to rotate at a preset angle, so as to obtain the shooting area of the target camera for the above object at a new shooting angle.
[0182] After that, in order to determine the comparison detection area corresponding to the target detection area from the new shooting area, the execution subject of the embodiments of the present application can determine the coordinate mapping relationship between the shooting area of the target camera at the shooting angle corresponding to the target detection area and the new shooting angle.
[0183] As an exemplary implementation, the execution subject of the embodiments of the present application can determine the above coordinate mapping relationship based on parameters such as the rotation angle, direction, and frame distortion of the pan-tilt in the target camera.
[0184] Based on this, the new coordinate data of the target detection area at the new shooting angle can be determined according to the above coordinate mapping relationship and the coordinate data of the target detection area at the current shooting angle.
[0185] Finally, the area corresponding to the above new coordinate data can be determined as the comparison detection area of the target detection area.
[0186] It can be understood that the number of comparison detection areas determined in the embodiments of the present application can be one or multiple. When determining multiple comparison detection areas, the target camera can be rotated multiple times, and according to the above steps 602 to 605, the comparison detection areas determined each time the camera is rotated can be determined.
[0187] In addition, for the purpose of facilitating understanding of how to apply the object detection method provided in the embodiments of the present application to perform object detection in the Figure 2 application scenario shown, the following is an example for illustration:
[0188] Refer to Figure 7 , which is a flowchart of an embodiment of another object detection method provided by the embodiments of the present application. AsFigure 7 As shown, the process may include the following steps:
[0189] 1. Trigger area marking: When an object appears within the field of view of the target camera, the intelligent camera is triggered to perform object detection. The intelligent camera is used as the target camera to obtain the detected target box. Then, the maximum bounding rectangle of all detected boxes can be calculated, which is Figure 3 the target detection area involved, denoted as A0.
[0190] 2. Construct comparison picture set: Actively trigger the pan-tilt of the target camera to rotate at an appropriate angle so that the picture frame can include the trigger area range while generating new field of view changes at the same time. Use the new picture frame after the pan-tilt rotation as the comparison picture set, which serves as the data object for mutual verification with the target detection area.
[0191] 3. Same area marking: Based on the angle, direction of the pan-tilt rotation and the picture frame distortion parameters, determine the linear mapping relationship of the target camera before and after rotation at the shooting angle before rotation, and calculate the position area of the maximum bounding rectangle in step 1 in the new picture frame based on this. This is the same area (i.e., the comparison detection area), denoted as A1.
[0192] 4. Mutual verification of detected objects: Perform object detection on the new picture frame again, and obtain the target detection results of the trigger area A0 and the same area A1 respectively. Then, the consistency of the detection results in the same area in the fields of view of different intelligent cameras can be verified according to indicators such as the detected objects, the number of detected objects, and the size of the detection box included in the detection results.
[0193] 5. Automatic capture of false detections: If there are no detected objects in area A1_i, or the number of object detections is inconsistent, or there are obvious differences in the size of the detection boxes, it can be considered that the target detection confidence in area A0 is low, so there are false detections.
[0194] 6. Adaptive processing and feedback of false detections: If false detections are captured, a shielding area is automatically generated based on the size of the trigger area to prevent high-frequency false triggers in the same area subsequently and save power consumption. Then, the cropped image of the false detection area can be obtained and fed back to the self-learning module of the object detection model, thereby triggering the self-learning optimization process of the object detection model.
[0195] The technical solution provided by the embodiment of the present application obtains the coordinate information of the target detection area at the current shooting angle, rotates the target camera according to a preset angle to obtain the shooting area of the object at the new shooting angle, where the shooting area includes the target detection area, determines the coordinate mapping relationship between the shooting area of the target camera at the corresponding shooting angle of the target detection area and at the new shooting angle, determines the new coordinate data of the target detection area at the new shooting angle according to the coordinate mapping relationship and the coordinate data of the target detection area at the current shooting angle, and determines the area corresponding to the new coordinate data as the comparison detection area. This technical solution, when the target camera is a pan-tilt camera, rotates the target camera and determines the coordinate mapping relationship at different shooting angles before and after rotation to determine the comparison detection area corresponding to the target detection area, realizing a more comprehensive and accurate determination of the comparison detection area, thereby automatically and accurately identifying false detections, improving the accuracy of object detection, reducing camera consumption, and enhancing the user experience.
[0196] See Figure 8 , which is a block diagram of an embodiment of an object detection device provided by an embodiment of the present application. As Figure 8 shown, the device may include:
[0197] The first determination module 81 is configured to determine the target detection area of the object by the target camera at the current shooting angle when the target camera detects the object;
[0198] The second determination module 82 is configured to determine the comparison detection area of the object at other shooting angles;
[0199] The shielding module 83 is configured to, when it is determined that there is a false detection in the target detection area according to the target detection area and the comparison detection area, determine the false detection area of the target camera based on the target detection area and shield the false detection area;
[0200] The detection module 84 is configured to perform object detection on other detection areas in the target camera except the false detection area.
[0201] As a possible implementation, the first determination module 81 is specifically configured to:
[0202] Determine at least one detection frame of the object by the target camera at the current shooting angle;
[0203] Determine the minimum abscissa value, the maximum abscissa value, the minimum ordinate value, and the maximum ordinate value in all the detection frames;
[0204] Determine the region composed of the minimum abscissa value, the maximum abscissa value, the minimum ordinate value, and the maximum ordinate value as the target detection region of the object by the target camera at the current shooting angle.
[0205] As a possible implementation, the target camera is a fixed camera, and the scene where the target camera is located includes at least one other fixed camera. The second determination module 82 includes:
[0206] A first determination sub-module, configured to determine the shooting regions of at least one of the other fixed cameras for the object at the same moment;
[0207] An intercepting sub-module, configured to intercept a plurality of initial comparison detection regions from the shooting regions, where the initial comparison detection regions are the same size as the target detection region;
[0208] A second determination sub-module, configured to determine the similarity between the target detection region and each of the initial comparison detection regions;
[0209] A third determination sub-module, configured to determine the initial comparison detection region with the maximum similarity as the comparison detection region of the object at other shooting angles.
[0210] As a possible implementation, the intercepting sub-module is specifically configured to:
[0211] Starting from the upper left corner of the shooting region, traverse along the width and height of the shooting region step by step with a single pixel;
[0212] Use the traversed pixel point as the upper left corner of the initial comparison detection region, and intercept the shooting region with the length and width of the target detection region as the length and width of the initial comparison detection region to obtain the initial comparison detection region.
[0213] As a possible implementation, the target camera is a pan-tilt camera. The second determination module 82 is specifically configured to:
[0214] Obtain the coordinate data of the target detection region at the current shooting angle;
[0215] Rotate the target camera according to a preset angle to obtain the shooting region of the object at a new shooting angle, where the shooting region includes the target detection region;
[0216] Determine the coordinate mapping relationship between the shooting region of the target camera at the shooting angle corresponding to the target detection region and at the new shooting angle;
[0217] Determine the new coordinate data of the target detection area at the new shooting angle according to the coordinate mapping relationship and the coordinate data of the target detection area at the current shooting angle;
[0218] Determine the area corresponding to the new coordinate data as the comparison detection area.
[0219] As a possible implementation, the shielding module 83 includes:
[0220] An acquisition sub-module, configured to respectively acquire the target detection image corresponding to the target detection area and the comparison detection image corresponding to the comparison detection area;
[0221] An object detection sub-module, configured to respectively perform object detection on the target detection image and the comparison detection image to obtain a target detection result and a comparison detection result;
[0222] A fourth determination sub-module, configured to determine the detection confidence of the target detection area according to the target detection result and the comparison detection result;
[0223] A fifth determination sub-module, configured to determine that there is a misdetection in the target detection area when it is determined that the detection confidence is less than a preset confidence threshold.
[0224] As a possible implementation, the fourth determination sub-module is specifically configured to:
[0225] Determine the detected target detection object, the number of target detection objects, and the size of the target detection frame from the target detection result;
[0226] Determine the detected comparison detection object, the number of comparison detection objects, and the size of the comparison detection frame from the comparison detection result;
[0227] When the target detection area meets one or more of the following conditions, determine that the detection confidence of the target detection area is less than a preset confidence threshold:
[0228] The target detection object is inconsistent with the comparison detection object, the number of target detection objects is inconsistent with the number of comparison detection objects, and the difference between the size of the target detection frame and the size of the comparison detection frame is greater than a preset threshold.
[0229] As a possible implementation, the shielding module 83 is specifically configured to:
[0230] Determine the target detection area as the misdetection area of the target camera.
[0231] As a possible implementation, the shielding module 83 is specifically configured to:
[0232] Determine one or more misdetection regions from the target detection region as follows:
[0233] In the case where it is determined that the target detection object is inconsistent with the comparison detection object, determine the detection region where the target detection object is inconsistent with the comparison detection object as the misdetection region of the target camera;
[0234] In the case where it is determined that the number of target detection objects is inconsistent with the number of comparison detection objects, determine the first difference region between the target detection region and the comparison detection region, and determine the first difference region as the misdetection region of the target camera;
[0235] In the case where it is determined that the size of the target detection box is inconsistent with the size of the comparison detection box, determine the second difference region between the target detection box and the comparison detection box, and determine the second difference region as the misdetection region of the target camera.
[0236] As a possible implementation, the device further includes (not shown in the figure):
[0237] An image acquisition module, configured to acquire an image of the misdetection region corresponding to the misdetection region after masking the misdetection region;
[0238] A sending module, configured to send the misdetection region image to the object detection model of the target camera, so that the object detection model performs self-learning based on the misdetection region image.
[0239] As Figure 9 shown, a schematic structural diagram of an electronic device provided by an embodiment of the present application includes a processor 91, a communication interface 92, a memory 93, and a communication bus 94. Among them, the processor 91, the communication interface 92, and the memory 93 communicate with each other through the communication bus 94.
[0240] The memory 93 is used to store a computer program;
[0241] In an embodiment of the present application, when the processor 91 is used to execute the program stored on the memory 93, it implements the object detection method provided by any one of the foregoing method embodiments, including:
[0242] When the target camera detects an object, determine the target detection region of the object by the target camera at the current shooting angle;
[0243] Determine the comparison detection region of the object at other shooting angles;
[0244] In the case where it is determined that there is a misdetection in the target detection area based on the target detection area and the comparison detection area, determine the misdetection area of the target camera based on the target detection area, and mask the misdetection area;
[0245] Perform object detection on other detection areas in the target camera except the misdetection area.
[0246] An embodiment of the present application also provides a storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the object detection method provided in any of the foregoing method embodiments are implemented.
[0247] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0248] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution, in essence, or the part that contributes to the related technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0249] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "a", "an", and "the" as used herein may also include the plural forms. The terms "comprising", "including", "containing", and "having" are inclusive and thus specify the presence of the stated features, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not to be construed as necessarily requiring them to be executed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps can be used.
[0250] The above are only specific embodiments of the present invention, enabling those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. An object detection method, characterized in that, The method includes: When the target camera detects an object, determining a target detection area of the object by the target camera at the current shooting angle; Determining a comparison detection area of the object at other shooting angles; When it is determined that there is a false detection in the target detection area according to the target detection area and the comparison detection area, determining a false detection area of the target camera based on the target detection area, and masking the false detection area; Performing object detection on other detection areas in the target camera except the false detection area.
2. The method according to claim 1, wherein The determining the target detection area of the object by the target camera at the current shooting angle includes: Determining at least one detection box of the object by the target camera at the current shooting angle; Determining the minimum abscissa value, the maximum abscissa value, the minimum ordinate value, and the maximum ordinate value among all the detection boxes; Determining the area composed of the minimum abscissa value, the maximum abscissa value, the minimum ordinate value, and the maximum ordinate value as the target detection area of the object by the target camera at the current shooting angle.
3. The method according to claim 1, wherein The target camera is a fixed camera, and the scene where the target camera is located includes at least one other fixed camera. The determining the comparison detection area of the object at other shooting angles includes: Determining the shooting areas of at least one of the other fixed cameras for the object at the same moment; Intercepting a plurality of initial comparison detection areas from the shooting areas, and the initial comparison detection areas are of the same size as the target detection area; Determining the similarity between the target detection area and each initial comparison detection area; Determining the initial comparison detection area with the maximum similarity as the comparison detection area of the object at other shooting angles.
4. The method according to claim 3, wherein The intercepting a plurality of initial comparison detection areas from the shooting areas includes: Taking the upper left corner of the shooting area as the starting point, and traversing sequentially along the width and height of the shooting area with a single pixel as the step; Taking the traversed pixel point as the upper left corner of the initial comparison detection area, and intercepting the shooting area with the length and width of the target detection area as the length and width of the initial comparison detection area to obtain the initial comparison detection area.
5. The method according to claim 1, wherein The target camera is a pan-tilt camera. The determining the comparison detection area of the object at other shooting angles includes: Obtaining the coordinate data of the target detection area at the current shooting angle; Rotating the target camera at a preset angle to obtain a shooting area of the object at a new shooting angle, and the shooting area includes the target detection area; Determining the coordinate mapping relationship between the shooting area of the target camera at the shooting angle corresponding to the target detection area and at the new shooting angle; Determining the new coordinate data of the target detection area at the new shooting angle according to the coordinate mapping relationship and the coordinate data of the target detection area at the current shooting angle; Determining the area corresponding to the new coordinate data as the comparison detection area.
6. The method according to claim 1, characterized in that Determining that there is a misdetection in the target detection area according to the target detection area and the comparison detection area includes: Obtaining the target detection image corresponding to the target detection area and the comparison detection image corresponding to the comparison detection area respectively; Performing object detection on the target detection image and the comparison detection image respectively to obtain a target detection result and a comparison detection result; Determining the detection confidence level of the target detection area according to the target detection result and the comparison detection result; Determining that there is a misdetection in the target detection area when it is determined that the detection confidence level is less than a preset confidence level threshold.
7. The method according to claim 6, wherein Determining the detection confidence level of the target detection area according to the target detection result and the comparison detection result includes: Determining the detected target detection object, the number of target detection objects, and the size of the target detection frame from the target detection result; Determining the detected comparison detection object, the number of comparison detection objects, and the size of the comparison detection frame from the comparison detection result; When the target detection area meets one or more of the following conditions, determining that the detection confidence level of the target detection area is less than a preset confidence level threshold: The target detection object is inconsistent with the comparison detection object, the number of target detection objects is inconsistent with the number of comparison detection objects, and the difference between the size of the target detection frame and the size of the comparison detection frame is greater than a preset threshold.
8. The method according to claim 1, wherein Determining the misdetection area of the target camera based on the target detection area includes: Determining the target detection area as the misdetection area of the target camera.
9. The method according to claim 7, characterized in that, Determining the misdetection area of the target camera based on the target detection area includes: Determining one or more of the following misdetection areas from the target detection area: When it is determined that the target detection object is inconsistent with the comparison detection object, determining the detection area where the target detection object is inconsistent with the comparison detection object as the misdetection area of the target camera; When it is determined that the number of target detection objects is inconsistent with the number of comparison detection objects, determining a first difference area between the target detection area and the comparison detection area, and determining the first difference area as the misdetection area of the target camera; When it is determined that the size of the target detection frame is inconsistent with the size of the comparison detection frame, determining a second difference area between the target detection frame and the comparison detection frame, and determining the second difference area as the misdetection area of the target camera.
10. The method according to claim 1, characterized in that After masking the misdetection area, it further includes: Obtaining the misdetection area image corresponding to the misdetection area; Sending the misdetection area image to the object detection model of the target camera so that the object detection model performs self-learning based on the misdetection area image.
11. An object detection device, characterized in that, The device includes: A first determination module, configured to determine the target detection area of the object by the target camera at the current shooting angle when the target camera detects an object; A second determination module, configured to determine the comparison detection area of the object at other shooting angles; A shielding module, configured to determine a misdetection area of the target camera based on the target detection area and, in case that misdetection exists in the target detection area determined according to the target detection area and the comparison detection area, shield the misdetection area; A detection module, configured to perform object detection on other detection areas of the target camera except the misdetection area.
12. An electronic device, characterized in that, Comprising: A processor and a memory, where the processor is configured to execute an object detection program stored in the memory to implement the object detection method according to any one of claims 1 to 10.