Target detection method, device and terminal equipment based on image recognition

By obtaining and updating a priori parameters, targeted detection of target detection images is performed, which solves the problem of low target detection efficiency in the existing technology and achieves more efficient resource utilization and detection accuracy.

CN109740441BActive Publication Date: 2024-10-22PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201811502727.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-12-10
Publication Date
2024-10-22
Estimated Expiration
2038-12-10

AI Technical Summary

Technical Problem

The target detection efficiency in the existing technology is low, especially when using neural networks for feature point processing, resulting in a waste of computing resources on ineffective detection work.

Method used

By obtaining a priori parameters related to the target object, such as color, expected proportion or expected appearance area, each frame of the image to be detected is detected, and the prior parameters are updated based on the detection results for tracking and detection, reducing the workload of feature point extraction. .

Benefits of technology

It improves the efficiency of target detection, reduces resource consumption, avoids invalid detection, and improves detection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN109740441B_ABST
    Figure CN109740441B_ABST
Patent Text Reader

Abstract

The present invention is applicable to the field of data processing technology, and provides a target detection method, device, terminal equipment and computer-readable storage medium based on image recognition, including: obtaining a priori parameters related to the target object, the priori parameters are the color, expected proportion or expected appearance area of ​​the target object, and the expected proportion of the target object refers to the proportion of the target object in the image; after collecting at least two frames of images to be detected, each frame of the images to be detected is detected based on the priori parameters; if the target object is detected in any frame of the images to be detected, the priori parameters are updated according to the detection results corresponding to the target object, and the images to be detected in subsequent frames are tracked and detected according to the updated priori parameters. The present invention performs targeted detection on the images to be detected according to the priori parameters, reduces the workload of target detection, and improves the efficiency of target detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of data processing technology, and in particular relates to a target detection method, device, terminal equipment and computer-readable storage medium based on image recognition. Background Art

[0002] With the development of information technology, object detection has become a current research hotspot and is widely used in various scenarios such as access control, selfie, and road condition detection. For example, it can detect faces from selfie images or detect moving vehicles from road condition images.

[0003] In the prior art, target detection usually involves extracting feature points from an image, and taking the area where multiple feature points that meet specific rules are located as the detection result. When there are at least two frames of images, feature points are usually extracted indiscriminately for each frame of image, resulting in a rigid detection mode and low detection efficiency. In particular, in scenarios where a neural network is used to process the extracted feature points, since the processing process of the neural network is relatively complicated, more computing resources are wasted on ineffective detection work. Summary of the invention

[0004] In view of this, embodiments of the present invention provide a method, an apparatus, a terminal device, and a computer-readable storage medium for target detection based on image recognition to solve the problem of low efficiency of target detection in the prior art.

[0005] A first aspect of an embodiment of the present invention provides a method for object detection based on image recognition, comprising:

[0006] Acquire a priori parameters related to the target object, where the priori parameters are the color, expected proportion, or expected appearance area of ​​the target object, where the expected proportion of the target object refers to the proportion of the target object in the image;

[0007] After acquiring at least two frames of images to be detected, detecting each frame of the images to be detected based on the prior parameters;

[0008] If the target object is detected in any frame of the image to be detected, the priori parameters are updated according to the detection result corresponding to the target object, and the image to be detected in subsequent frames is tracked and detected according to the updated priori parameters.

[0009] A second aspect of an embodiment of the present invention provides an object detection device based on image recognition, comprising:

[0010] An acquisition unit, used to acquire a priori parameters related to the target object, wherein the priori parameters are the color, expected proportion or expected appearance area of ​​the target object, and the expected proportion of the target object refers to the proportion of the target object in the image;

[0011] A detection unit, configured to detect each frame of the image to be detected based on the prior parameters after acquiring at least two frames of the image to be detected;

[0012] The tracking unit is used to update the priori parameters according to the detection result corresponding to the target object if the target object is detected in any frame of the image to be detected, and to track and detect the image to be detected in subsequent frames according to the updated priori parameters.

[0013] A third aspect of an embodiment of the present invention provides a terminal device, the terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:

[0014] Acquire a priori parameters related to the target object, where the priori parameters are the color, expected proportion, or expected appearance area of ​​the target object, where the expected proportion of the target object refers to the proportion of the target object in the image;

[0015] After acquiring at least two frames of images to be detected, detecting each frame of the images to be detected based on the prior parameters;

[0016] If the target object is detected in any frame of the image to be detected, the priori parameters are updated according to the detection result corresponding to the target object, and the image to be detected in subsequent frames is tracked and detected according to the updated priori parameters.

[0017] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0018] Acquire a priori parameters related to the target object, where the priori parameters are the color, expected proportion, or expected appearance area of ​​the target object, where the expected proportion of the target object refers to the proportion of the target object in the image;

[0019] After acquiring at least two frames of images to be detected, detecting each frame of the images to be detected based on the prior parameters;

[0020] If the target object is detected in any frame of the image to be detected, the priori parameters are updated according to the detection result corresponding to the target object, and the image to be detected in subsequent frames is tracked and detected according to the updated priori parameters.

[0021] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0022] The embodiment of the present invention detects at least two frames of images to be detected based on the acquired prior parameters. If a target object is detected in any frame of the image to be detected, the prior parameters are updated according to the detection result corresponding to the target object, and the images to be detected in subsequent frames are tracked and detected according to the updated prior parameters. The embodiment of the present invention performs targeted detection on the image according to the prior parameters, so that feature points are extracted only for part of the image or according to a specific strategy, which reduces the workload of feature point extraction and improves the efficiency of target detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0024] Figure 1 is a flowchart of an implementation of a target detection method based on image recognition provided in Embodiment 1 of the present invention;

[0025] Figure 2 is a flowchart of an implementation of a target detection method based on image recognition provided by Embodiment 2 of the present invention;

[0026] Figure 3 is a flowchart of an implementation of a target detection method based on image recognition provided in Embodiment 3 of the present invention;

[0027] Figure 4 is a flowchart of an implementation of a target detection method based on image recognition provided by Embodiment 4 of the present invention;

[0028] Figure 5 is a flowchart of an implementation of a target detection method based on image recognition provided by Embodiment 5 of the present invention;

[0029] Figure 6 is a structural block diagram of an object detection device based on image recognition provided by Embodiment 6 of the present invention;

[0030] Figure 7 It is a schematic diagram of a terminal device provided in Embodiment 7 of the present invention. DETAILED DESCRIPTION

[0031] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.

[0032] In order to illustrate the technical solution of the present invention, a specific embodiment is provided below for illustration.

[0033] Figure 1 The implementation process of the target detection method based on image recognition provided by an embodiment of the present invention is shown, and is described in detail as follows:

[0034] In S101, a priori parameters related to the target object are obtained, where the priori parameters are the color, expected proportion or expected appearance area of ​​the target object, and the expected proportion of the target object refers to the proportion of the target object in the image.

[0035] For image-based target detection, compared with the indiscriminate detection of images in traditional methods, in an embodiment of the present invention, firstly, a priori parameters related to the target object to be detected are obtained. The priori parameters are parameters used to describe the target object. For example, the priori parameters may be the color, expected proportion or expected appearance area of ​​the target object, wherein the expected proportion of the target object refers to the proportion of the expected target object in the entire image. The above are all examples of priori parameters. Depending on the actual application scenario, the priori parameters may also be more other parameters, such as shape, etc., which are not limited in the embodiment of the present invention. The priori parameters may be pre-customized by the user. For example, the user sets the actual value of the priori parameters based on experience, or they may be obtained based on the analysis of multiple images. The content of obtaining the priori parameters from multiple images will be specifically described later.

[0036] In S102, after at least two frames of images to be detected are collected, detection is performed on each frame of the images to be detected based on the priori parameters.

[0037] After obtaining the prior parameters, at least two frames of images to be detected are collected by the camera. The images to be detected are images where the target object is expected to appear. For example, the target object can be a vehicle, then the prior parameters can be the expected proportion of vehicles, the camera can be a fixed camera installed above the road, and the image to be detected is an image of an intersection. Since there may be vehicles entering the intersection, the target object, i.e., a vehicle, may exist in the image to be detected. For all the images to be detected collected, each frame of the image to be detected is detected based on the prior parameters until all the images to be detected are detected. In the embodiment of the present invention, the detection of each frame of the image to be detected is targeted detection, that is, according to the specific type of the prior parameters, only the partial area of ​​the image to be detected that meets the specific rules is detected or the image to be detected is detected according to the detection strategy related to the prior parameters. For example, if the prior parameter is the color of the target object, such as red, only the partial area of ​​the image to be detected that is red in color is detected, rather than all the areas of the image to be detected. It is worth mentioning that in the process of targeted detection, detection can be performed based on a neural network, or an open source detection interface can be called for detection, which is not limited in the embodiment of the present invention. It is worth mentioning that in order to improve the detection effect, the camera can be pre-set to shoot the image to be detected at a shooting interval less than a preset interval (preset interval such as 1 second), so as to facilitate the subsequent analysis of the movement of the target object.

[0038] Optionally, each frame of the image to be detected is detected in the order of acquisition time from the beginning to the end. Since the image to be detected is acquired by a camera, in the embodiment of the present invention, the acquisition time corresponding to all the acquired images to be detected can be obtained, and each frame of the image to be detected is detected in the order of acquisition time from the beginning to the end, so as to improve the orderliness of the detection and is also suitable for the motion of the target object. For example, the image to be detected Picture A The collection time is 8 o'clock in the morning, and the image to be detected is Picture B The acquisition time is 8:01 in the morning, and the image to be detected is Picture C The collection time is 8:02 in the morning, then according to Picture A 、Picture B and Picture C Each frame of the image to be detected is detected in the order of

[0039] In S103, if the target object is detected in any frame of the image to be detected, the priori parameters are updated according to the detection result corresponding to the target object, and the image to be detected in subsequent frames is tracked and detected according to the updated priori parameters.

[0040] During the detection process, if a target object is detected in any frame of the image to be detected (the judgment condition for detecting the target object can be freely set according to the actual application scenario, for example, at least two feature points extracted meet the preset rules), the prior parameters are updated according to the detection result corresponding to the target object, wherein the type of the detection result is related to the prior parameters, such as if the prior parameter is the expected proportion of the target object, then the detection result is the actual proportion of the target object in the image to be detected; if the prior parameter is the expected appearance area of ​​the target object, then the detection result is the actual appearance area of ​​the target object in the image to be detected. For example, if the prior parameter is the expected appearance area of ​​the target object, specifically the left half of the image, and when the target object is detected in the image to be detected, the detection result corresponding to the target object is the right half of the image, then the expected appearance area in the prior parameter is updated, that is, updated to the right half of the image. After the prior parameters are updated, the images to be detected in subsequent frames are tracked and detected according to the updated prior parameters. If the target object is detected in a subsequent frame of the image to be detected, the prior parameters are continued to be updated according to the detection result of the frame until all the images to be detected are detected.

[0041] pass Figure 1 It can be seen from the shown embodiment that in the embodiment of the present invention, by acquiring prior parameters related to the target object, after collecting at least two frames of images to be detected, each frame of the image to be detected is detected based on the prior parameters. If the target object is detected in any frame of the image to be detected, the prior parameters are updated according to the detection result corresponding to the target object, and the images to be detected in subsequent frames are tracked and detected according to the updated prior parameters. The embodiment of the present invention reduces the resource consumption of target detection by performing targeted detection on the images to be detected through the acquired prior parameters.

[0042] Figure 2 As shown in FIG. 1 , a method is obtained by refining the process of obtaining prior parameters related to the target object based on the first embodiment of the present invention. The embodiment of the present invention provides a flow chart for implementing a target detection method based on image recognition, as shown in FIG. Figure 2 As shown, the target detection method may include the following steps:

[0043] In S201, at least two sample images containing the target object are acquired, wherein the sample images and the image to be detected are located in the same shooting scene.

[0044] In addition to customizing the prior parameters, in an embodiment of the present invention, a priori parameters can also be obtained by comprehensively analyzing previous images. First, at least two sample images containing the target object are obtained. In order to improve the accuracy of the prior parameters, the sample images and the image to be detected are limited to be located in the same shooting scene. Being located in the same shooting scene means that the shooting position and shooting field of view of the sample image and the image to be detected are the same. If the image to be detected is taken by a fixed camera, it is limited that the sample image is also taken by the fixed camera.

[0045] In S202, target parameters are counted according to the detection results of the target object in each of the sample images, and all the obtained target parameters are processed to obtain the priori parameters.

[0046] For each sample image, the detection result of the target object is obtained. Similarly, the type of the detection result is related to the prior parameter. In order to distinguish it from the prior parameter, the parameter statistically obtained based on the detection result is named the target parameter, and all the obtained target parameters are processed to obtain the prior parameter. In the embodiment of the present invention, there are two ways to process the target parameter: the first way is the average processing way, that is, taking the average of all the target parameters to obtain the prior parameter. For example, if the prior parameter is the expected proportion of the target object, and the target parameter Parameter A The target parameter is 10%. B The target parameter is 15%. C is 20%, then the prior parameter (expected proportion) can be calculated as (10%+15%+20%) / 3=15%; the second is the majority processing method, that is, the target parameter with the highest repetition rate is determined as the prior parameter. If the prior parameter is the expected proportion of the target object, and the target parameter Parameter D The target parameter is 10%. E The target parameter is 15%. F The target parameter is 20%. G The ratio is 15%. Since the repetition rate of the ratio of 15% is the highest, the priori parameter (expected ratio) is determined to be 15%. In actual application scenarios, any of the above two methods can be applied according to actual needs.

[0047] pass Figure 2It can be seen from the shown embodiment that in the embodiment of the present invention, by acquiring at least two sample images containing the target object, the target parameters are counted according to the detection results of the target object in each sample image, and all the obtained target parameters are processed to obtain prior parameters. The embodiment of the present invention improves the accuracy of the prior parameters by analyzing at least two sample images in the same shooting scene, thereby avoiding inaccurate prior parameters caused by user experience errors.

[0048] Figure 3 As shown, based on the first embodiment of the present invention, and based on the expected proportion of the target object included in the prior parameters, a method is obtained by refining the process of detecting each frame of the image to be detected based on the prior parameters. The embodiment of the present invention provides a flow chart for implementing the target detection method based on image recognition, as shown in FIG. Figure 3 As shown, the target detection method may include the following steps:

[0049] In S301, an image pyramid is constructed in a preset detection neural network, wherein the detection neural network is used to detect whether the image contains the target object, and the image pyramid includes at least two image sizes.

[0050] In an embodiment of the present invention, a preset detection neural network can be applied to perform target detection. The embodiment of the present invention does not limit the specific type of the detection neural network. For example, the detection neural network can be a convolutional neural network (CNN). In the process of applying the detection neural network to perform target detection on the image to be detected, since the resolution of the captured image is usually high, if the original image to be detected is directly input into the detection neural network for processing, the efficiency of target detection will be low due to excessive calculation. Therefore, in an embodiment of the present invention, an image pyramid is constructed in the detection neural network, and the image pyramid includes at least two image sizes for scaling the image to be detected, wherein the image pyramid can be a Gaussian pyramid or a Laplacian pyramid, etc.

[0051] In S302, the proportion interval in which the expected proportion of the target object in the prior parameters is located is determined, and at least one of the image sizes corresponding to the proportion interval is searched according to a preset mapping set, wherein the mapping set includes mapping relationships between different proportion intervals and the image sizes.

[0052] On the basis of the existing image pyramid, in an embodiment of the present invention, a mapping relationship between different proportion intervals and image sizes is pre-set and stored, wherein the proportion interval is a numerical range of the expected proportion of the target object. In order to avoid mapping confusion, when setting the proportion interval, it is limited that there is no overlapping area between different proportion intervals. Since the larger the expected proportion of the target object, the higher the significance of the target object in the image, the smaller the corresponding image size is set for the proportion interval containing the larger expected proportion in the embodiment of the present invention. In addition, in the mapping relationship, a proportion interval corresponds to at least one image size.

[0053] All the mapping relationships set are classified into a mapping set, where the mapping set only indicates that the mapping relationships are uniformly stored, rather than a specific storage format. Then, the proportion interval of the expected proportion of the target object in the prior parameters is determined, and the mapping relationship corresponding to the proportion interval is searched in the mapping set, and at least one image size in the mapping relationship is further obtained. For example, the constructed image pyramid includes five image sizes of 320×320, 160×160, 80×80, 40×40 and 20×20. Therefore, the mapping relationship between the expected proportion of (0, 25%] and the two image sizes of 160×160 and 80×80 can be established in advance, the mapping relationship between the expected proportion of (25%, 50%] and the two image sizes of 80×80 and 40×40 can be established, and the mapping relationship between the expected proportion of (50%, 100%] and the image size of 20×20 can be established. All mapping relationships are classified into a mapping set. If the expected proportion of the target object in the prior parameters is 30%, the corresponding mapping relationship is found in the mapping set to obtain the corresponding image sizes of 80×80 and 40×40.

[0054] In S303, the image to be detected is scaled according to all the image sizes found, and all the scaled images to be detected are input as input parameters to the detection neural network.

[0055] After finding out at least one image size corresponding to the prior parameters, the images to be detected are scaled according to all the found image sizes, and all the scaled images to be detected are sequentially input as input parameters into the detection neural network for target detection. It is worth mentioning that although it is not necessary to build an image pyramid and directly determine the image size corresponding to the expected proportion of the target object in the prior parameters according to the mapping set, in order to ensure the general ability of performing target detection in the detection neural network (that is, the ability to detect targets for images without prior parameters), in the embodiment of the present invention, an image pyramid is still established based on at least two image sizes, but after determining the image size corresponding to the prior parameters, other image sizes in the image pyramid are skipped.

[0056] pass Figure 3 It can be seen from the illustrated embodiment that in the embodiment of the present invention, an image pyramid is constructed in a preset detection neural network to determine the proportion interval in which the expected proportion of the target object in the prior parameters is located, and at least one image size corresponding to the proportion interval is searched according to a preset mapping set, and the image to be detected is scaled according to all the image sizes found, and all the scaled images to be detected are input into the detection neural network as input parameters. The embodiment of the present invention determines the image size corresponding to the prior parameters, and thus only performs image scaling and subsequent detection according to the determined image size, without the need to perform scaling and detection according to all image sizes in the image pyramid, thereby improving the efficiency of target detection.

[0057] Figure 4 As shown, based on the first embodiment of the present invention, and based on the fact that the prior parameters include the expected appearance area of ​​the target object, a method is obtained by refining the process of detecting each frame of the image to be detected based on the prior parameters. The embodiment of the present invention provides a flow chart for implementing the target detection method based on image recognition, as shown in FIG. Figure 4 As shown, the target detection method may include the following steps:

[0058] In S401, the image to be detected is split into a first area image and a second area image according to the prior parameters, wherein the first area image is a partial image corresponding to the expected appearance area of ​​the target object in the prior parameters in the image to be detected, and the second area image is an image of the image to be detected excluding the first area image.

[0059] In the case where the prior parameters include the expected appearance area of ​​the target object, the image to be detected is split into a first area image and a second area image according to the prior parameters, wherein the first area image is a partial image obtained by intercepting the image to be detected according to the expected appearance area of ​​the target object in the prior parameters, and the second area image is an image of the image to be detected excluding the expected appearance area of ​​the target object. For example, the expected appearance area of ​​the target object in the prior parameters is 50% of the left side of the image to be detected, so the partial image of 50% of the left side of the image to be detected is determined as the first area image, and the partial image of 50% of the right side of the image to be detected is determined as the second area image.

[0060] In S402, the first area image is detected by a preset first detection algorithm, and the second area image is detected by a preset second detection algorithm, wherein the first detection algorithm and the second detection algorithm are both used to detect the target object, and the detection accuracy of the first detection algorithm is higher than that of the second detection algorithm.

[0061] In the embodiment of the present invention, two detection algorithms are applied, that is, the first detection algorithm and the second detection algorithm are applied to respectively detect the image to be detected. The first detection algorithm and the second detection algorithm are both used to detect the target object. The difference between them is that the detection accuracy of the first detection algorithm is higher than that of the second detection algorithm. The higher the detection accuracy, the more calculation processes, the better the detection effect, but at the same time the slower the detection speed. Specifically, since the first area image is an image where the target object is more likely to appear, the first area image is detected by the first detection algorithm with higher detection accuracy. On the contrary, since the possibility of the target object appearing in the second area image is smaller, the second area image is quickly detected by the second detection algorithm with lower detection accuracy but faster detection speed. It is worth mentioning that the embodiment of the present invention does not limit the specific types of the first detection algorithm and the second detection algorithm, as long as the detection accuracy of the first detection algorithm is higher than that of the second detection algorithm.

[0062] pass Figure 4 It can be seen from the shown embodiment that in the embodiment of the present invention, the image to be detected is split into a first area image and a second area image according to prior parameters, the first area image is detected by a preset first detection algorithm, and the second area image is detected by a preset second detection algorithm, wherein the detection accuracy of the first detection algorithm is higher than that of the second detection algorithm. The embodiment of the present invention splits the image to be detected based on prior parameters, and detects the split images according to different detection algorithms, thereby improving the efficiency of target detection as a whole without reducing the detection effect.

[0063] Figure 5 As shown, based on the first embodiment of the present invention, and based on the detection of at least two target objects in a frame of the image to be detected, a method is obtained by refining the process of updating the priori parameters according to the detection results corresponding to the target objects, and tracking and detecting the subsequent frames of the image to be detected according to the updated priori parameters. The embodiment of the present invention provides a flow chart for implementing the target detection method based on image recognition, as shown in FIG. Figure 5 As shown, the target detection method may include the following steps:

[0064] In S501, the priori parameter is updated separately based on the detection result corresponding to each detected target object to obtain at least two updated priori parameters, wherein each updated priori parameter corresponds to each detected target object.

[0065] Prior parameters are used to predict the target object in the image to be detected, but the detection results in the shooting scene may not necessarily be consistent with the prior parameters. For example, in the shooting scene of detecting vehicles at an intersection, the prior parameters indicate that the vehicle will only enter from the top of the intersection, but in practice, unexpected situations such as vehicles going in the opposite direction or flying over isolation belts may occur, resulting in the detection result not being consistent with the prior parameters (such as vehicles entering from the bottom of the intersection). Therefore, in an embodiment of the present invention, if the target object is detected in any frame of the image to be detected, the prior parameters are updated according to the detection result corresponding to the target object, and the images to be detected in subsequent frames are tracked and detected according to the updated prior parameters, so as to detect the motion process of the target object. For example, the prior parameters include the expected appearance area of ​​the target object, specifically the left side of the image to be detected, but in a certain frame of the image to be detected, the appearance area of ​​the target object is detected to the right side of the image to be detected, then the expected appearance area of ​​the target object in the prior parameters is updated to the right side of the image to be detected.

[0066] On the basis of the above, since the number of target objects contained in the image to be detected is uncertain, for example, in the shooting scene of photographing a face for signing in, if the image to be detected contains a target object, the number of target objects is usually only one; for example, in the shooting scene of detecting vehicles at an intersection, if the image to be detected contains a target object, the number of target objects is usually at least two. In view of the situation where at least two target objects are detected in a frame of the image to be detected, the embodiment of the present invention performs subsequent tracking detection based on each detected target object, specifically, based on the detection result corresponding to each detected target object, the prior parameters are updated separately to obtain at least two updated prior parameters, wherein each updated prior parameter corresponds to each detected target object.

[0067] In S502, tracking and detecting are performed separately on the to-be-detected image of the subsequent frame according to each updated priori parameter.

[0068] After completing the updating of at least two priori parameters, the image to be detected in subsequent frames is tracked and detected separately according to each updated priori parameter, so that each target object in the image to be detected has a better detection effect.

[0069] pass Figure 5 It can be seen from the illustrated embodiment that, in the embodiment of the present invention, the prior parameters are updated separately based on the detection results corresponding to each detected target object to obtain at least two updated prior parameters, and the image to be detected in the subsequent frame is tracked and detected separately according to each updated prior parameter, thereby improving the detection effect of at least two target objects.

[0070] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0071] Corresponding to the target detection method based on image recognition described in the above embodiment, Figure 6 FIG. 1 shows a block diagram of a target detection device based on image recognition according to an embodiment of the present invention. Figure 6 , the target detection device comprises:

[0072] An acquisition unit 61 is used to acquire a priori parameters related to the target object, where the priori parameters are the color, expected proportion or expected appearance area of ​​the target object, where the expected proportion of the target object refers to the proportion of the target object in the image;

[0073] A detection unit 62, configured to detect each frame of the image to be detected based on the prior parameters after acquiring at least two frames of the image to be detected;

[0074] The tracking unit 63 is used to update the priori parameters according to the detection result corresponding to the target object if the target object is detected in any frame of the image to be detected, and to track and detect the image to be detected in subsequent frames according to the updated priori parameters.

[0075] Therefore, the target detection device based on image recognition provided by the embodiment of the present invention performs targeted detection on the image to be detected according to the acquired priori parameters, thereby improving the efficiency of target detection and reducing the workload.

[0076] Figure 7 Schematic diagram of a terminal device provided by an embodiment of the present invention. Figure 7 As shown, the terminal device 7 of this embodiment includes: a processor 70, a memory 71, and a computer program 72 stored in the memory 71 and executable on the processor 70, such as an object detection program based on image recognition. When the processor 70 executes the computer program 72, the steps in the above-mentioned various methods for object detection based on image recognition are implemented, such as Figure 1 Alternatively, when the processor 70 executes the computer program 72, the functions of each unit in the above terminal device embodiments are realized, for example, Figure 6 The functions of the units 61 to 63 are shown.

[0077] Exemplarily, the computer program 72 may be divided into one or more units, which are stored in the memory 71 and executed by the processor 70 to complete the present invention. The one or more units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 72 in the terminal device 7. For example, the computer program 72 may be divided into an acquisition unit, a detection unit, and a tracking unit, and the specific functions of each unit are as follows:

[0078] An acquisition unit, used to acquire a priori parameters related to the target object, wherein the priori parameters are the color, expected proportion or expected appearance area of ​​the target object, and the expected proportion of the target object refers to the proportion of the target object in the image;

[0079] A detection unit, configured to detect each frame of the image to be detected based on the prior parameters after acquiring at least two frames of the image to be detected;

[0080] The tracking unit is used to update the priori parameters according to the detection result corresponding to the target object if the target object is detected in any frame of the image to be detected, and to track and detect the image to be detected in subsequent frames according to the updated priori parameters.

[0081] The terminal device 7 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device may include, but is not limited to, a processor 70 and a memory 71. Those skilled in the art will appreciate that Figure 7 It is only an example of the terminal device 7 and does not constitute a limitation on the terminal device 7. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device may also include input and output devices, network access devices, buses, etc.

[0082] The processor 70 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0083] The memory 71 may be an internal storage unit of the terminal device 7, such as a hard disk or memory of the terminal device 7. The memory 71 may also be an external storage device of the terminal device 7, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 7. Further, the memory 71 may also include both an internal storage unit and an external storage device of the terminal device 7. The memory 71 is used to store the computer program and other programs and data required by the terminal device. The memory 71 may also be used to temporarily store data that has been output or is to be output.

[0084] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units as needed, that is, the internal structure of the terminal device can be divided into different functional units to complete all or part of the functions described above. The functional units in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0085] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0086] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0087] In the embodiments provided by the present invention, it should be understood that the disclosed terminal device and method can be implemented in other ways. For example, the terminal device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0088] 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 distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0089] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0090] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0091] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A target detection method based on image recognition, characterized in that: include: Acquire a priori parameters related to the target object, wherein the a priori parameters are the color, expected proportion or expected appearance area of ​​the target object, and the expected proportion of the target object refers to the proportion of the target object in the image; wherein the a priori parameters are preset; After acquiring at least two frames of images to be detected, detecting each frame of the images to be detected based on the prior parameters; If the target object is detected in any frame of the image to be detected, the priori parameters are updated according to the detection result corresponding to the target object, and the image to be detected in subsequent frames is tracked and detected according to the updated priori parameters; The priori parameters include the expected appearance area of ​​the target object, and the detecting of each frame of the image to be detected based on the priori parameters includes: Splitting the image to be detected into a first region image and a second region image according to the prior parameters, wherein the first region image is a partial image corresponding to the expected appearance region of the target object in the prior parameters in the image to be detected, and the second region image is an image of the image to be detected excluding the expected appearance region of the target object; The first area image is detected by a preset first detection algorithm, and the second area image is detected by a preset second detection algorithm, wherein the first detection algorithm and the second detection algorithm are both used to detect the target object, and the detection accuracy of the first detection algorithm is higher than that of the second detection algorithm.

2. The target detection method according to claim 1, characterized in that: The obtaining of prior parameters related to the target object includes: Acquire at least two sample images containing the target object, wherein the sample images and the image to be detected are located in the same shooting scene; Target parameters are statistically calculated according to the detection results of the target object in each of the sample images, and all the obtained target parameters are processed to obtain the priori parameters.

3. The target detection method according to claim 1, characterized in that: The priori parameter includes the expected proportion of the target object, and the detecting of each frame of the image to be detected based on the priori parameter includes: Constructing an image pyramid in a preset detection neural network, wherein the detection neural network is used to detect whether the image contains the target object, and the image pyramid includes at least two image sizes; Determine a proportion interval in which the expected proportion of the target object in the prior parameters lies, and search for at least one image size corresponding to the proportion interval according to a preset mapping set, wherein the mapping set includes mapping relationships between different proportion intervals and the image sizes; The image to be detected is scaled according to all the image sizes found, and all the scaled images to be detected are input into the detection neural network as input parameters.

4. The target detection method according to claim 1, characterized in that: If at least two target objects are detected in one frame of the image to be detected, then updating the priori parameters according to the detection results corresponding to the target objects, and tracking and detecting the image to be detected in subsequent frames according to the updated priori parameters, including: Based on the detection result corresponding to each of the detected target objects, the priori parameter is updated separately to obtain at least two updated priori parameters, wherein each updated priori parameter corresponds to each of the detected target objects; The image to be detected in subsequent frames is tracked and detected separately according to each updated priori parameter.

5. A target detection device based on image recognition, characterized in that: include: An acquisition unit, used to acquire a priori parameters related to the target object, wherein the a priori parameters are the color, expected proportion or expected appearance area of ​​the target object, and the expected proportion of the target object refers to the proportion of the target object in the image; wherein the a priori parameters are preset; A detection unit, configured to detect each frame of the image to be detected based on the prior parameters after acquiring at least two frames of the image to be detected; A tracking unit, configured to update the priori parameters according to a detection result corresponding to the target object if the target object is detected in any frame of the image to be detected, and to track and detect the image to be detected in subsequent frames according to the updated priori parameters; Wherein, the prior parameters include the expected appearance area of ​​the target object, and the detection of each frame of the image to be detected based on the prior parameters includes: splitting the image to be detected into a first area image and a second area image according to the prior parameters, wherein the first area image is a partial image corresponding to the expected appearance area of ​​the target object in the prior parameters in the image to be detected, and the second area image is an image of the image to be detected excluding the expected appearance area of ​​the target object; detecting the first area image by a preset first detection algorithm, and detecting the second area image by a preset second detection algorithm, wherein the first detection algorithm and the second detection algorithm are both used to detect the target object, and the detection accuracy of the first detection algorithm is higher than that of the second detection algorithm.

6. A terminal device, characterized in that: The terminal device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the following steps when executing the computer program: Acquire a priori parameters related to the target object, wherein the a priori parameters are the color, expected proportion or expected appearance area of ​​the target object, and the expected proportion of the target object refers to the proportion of the target object in the image; wherein the a priori parameters are preset; After acquiring at least two frames of images to be detected, detecting each frame of the images to be detected based on the prior parameters; If the target object is detected in any frame of the image to be detected, the priori parameters are updated according to the detection result corresponding to the target object, and the image to be detected in subsequent frames is tracked and detected according to the updated priori parameters; The priori parameters include the expected appearance area of ​​the target object, and the detecting of each frame of the image to be detected based on the priori parameters includes: Splitting the image to be detected into a first region image and a second region image according to the prior parameters, wherein the first region image is a partial image corresponding to the expected appearance region of the target object in the prior parameters in the image to be detected, and the second region image is an image of the image to be detected excluding the expected appearance region of the target object; The first area image is detected by a preset first detection algorithm, and the second area image is detected by a preset second detection algorithm, wherein the first detection algorithm and the second detection algorithm are both used to detect the target object, and the detection accuracy of the first detection algorithm is higher than that of the second detection algorithm.

7. The terminal device according to claim 6, characterized in that: The priori parameter includes the expected proportion of the target object, and the detecting of each frame of the image to be detected based on the priori parameter includes: Constructing an image pyramid in a preset detection neural network, wherein the detection neural network is used to detect whether the image contains the target object, and the image pyramid includes at least two image sizes; Determine a proportion interval in which the expected proportion of the target object in the prior parameters lies, and search for at least one image size corresponding to the proportion interval according to a preset mapping set, wherein the mapping set includes mapping relationships between different proportion intervals and the image sizes; The image to be detected is scaled according to all the image sizes found, and all the scaled images to be detected are input into the detection neural network as input parameters.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the target detection method according to any one of claims 1 to 4 are implemented.