Object detection method, device, equipment and storage medium
By segmenting images in embedded edge computing devices and combining high and low complexity models for object detection, the problem of difficulty in balancing detection efficiency and accuracy in the existing technology is solved, and more efficient and accurate object detection is achieved.
Patent Information
- Application Number
- CN202110281522.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-16
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2041-03-16
AI Technical Summary
It is difficult for existing embedded edge computing devices to achieve a balance between real-time performance and detection accuracy in object detection, and is limited by computing power, resulting in low detection efficiency.
By determining the candidate frames and target areas in the image, segmenting them into smaller sub-images for detection, using low-complexity models for object detection, and combining high-complexity models for partial image processing to improve detection accuracy.
It improves the efficiency and accuracy of object detection, reduces the demand for device computing power, and is suitable for a variety of scenarios.
Smart Images

Figure CN113033551B
Abstract
Description
Technical Field
[0001] Various implementations of the present disclosure relate to the computer field, and more particularly, to a method, a device, and a computer storage medium for object detection. Background Art
[0002] At present, with the development of computer vision technology, object detection technology has been widely used in security, monitoring, intelligent transportation and many other fields. In order to improve the real-time processing, some solutions use embedded edge computing devices to perform object detection, for example, to detect, count or track pedestrians in the picture. However, since the computing power of embedded edge computing devices is relatively limited, how to improve the efficiency of object detection has become the focus of current attention. Summary of the invention
[0003] An embodiment of the present disclosure provides a solution for object detection.
[0004] In a first aspect of the present disclosure, a method for object detection is provided. The method comprises: determining a first set of candidate frames in a first image captured by an image capture device, the first set of candidate frames indicating objects that may be included in the first image; determining a target area based on the first set of candidate frames; determining a sub-image corresponding to the target area from a second image subsequently captured by the image capture device; and detecting at least one object from the sub-image.
[0005] In a second aspect of the present disclosure, a device for object detection is provided. The device includes: a first candidate frame determination module configured to determine a first group of candidate frames in a first image captured by an image capture device, the first group of candidate frames indicating objects that may be included in the first image; a target area determination module configured to determine a target area based on the first group of candidate frames; a sub-image determination module configured to determine a sub-image corresponding to the target area from a second image subsequently captured by the image capture device; and an object detection module configured to detect at least one object from the sub-image.
[0006] In a third aspect of the present disclosure, an electronic device is provided, comprising: a memory and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method according to the first aspect of the present disclosure.
[0007] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which one or more computer instructions are stored, wherein the one or more computer instructions are executed by a processor to implement the method according to the first aspect of the present disclosure.
[0008] According to various embodiments of the present disclosure, in the subsequent object detection process, a sub-image with a smaller size can be used to perform object detection, thereby improving the efficiency of object detection. Such a method can reduce the demand for device computing power and has better universality. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:
[0010] Figure 1 A schematic diagram illustrating an example environment in which various embodiments of the present disclosure can be implemented;
[0011] Figure 2 A schematic diagram showing object detection according to some embodiments of the present disclosure is shown;
[0012] Figure 3 A flowchart illustrating an example process for object detection according to some embodiments of the present disclosure;
[0013] Figure 4 A schematic structural block diagram of an apparatus for determining a drivable area according to some embodiments of the present disclosure is shown; and
[0014] Figure 5 A block diagram of a computing device capable of implementing various embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0015] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0016] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.
[0017] In the field of computer vision, traditional object detection methods applied to embedded edge computing devices mainly include the following categories:
[0018] (1) Frame-by-frame detection based on deep learning. On the one hand, the computing power of embedded edge computing devices cannot support real-time detection using high-complexity models. Therefore, this method is difficult to achieve a balance between real-time performance and detection accuracy.
[0019] (2) Methods based on simple cropping. Traditional cropping-based methods make full use of the temporal continuity of video input to improve detection accuracy. However, in this method, since the regions where objects (e.g., pedestrians) appear in the image are highly random, there may be multiple regions containing objects. In this case, all regions containing objects need to be detected, which may take more time than using a large model to detect the entire image.
[0020] (3) Methods based on target tracking. The overall idea of the traditional target tracking method is to use the target detection algorithm on a certain frame in the video to obtain the detection frame of the pedestrian; all the detection frames are input into the target tracking algorithm, and the target tracking algorithm gives the pedestrian detection results of the subsequent video frames frame by frame. However, the detection accuracy of this method is low.
[0021] (4) Methods based on image difference. Traditional methods based on image difference involve a priori judgment of object pixel values, and are therefore easily affected by factors such as lighting and weather. There will be many missed detections at noon with strong lighting or at dusk with weak lighting. In addition, the process of calculating inter-frame differences in this method is easily affected by the resolution of the video image, and it takes a long time to calculate inter-frame differences at high resolution.
[0022] Therefore, how to improve the accuracy of object detection while ensuring the real-time detection has become the current focus.
[0023] According to an embodiment of the present disclosure, a scheme for object detection is provided. In an embodiment of the present disclosure, first, a first group of candidate frames in a first image captured by an image capture device is determined, wherein the first group of candidate frames indicates objects that may be included in the first image. Subsequently, a target area is determined based on the first group of candidate frames, and a sub-image corresponding to the target area is determined from a second image subsequently captured by the image capture device. Accordingly, at least one object is detected from the sub-image. According to the facts of the present disclosure, a sub-image with a smaller size can be used to perform object detection in a subsequent object detection process, thereby improving the efficiency of object detection.
[0024] Example Environment
[0025] See first Figure 1 , which schematically shows a schematic diagram of an environment 100 in which an exemplary implementation according to the present disclosure can be implemented. Figure 1As shown, environment 100 may include an image capture device 120 configured to capture one or more images 110 of a target area.
[0026] In some implementations, the image capture device 120 may be, for example, an overhead camera, for example, mounted on a tower 130 for security monitoring purposes. It should be understood that the image capture device 120 may also be mounted in other appropriate ways.
[0027] like Figure 1 As shown, the image capture device 120 may also be coupled to a computing device 140. In some implementations, the computing device 140 may include, for example, an embedded edge computing device configured to acquire an image 110 captured by the image capture device 120 and perform an object detection method to detect one or more objects 150 from the image 110.
[0028] In some implementations, object 150 may include, for example, pedestrians, animals, vehicles, etc. Computing device 140 may determine the corresponding position of the object in image 110. For example, computing device 140 may generate one or more candidate boxes to indicate that the area may include an object.
[0029] In some implementations, the object detection information (eg, candidate boxes) determined by the computing device 140 may be further used for object counting, target object identification, or object tracking. The detailed process of object detection will be described in detail below. Figures 2 to 3 Detailed description.
[0030] Example Principle
[0031] Figure 2 200 is a schematic diagram of object detection according to an embodiment of the present disclosure. Figure 1 As shown, the first recognition model 215 and the second recognition model 235 may be deployed in the computing device 140. In some implementations, the first recognition model 215 and the second recognition model 235 may include, for example, appropriate machine learning models for detecting objects from an input image.
[0032] In some implementations, the first recognition model 215 and the second recognition model 235 may have different performances, for example. For example, the model complexity of the first recognition model 215 may be higher than that of the second recognition model 235. Taking a deep neural network as an example, the first recognition model 215 may have more complex input features, more layers, etc., so that the first recognition model 215 can process images with higher resolutions to output more accurate detection results. It should be understood that when the computing power of the computing device 140 is fixed, the time required for the first recognition model 215 may be higher than that of the second recognition model 235.
[0033] like Figure 2 As shown, the computing device 140 may use the first recognition model 215 to process the first image 210-1 captured by the image capture device 120 at the first moment, thereby determining a first set of candidate frames 220 in the first image 210-1. The first set of candidate frames 220 may, for example, indicate an area in the first image 210-1 that may include an object.
[0034] In some implementations, the confidence of each candidate box in the first group of candidate boxes 220 determined by the first recognition model 215 is higher than a predetermined first confidence threshold. For example, the first recognition model 215 can determine the candidate boxes with confidence higher than 0.15 among all the candidate boxes as the first group of candidate boxes 220.
[0035] In some implementations, the computing device 140 may further pre-process the first image 210-1 before providing the first image 210-1 to the first recognition model 215. Specifically, the computing device 140 may adjust the first image 210-1 to fit the first recognition model 215. For example, the computing device 140 may perform operations such as cropping or scaling on the first image 210-1 to fit the first recognition model 215.
[0036] For example, the first recognition model 215 may be an EfficientDet-D2 model, which needs to downsample the input image to 1 / 128 of the original size in the feature extraction part. Therefore, in order to improve the accuracy of the model processing, the computing device 210 may process the first image 210-1 so that its resolution is a multiple of 128. Exemplarily, if the resolution of the first image 210-1 is 1024*512, the computing device 140 may first scale down the first image 210-1 with a resolution of 1920×1080 to 1024×576, and then crop 32 pixels from the top and bottom of the scaled-down image to change the image resolution to 1024×512. Based on this approach, the computing device 140 can ensure that the input image of the first recognition model 215 is a multiple of 128. On the other hand, in actual operation, the probability of an object appearing at the top and bottom of the image is small, so performing the cropping operation will not affect the final detection accuracy.
[0037] It should be understood that other appropriate models may also be used as the first recognition model 215 , for example, EfficientDet-D3 / D4, FasterRCNN, etc. The present disclosure is not intended to limit the specific type of the first recognition model 215 .
[0038] Additionally, the computing device 140 may process the adjusted first image using the first recognition model 215 to determine a first set of candidate boxes 220. In some implementations, the computing device 140 may further determine a target area 225 having a predetermined size based on the first set of candidate boxes 220 determined by the first recognition model 215.
[0039] In some implementations, instead of directly determining all candidate boxes as the cropping area in the conventional manner, the computing device 140 may determine a single target area 225 having a target size based on the first group of candidate boxes 220 .
[0040] In some implementations, the computing device 140 may determine a target candidate frame in the first group of candidate frames 220 based on the position of the first group of candidate frames 220, wherein the number of neighboring candidate frames of the target candidate frame is higher than a predetermined threshold. The neighboring candidate frame refers to a candidate frame whose distance from the target candidate frame is less than a predetermined threshold.
[0041] In some implementations, the computing device 140 may determine the distance between the two candidate frames based on the distance between the center points of the two candidate frames. Accordingly, the computing device 140 may determine the distance between each two candidate frames in the first group of candidate frames 220, and determine the candidate frames whose distance is less than a predetermined threshold as adjacent candidate frames.
[0042] The computing device 140 can thereby determine the number of adjacent candidate frames of each candidate frame in the first group of candidate frames 220, and determine the candidate frames whose number is greater than a predetermined threshold as target candidate frames. For example, the computing device 140 can determine the candidate frame with the most adjacent candidate frames as the target candidate frame. When there are multiple adjacent candidate frames, the computing device 140 can, for example, randomly select one of them as the target candidate frame.
[0043] Additionally, the computing device 140 may determine a target region 225 having a predetermined size based on the position of the target candidate frame. Exemplarily, the computing device 140 may determine a target region 225 having a predetermined size based on the position of the center point of the target candidate frame and using the position as the center of the target region. For example, if the center point of the target candidate frame is (x, y) and the size of the target region 225 is (w, h), the four vertices of the target candidate frame may be represented as (xw, yh), (xw, y+h), (x+w, yh) and (x+w, y+h), so that the range of the target region 225 may be determined.
[0044] In some implementations, the computing device 140 may also determine the target area 225, for example, by using a method of traversing the image. Exemplarily, the computing device 140 may determine the target area 225 having a predetermined size based on the positions of the first group of candidate boxes 220, so that the target area covers at least one candidate box in the first group of candidate boxes, wherein the ratio of the number of first candidate boxes of the at least one candidate box to the number of second candidate boxes of the first group of candidate boxes is greater than a predetermined threshold.
[0045] For example, the computing device 140 may traverse the image using a region of a predetermined size as a sliding window to determine the number of candidate boxes covered by different regions. Here, coverage may indicate that the center point of the candidate box is located in the region, or that all four vertices of the candidate box are located in the region.
[0046] Exemplarily, the computing device 140 may determine the target area 225 by means of a sliding window, so that the target area 225 can cover more than a predetermined proportion of the candidate frames in the first group of candidate frames 220 .
[0047] Based on this approach, a target area having a size smaller than the original image can be determined. It should be understood that, generally speaking, the area where an object may appear in an image is relatively concentrated.
[0048] In some implementations, the distance between the image capture device 120 and the captureable object is greater than a predetermined threshold. For example, the image capture device 120 may be an elevated camera on a tower for detecting pedestrians, which makes the area where pedestrians may appear in the image captured by the camera relatively concentrated.
[0049] like Figure 2 As shown, computing device 140 may obtain a second image 210 - 2 captured by image capture device 120 at a second time, where the second time is later than the first time. In some implementations, first image 210 - 1 and second image 210 - 2 are adjacent image frames in a video captured by image capture device 120 .
[0050] For the second image 210 - 2 , the computing device 140 may first determine a sub-image 230 corresponding to the target area 225 , and provide the sub-image 230 to a second recognition model 235 for detecting a first object in the sub-image 230 .
[0051] In some implementations, the second recognition model 235 can, for example, determine a second set of candidate boxes 240 associated with the first object in the sub-image 230. The second recognition model 235 can, for example, be an EfficientDet-D0 detection model, which is, for example, trained to process images of size 256*256. It should be understood that the second recognition model 235 can also adopt other appropriate models, such as Yolo v3 / v4 models, etc. The present disclosure is not intended to limit the specific type of the second recognition model 235.
[0052] In some implementations, the confidence of the second group of candidate boxes 240 determined by the second recognition model 235 can be, for example, higher than the second confidence threshold. Considering that there is less interference in the sub-image, in order to improve the processing speed of the second recognition model 235, the second confidence threshold can be set to be lower than the first confidence threshold associated with the first recognition model 215, for example.
[0053] Since the second recognition model 235 is a model with a relatively low model complexity, it can be efficiently executed by the computing device 140. In addition, since the image size processed by the second recognition model 235 is relatively small, it can improve the accuracy of object detection while ensuring real-time performance. On the other hand, since the distribution of objects in the image is relatively concentrated, the determined sub-image will be able to cover most of the objects and meet the application needs in most scenarios.
[0054] In some implementations, the computing device 140 may perform object tracking using the matching between the first group of candidate frames 220 and the second group of candidate frames 240. For example, the computing device 140 may determine the tracking information of the first object at the second moment based on the matching between the first group of candidate frames 220 and the second group of candidate frames 240, wherein the tracking information includes at least one of the following: position, motion direction, or motion rate.
[0055] Exemplarily, the computing device 140 may determine that a first candidate box in the first group of candidate boxes 220 and a second candidate box in the second group of candidate boxes 240 correspond to the same object. Accordingly, the computing device 140 may determine the position, movement method, and movement rate of the object at the second moment based on the difference in position between the first candidate box and the second candidate box.
[0056] In some implementations, in order to ensure a balance between processing efficiency and object detection performance, the computing device 140 may also periodically use the first recognition model 215 to process the complete input image, and use the second recognition model 235 to process the sub-image corresponding to the target area for the intermediate frame.
[0057] like Figure 2As shown, the computing device 140 may, for example, continue to process a predetermined number (e.g., one or more) of images (e.g., image frames) using the second recognition model 215. For example, the computing device 140 may also use the second recognition model 235 to process a sub-image 245 corresponding to the target area 225 in the image 210-3 captured by the image capture device 120, and output a set of candidate boxes 250 in the sub-image 245.
[0058] For the third image 210-4 captured by the image capture device 120 at the third time, the computing device 140 can use the first recognition model 215 to process according to the process discussed with reference to the first image 210-1 to determine a set of candidate boxes 255. In some implementations, the third time is later than the first time by a predetermined time interval.
[0059] It should be understood that the set of candidate boxes 255 can be further used, for example, to determine a new target area and used in the process of the computing device 140 processing subsequent images using the second recognition model 235 .
[0060] In some scenarios, for the first group of candidate frames 220 , the determined target area 225 may not cover some of the candidate frames therein, which may cause the second recognition model 235 to be unable to detect the object corresponding to the part of the candidate frames.
[0061] In some implementations, the computing device 140 may estimate the motion information of the objects using the object detection result of the fourth image previously processed by the first recognition model 235. For example, the computing device 140 may obtain a third group of candidate frames determined by the first recognition model based on the fourth image, where the fourth image is captured by the image capture device at a fourth moment, and the fourth moment is a predetermined time interval earlier than the first moment.
[0062] Additionally, the computing device 140 may determine the motion information of the third object at the first moment based on the match between the third group of candidate frames and the first group of candidate frames, and the third object is associated with a predetermined candidate frame of the first group of candidate frames outside the target area. For example, the computing device 140 may determine that the third candidate frame in the third group of candidate frames and the fourth candidate frame in the first group of candidate frames 220 indicate the same third object, then the computing device 140 may determine the motion information of the third object, such as the motion direction and motion rate, based on the distance between the third candidate frame and the fourth candidate frame and based on the time interval between the first moment and the fourth moment.
[0063] Additionally, the computing device 140 may also determine the tracking information of the third object at the second moment based on the predetermined candidate frame and the motion information in the first image 210-1. For example, the computing device 140 may infer the position, motion direction, and motion speed of the third object at the second moment based on the determined motion direction and motion speed.
[0064] In this way, although the second recognition model 235 may not detect the third object in the sub-image 230, the embodiment of the present disclosure can infer the tracking information of the third object based on the previous detection result of the first recognition model, thereby ensuring the integrity of the object detection.
[0065] Example Process
[0066] The following will be combined Figure 3 Let’s take a look at the example process of object detection. Figure 3 FIG. 3 is a flow chart showing an example process 300 for object detection according to some embodiments of the present disclosure. The process 300 may be performed by, for example Figure 1 The invention is implemented by the computing device 140 in the embodiment.
[0067] like Figure 3 As shown, in block 302 , the computing device 140 determines a first set of candidate frames in a first image captured by an image capture device at a first moment, the first set of candidate frames indicating areas in the first image that may include an object.
[0068] In block 304 , the computing device 140 determines a target area having a predetermined size based on the first set of candidate boxes.
[0069] At block 306 , the computing device 140 determines a sub-image corresponding to the target area from a second image captured by the image capture device at a second time instant, the second time instant being later than the first time instant.
[0070] At block 308 , computing device 140 detects a first object from the sub-image.
[0071] In some implementations, detecting the first object includes: determining a second group of candidate boxes associated with the first object in the sub-image, wherein the first group of candidate boxes is determined by a first recognition model, the second group of candidate boxes is determined by a second recognition model, and the model complexity of the second recognition model is lower than that of the first recognition model.
[0072] In some implementations, determining a first set of candidate boxes in a first image captured by an image capture device includes: adjusting the first image to fit a first recognition model; and processing the adjusted first image using the first recognition model to determine the first set of candidate boxes.
[0073] In some implementations, the first recognition model determines a first set of candidate boxes based on a first confidence threshold, and the second recognition model determines a second set of candidate boxes based on a second confidence threshold, where the first confidence threshold is lower than the second confidence threshold.
[0074] In some implementations, process 300 further includes: determining tracking information of the first object at the second moment based on a match between the first set of candidate frames and the second set of candidate frames, the tracking information including at least one of the following: position, movement direction, or movement speed.
[0075] In some implementations, process 300 also includes: processing a third image captured by the image capture device at a third moment with a first recognition model to detect a second object included in the third image, wherein the third moment is a predetermined time interval later than the first moment, and a sub-image corresponding to the target area of at least one image captured by the image capture device between the first moment and the second moment is provided to a second recognition model for object detection.
[0076] In some implementations, process 300 also includes: obtaining a third group of candidate frames determined by the first recognition model based on a fourth image, the fourth image being captured by an image capture device at a fourth moment, and the fourth moment being a predetermined time interval earlier than the first moment; determining motion information of a third object at the first moment based on a match between the third group of candidate frames and the first group of candidate frames, the third object being associated with a predetermined candidate frame of the first group of candidate frames outside the target area; and determining tracking information of the third object at the second moment based on the predetermined candidate frame and motion information in the first image.
[0077] In some implementations, determining the target area includes: determining a target candidate box in the first group of candidate boxes based on the positions of the first group of candidate boxes, the number of adjacent candidate boxes of the target candidate box being higher than a predetermined threshold, and the distance between the adjacent candidate boxes and the target candidate box being less than a predetermined threshold; and determining a target area having a predetermined size based on the position of the target candidate box.
[0078] In some implementations, determining the target area includes: based on the positions of the first group of candidate boxes, determining a target area with a predetermined size, so that the target area covers at least one candidate box in the first group of candidate boxes, wherein a ratio of the number of first candidate boxes of the at least one candidate box to the number of second candidate boxes of the first group of candidate boxes is greater than a predetermined threshold.
[0079] In some implementations, the distance between the image capture device and the capturable object is greater than a predetermined threshold.
[0080] In some implementations, the first image and the second image are adjacent video frames captured by an image capture device.
[0081] According to the scheme discussed above, the fact disclosed in the present invention can utilize a sub-image with a smaller size to perform object detection in the subsequent object detection process, thereby ensuring the real-time detection while providing the accuracy of object detection.
[0082] Example devices and equipment
[0083] The embodiments of the present disclosure also provide corresponding devices for implementing the above methods or processes. Figure 4 A schematic structural block diagram of an object detection device 400 according to some embodiments of the present disclosure is shown.
[0084] like Figure 4 As shown, the device 400 may include a first candidate frame determining unit 410, which is configured to determine a first group of candidate frames in a first image captured by an image capturing device at a first moment, the first group of candidate frames indicating areas in the first image that may include objects.
[0085] The apparatus 400 further includes a target region determining unit 420 configured to determine a target region having a predetermined size based on the first group of candidate frames.
[0086] The apparatus 400 further includes a sub-image determining unit 430 configured to determine a sub-image corresponding to the target area from a second image captured by the image capturing device at a second time, the second time being later than the first time.
[0087] The apparatus 400 further includes an object detection unit 440 configured to detect a first object from the sub-image.
[0088] In some implementations, the object detection unit 440 includes: a second candidate box determination unit, configured to determine a second group of candidate boxes associated with the first object in the sub-image, wherein the first group of candidate boxes is determined by a first recognition model, and the second group of candidate boxes is determined by a second recognition model, and the model complexity of the second recognition model is lower than that of the first recognition model.
[0089] In some implementations, the first candidate box determination unit 410 includes: an adjustment unit configured to adjust the first image to fit the first recognition model; and a processing unit configured to process the adjusted first image using the first recognition model to determine a first group of candidate boxes.
[0090] In some implementations, the first recognition model determines a first set of candidate boxes based on a first confidence threshold, and the second recognition model determines a second set of candidate boxes based on a second confidence threshold, where the first confidence threshold is lower than the second confidence threshold.
[0091] In some implementations, the device 400 also includes: a first tracking module, configured to determine tracking information of the first object at a second moment based on a match between the first group of candidate frames and the second group of candidate frames, the tracking information including at least one of the following: position, movement direction, or movement rate.
[0092] In some implementations, apparatus 400 further includes: processing a third image captured by an image capture device at a third moment with a first recognition model to detect a second object included in the third image, wherein the third moment is a predetermined time interval later than the first moment, and a sub-image corresponding to the target area of at least one image captured by the image capture device between the first moment and the second moment is provided to a second recognition model for object detection.
[0093] In some implementations, process 300 also includes: a third candidate frame acquisition unit, configured to acquire a third group of candidate frames determined by the first recognition model based on a fourth image, the fourth image being captured by an image capture device at a fourth moment, the fourth moment being a predetermined time interval earlier than the first moment; a matching unit, configured to determine motion information of the third object at the first moment based on a match between the third group of candidate frames and the first group of candidate frames, the third object being associated with a predetermined candidate frame of the first group of candidate frames outside the target area; and a second tracking unit, configured to determine tracking information of the third object at the second moment based on the predetermined candidate frame and motion information in the first image.
[0094] In some implementations, the target area determination unit 420 includes: a target candidate box determination, configured to determine a target candidate box in the first group of candidate boxes based on the position of the first group of candidate boxes, the number of adjacent candidate boxes of the target candidate box is higher than a predetermined threshold, and the distance between the adjacent candidate box and the target candidate box is less than the predetermined threshold; an expansion unit, configured to determine a target area with a predetermined size based on the position of the target candidate box.
[0095] In some implementations, the target area determination unit 420 includes: a cropping unit configured to determine a target area with a predetermined size based on the positions of the first group of candidate boxes, so that the target area covers at least one candidate box in the first group of candidate boxes, wherein a ratio of the number of first candidate boxes of at least one candidate box to the number of second candidate boxes of the first group of candidate boxes is greater than a predetermined threshold.
[0096] In some implementations, the distance between the image capture device and the capturable object is greater than a predetermined threshold.
[0097] In some implementations, the first image and the second image are adjacent video frames captured by an image capture device.
[0098] The units included in the device 400 can be implemented in various ways, including software, hardware, firmware, or any combination thereof. In some embodiments, one or more units can be implemented using software and / or firmware, such as machine executable instructions stored on a storage medium. In addition to or as an alternative to machine executable instructions, some or all of the units in the device 400 can be implemented at least in part by one or more hardware logic components. As an example and not limitation, exemplary types of hardware logic components that can be used include field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0099] Figure 5 1 shows a block diagram of a computing device / server 500 in which one or more embodiments of the present disclosure may be implemented. It should be understood that Figure 5 The computing device / server 500 shown is merely exemplary and should not constitute any limitation on the functionality and scope of the embodiments described herein.
[0100] like Figure 5 As shown, computing device / server 500 is in the form of a general-purpose computing device. Components of computing device / server 500 may include, but are not limited to, one or more processors or processing units 510, memory 520, storage device 530, one or more communication units 540, one or more input devices 550, and one or more output devices 560. Processing unit 510 may be an actual or virtual processor and is capable of performing various processes according to a program stored in memory 520. In a multi-processor system, multiple processing units execute computer executable instructions in parallel to increase the parallel processing capabilities of computing device / server 500.
[0101] The computing device / server 500 typically includes a plurality of computer storage media. Such media may be any available media accessible to the computing device / server 500, including but not limited to volatile and non-volatile media, removable and non-removable media. The memory 520 may be a volatile memory (e.g., registers, caches, random access memory (RAM)), a non-volatile memory (e.g., a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. The storage device 530 may be a removable or non-removable medium, and may include a machine-readable medium, such as a flash drive, a disk, or any other medium, which may be capable of being used to store information and / or data (e.g., training data for training) and may be accessed within the computing device / server 500.
[0102] The computing device / server 500 may further include additional removable / non-removable, volatile / non-volatile storage media. Figure 5 As shown in , a disk drive for reading or writing from a removable, non-volatile disk (e.g., a "floppy disk") and an optical drive for reading or writing from a removable, non-volatile optical disk may be provided. In these cases, each drive may be connected to the bus (not shown) by one or more data media interfaces. The memory 520 may include a computer program product 525 having one or more program modules that are configured to perform various methods or actions of various embodiments of the present disclosure.
[0103] The communication unit 540 enables communication with other computing devices via a communication medium. Additionally, the functions of the components of the computing device / server 500 can be implemented in a single computing cluster or multiple computing machines that can communicate via a communication connection. Thus, the computing device / server 500 can operate in a networked environment using a logical connection with one or more other servers, a network personal computer (PC), or another network node.
[0104] Input device 550 may be one or more input devices, such as a mouse, keyboard, trackball, etc. Output device 560 may be one or more output devices, such as a display, speaker, printer, etc. Computing device / server 500 may also communicate with one or more external devices (not shown) as needed, such as storage devices, display devices, etc., with one or more devices that enable a user to interact with computing device / server 500, or with any device that enables computing device / server 500 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.) through communication unit 540. Such communication may be performed via an input / output (I / O) interface (not shown).
[0105] According to an exemplary implementation of the present disclosure, a computer-readable storage medium is provided, on which one or more computer instructions are stored, wherein the one or more computer instructions are executed by a processor to implement the method described above.
[0106] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products implemented according to the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0107] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0108] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0109] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple implementations of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of a module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some implementations as replacements, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a special hardware-based system that performs the function or action of the specification, or can be realized by a combination of special hardware and computer instructions.
[0110] The above descriptions of various implementations of the present disclosure are exemplary, non-exhaustive, and not limited to the disclosed implementations. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described implementations. The selection of terms used herein is intended to best explain the principles of the implementations, practical applications, or improvements to the technology in the marketplace, or to enable other persons of ordinary skill in the art to understand the implementations disclosed herein.
[0111] Example Implementation
[0112] TS 1. A method for object detection, comprising:
[0113] Determine a first group of candidate frames in a first image captured by an image capture device at a first moment, the first group of candidate frames indicating areas in the first image that may include an object;
[0114] Based on the first group of candidate frames, determining a target area with a predetermined size;
[0115] determining a sub-image corresponding to the target area from a second image captured by the image capture device at a second time, the second time being later than the first time; and
[0116] A first object is detected from the sub-image.
[0117] TS 2. The method according to TS 1, wherein detecting the first object comprises: determining a second set of candidate boxes associated with the first object in the sub-image,
[0118] The first group of candidate boxes is determined by a first recognition model, the second group of candidate boxes is determined by a second recognition model, and the model complexity of the second recognition model is lower than that of the first recognition model.
[0119] TS 3. The method according to TS 2, wherein determining a first set of candidate frames in a first image captured by an image capture device comprises:
[0120] adjusting the first image to fit the first recognition model; and
[0121] The adjusted first image is processed using the first recognition model to determine the first set of candidate boxes.
[0122] TS 4. The method according to TS 2, wherein the first recognition model determines the first group of candidate boxes based on a first confidence threshold, and the second recognition model determines the second group of candidate boxes based on a second confidence threshold, and the first confidence threshold is lower than the second confidence threshold.
[0123] TS 5. The method according to TS 2, further comprising:
[0124] Based on the match between the first group of candidate frames and the second group of candidate frames, tracking information of the first object at the second moment is determined, where the tracking information includes at least one of the following: position, movement direction, or movement speed.
[0125] TS 6. The method according to TS 2, further comprising:
[0126] A third image captured by the image capture device at a third moment is processed with the first recognition model to detect a second object included in the third image, wherein the third moment is a predetermined time interval later than the first moment, and a sub-image corresponding to the target area of at least one image captured by the image capture device between the first moment and the second moment is provided to the second recognition model for object detection.
[0127] TS 7. The method according to TS 2, further comprising:
[0128] Acquire a third group of candidate frames determined by the first recognition model based on a fourth image, wherein the fourth image is captured by the image capture device at a fourth moment, and the fourth moment is earlier than the first moment by a predetermined time interval;
[0129] Determining motion information of a third object at the first moment based on a match between the third group of candidate frames and the first group of candidate frames, the third object being associated with a predetermined candidate frame of the first group of candidate frames outside the target area; and
[0130] Based on the predetermined candidate frame and the motion information in the first image, tracking information of the third object at the second moment is determined.
[0131] TS 8. The method according to TS 1, wherein determining the target area comprises:
[0132] Determine, based on the positions of the first group of candidate frames, a target candidate frame in the first group of candidate frames, the number of adjacent candidate frames of the target candidate frame being higher than a predetermined threshold, and the distance between the adjacent candidate frame and the target candidate frame being lower than the predetermined threshold; and
[0133] Based on the position of the target candidate frame, the target region having the predetermined size is determined.
[0134] TS 9. The method according to TS 1, wherein determining the target area comprises:
[0135] Based on the positions of the first group of candidate boxes, the target area with the predetermined size is determined so that the target area covers at least one candidate box in the first group of candidate boxes, wherein the ratio of the number of first candidate boxes of the at least one candidate box to the number of second candidate boxes of the first group of candidate boxes is greater than a predetermined threshold.
[0136] TS 10. The method according to TS 1, wherein the distance between the image capture device and the capturable object is greater than a predetermined threshold.
[0137] TS 11. The method according to TS 1, wherein the first image and the second image are adjacent video frames captured by the image capture device.
[0138] TS 12. An object detection device, comprising:
[0139] A first candidate frame determination module is configured to determine a first group of candidate frames in a first image captured by an image capture device at a first moment, wherein the first group of candidate frames indicates an area in the first image that may include an object;
[0140] a target region determination module, configured to determine a target region based on the first group of candidate frames;
[0141] a sub-image determining module configured to determine a sub-image corresponding to the target area from a second image captured by the image capturing device at a second time, the second time being later than the first time; and
[0142] The object detection module is configured to detect a first object from the sub-image.
[0143] TS 13. An electronic device comprising:
[0144] Memory and processor;
[0145] The memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method according to any one of TS 1 to 11.
[0146] TS 14. A computer-readable storage medium having one or more computer instructions stored thereon, wherein the one or more computer instructions are executed by a processor to implement the method according to any one of TS 1 to 11.
Claims
1. A method for object detection, comprising: Determine a first group of candidate frames in a first image captured by an image capture device at a first moment, the first group of candidate frames indicating areas in the first image that may include an object; Based on the first group of candidate frames, a target area with a predetermined size is determined, which includes: Based on the positions of the first group of candidate frames, determining a target candidate frame in the first group of candidate frames, the number of adjacent candidate frames of the target candidate frame being higher than a predetermined threshold, and the distance between the adjacent candidate frame and the target candidate frame being lower than a predetermined threshold; Based on the position of the target candidate frame, determining the target area having the predetermined size; determining a sub-image corresponding to the target area from a second image captured by the image capture device at a second time, the second time being later than the first time; and A first object is detected from the sub-image.
2. The method of claim 1, wherein detecting the first object comprises: determining a second group of candidate frames associated with the first object in the sub-image, The first group of candidate boxes is determined by a first recognition model, the second group of candidate boxes is determined by a second recognition model, and the model complexity of the second recognition model is lower than that of the first recognition model.
3. The method according to claim 2, wherein determining a first set of candidate frames in a first image captured by an image capture device comprises: adjusting the first image to fit the first recognition model; as well as The adjusted first image is processed using the first recognition model to determine the first set of candidate boxes.
4. The method according to claim 2, wherein the first recognition model determines the first group of candidate boxes based on a first confidence threshold, and the second recognition model determines the second group of candidate boxes based on a second confidence threshold, and the first confidence threshold is lower than the second confidence threshold.
5. The method according to claim 2, further comprising: Based on the match between the first group of candidate frames and the second group of candidate frames, tracking information of the first object at the second moment is determined, where the tracking information includes at least one of the following: position, movement direction, or movement speed.
6. The method according to claim 2, further comprising: A third image captured by the image capture device at a third moment is processed with the first recognition model to detect a second object included in the third image, wherein the third moment is a predetermined time interval later than the first moment, and a sub-image corresponding to the target area of at least one image captured by the image capture device between the first moment and the second moment is provided to the second recognition model for object detection.
7. The method according to claim 2, further comprising: Obtaining a third group of candidate boxes determined by the first recognition model based on the fourth image, The fourth image is captured by the image capturing device at a fourth moment, and the fourth moment is earlier than the first moment by a predetermined time interval; determining motion information of a third object at the first moment based on a match between the third group of candidate frames and the first group of candidate frames, the third object being associated with a predetermined candidate frame of the first group of candidate frames outside the target area; as well as Based on the predetermined candidate frame and the motion information in the first image, tracking information of the third object at the second moment is determined.
8. The method of claim 1, wherein determining the target area comprises: Based on the positions of the first group of candidate frames, determining the target area with the predetermined size so that the target area covers at least one candidate frame in the first group of candidate frames, Wherein the ratio of the first number of candidate boxes of the at least one candidate box to the second number of candidate boxes of the first group of candidate boxes is greater than a predetermined threshold, the first number of candidate boxes is the number of the at least one candidate box in the target area, and the second number of candidate boxes is the number of the first group of candidate boxes.
9. The method according to claim 1, wherein the distance between the image capture device and the capturable object is greater than a predetermined threshold.
10. The method of claim 1, wherein the first image and the second image are adjacent video frames captured by the image capture device.
11. An object detection device, comprising: A first candidate frame determination module is configured to determine a first group of candidate frames in a first image captured by an image capture device at a first moment, wherein the first group of candidate frames indicates an area in the first image that may include an object; The target region determination module is configured to determine a target region with a predetermined size based on the first group of candidate frames, including: Based on the positions of the first group of candidate frames, determining a target candidate frame in the first group of candidate frames, the number of adjacent candidate frames of the target candidate frame being higher than a predetermined threshold, and the distance between the adjacent candidate frame and the target candidate frame being lower than a predetermined threshold; Based on the position of the target candidate frame, determining the target area having the predetermined size; a sub-image determining module configured to determine a sub-image corresponding to the target area from a second image captured by the image capturing device at a second time, the second time being later than the first time; and The object detection module is configured to detect a first object from the sub-image.
12. An electronic device comprising: Memory and processor; The memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method according to any one of claims 1 to 10.
13. A computer-readable storage medium having one or more computer instructions stored thereon, wherein the one or more computer instructions are executed by a processor to implement the method according to any one of claims 1 to 10.
