Target detection method, device, equipment and storage medium
By processing the convolution window in the target detection video and using the output matrix of the previous frame image, the detection timeliness problem caused by the limitation of computing resources is solved, fast target detection in scenarios such as autonomous driving is achieved, and the detection speed and real-time are improved. sex.
Patent Information
- Application Number
- CN202210248035.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-14
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-03-14
AI Technical Summary
Existing target detection methods are limited by the capabilities of computing resources and are difficult to meet detection timeliness. Especially in scenarios with high real-time requirements such as autonomous driving, it is difficult to quickly detect targets to avoid traffic accidents.
By obtaining the Mth frame image in the target detection video, multiple convolution windows are obtained through processing, and the similarity is determined based on the similarity between each convolution window and the previous frame image, and the output matrix of the previous frame image is used to reduce the amount of calculation. , improve detection speed.
It improves the speed of target detection, can quickly detect targets in videos in scenarios such as autonomous driving, meets real-time requirements, and reduces the amount of calculation required to detect targets in videos.
Smart Images

Figure CN114708446B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and in particular, relates to a target detection method, device, equipment, storage medium and computer program product. Background Art
[0002] With the advancement of science and technology, the field of computer vision has attracted much attention, and object detection is a very important part of it. At present, object detection is used to detect objects in many real-world scenarios, such as autonomous driving, robot vision, video surveillance, etc. It can detect objects belonging to a certain category in digital images, such as detecting cars, pedestrians or other non-motor vehicles near the vehicle in the video recorded by the autonomous vehicle.
[0003] In scenarios such as autonomous driving, which have high real-time requirements, the car's reaction speed must be fast enough to avoid traffic accidents, which means that the target detection speed must be fast enough for the car to respond in time.
[0004] In the process of realizing the concept of the present disclosure, the inventors found that there are at least the following problems in the related art: the existing target detection methods are limited by the capacity of computing resources and it is difficult to meet the detection timeliness. Summary of the invention
[0005] The present application provides a target detection method, apparatus, device, storage medium and computer program product, which can improve the target detection speed.
[0006] According to an embodiment of the present disclosure, there is provided a target detection method, including: obtaining an M-th frame image in a target detection video, wherein M is a positive integer greater than or equal to 2; processing the M-th frame image to obtain a plurality of first convolution windows; for each of the first convolution windows, determining the similarity between the first convolution window and the second convolution window according to a pixel value of the first convolution window and a pixel value of a second convolution window of an M-1-th frame image in the target detection video, wherein a first position corresponding to the first convolution window in the M-th frame image is the same as a second position corresponding to the second convolution window in the M-1-th frame image, and the second convolution window has a corresponding output matrix; determining a target first convolution window whose similarity meets a preset condition from the plurality of first convolution windows, wherein the target first convolution window has a target second convolution window at the same position; determining the output matrix corresponding to the target second convolution window as a first output matrix of the target first convolution window; detecting a target in the M-th frame image according to the second output matrices respectively corresponding to the other first convolution windows except the target first convolution window among the plurality of first convolution windows, and the first output matrix.
[0007] According to an embodiment of the present disclosure, for each of the first convolution windows, the similarity between the first convolution window and the second convolution window is determined according to the pixel value of the first convolution window and the pixel value of the second convolution window of the M-1th frame image in the target detection video, including: determining the similarity between the first convolution window and the second convolution window according to the absolute value of the difference between the pixel value of the first convolution window and the pixel value of the second convolution window.
[0008] According to an embodiment of the present disclosure, the method also includes: reading a configuration file of the target detection video; determining structural information of the neural network and assigning weights to each network layer based on the configuration file, wherein the network layer includes a convolution layer; inputting the M-1th frame image into the convolution layer to obtain the second convolution window; determining the output matrix of the M-1th frame image based on the second convolution window and the convolution kernel in the convolution layer.
[0009] According to an embodiment of the present disclosure, the method further includes: saving the second convolution window and the output matrix of the M-1th frame image in the target detection video.
[0010] Another aspect of the present disclosure provides a target detection device, including: an acquisition module, used to acquire an M-th frame image of a target detection video, wherein M is a positive integer greater than or equal to 2; a first processing module, used to process the M-th frame image to obtain multiple first convolution windows; a first determination module, used to determine, for each of the first convolution windows, the similarity between the first convolution window and the second convolution window according to the pixel value of the first convolution window and the pixel value of the second convolution window of the M-1-th frame image in the target detection video; a second determination module, used to determine, from the multiple first convolution windows, a target first convolution window whose similarity meets a preset condition, wherein the target first convolution window has a target second convolution window with the same position; a third determination module, used to determine an output matrix corresponding to the target second convolution window as a first output matrix of the target first convolution window; and a detection module, used to detect a target in the M-th frame image according to the second output matrices respectively corresponding to the other first convolution windows except the target first convolution window among the multiple first convolution windows, and the first output matrix.
[0011] According to an embodiment of the present disclosure, the second determination module is specifically used to determine the similarity between the first convolution window and the second convolution window based on the absolute value of the difference between the pixel value of the first convolution window and the pixel value of the second convolution window.
[0012] According to an embodiment of the present disclosure, the device also includes: a reading module for reading a configuration file of the target detection video; a fourth determination module for determining the structural information of the neural network and assigning weights to each network layer based on the configuration file, wherein the network layer includes a convolution layer; an input module for inputting the M-1th frame image into the convolution layer to obtain the second convolution window; and a fifth determination module for determining the output matrix of the M-1th frame image based on the second convolution window and the convolution kernel in the convolution layer.
[0013] Another aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more instructions, wherein when the one or more instructions are executed by the one or more processors, the one or more processors implement the method described above.
[0014] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the above method when executed.
[0015] Another aspect of the present disclosure provides a computer program product, the computer program product comprising computer executable instructions, and the instructions are used to implement the above method when executed.
[0016] According to the embodiments of the present disclosure, the Mth frame image in the target detection video can be obtained, and then the Mth frame image is processed to obtain multiple first convolution windows, and then for each first convolution window, the similarity between the first convolution window and the second convolution window is determined according to the pixel value of the first convolution window and the pixel value of the second convolution window of the M-1th frame image in the target detection video, and then the target first convolution window whose similarity meets the preset conditions is determined from the multiple first convolution windows, and the output matrix corresponding to the target second convolution window with the same position as the target first convolution window is determined as the first output matrix of the target first convolution window, and then the target in the Mth frame image is detected according to the second output matrix and the first output matrix corresponding to the other first convolution windows except the target first convolution window in the multiple first convolution windows. Since the Mth frame image can use the output matrix calculated by the previous frame image, the amount of calculation for the Mth frame image is reduced, thereby improving the detection speed of the target in the video. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0018] Figure 1 A flowchart of a target detection method according to an embodiment of the present disclosure is schematically shown;
[0019] Figure 2A A schematic diagram schematically shows an input matrix and a convolution kernel of an input image according to an embodiment of the present disclosure;
[0020] Figure 2B A schematic diagram schematically shows the calculation multiplexing of the Mth frame image and the M-1th frame image of the target detection video according to an embodiment of the present disclosure;
[0021] Figure 2C The result diagram of the prior art for detecting an object in an image is schematically shown;
[0022] Figure 2D A schematic diagram of a method for calculating the intersection-over-union ratio of a detection box pair is shown schematically;
[0023] Figure 2E A schematic diagram schematically shows a line graph of experimental results under different similarity thresholds according to an embodiment of the present disclosure;
[0024] Figure 2F A line graph showing the variation of the similarity of adjacent frames with a threshold according to an embodiment of the present disclosure is shown;
[0025] Figure 2G A line graph showing changes in the average intersection-over-union ratio and the average center distance of each frame with the threshold according to an embodiment of the present disclosure is shown;
[0026] Figure 3 A block diagram schematically shows a target detection device according to an embodiment of the present disclosure; and
[0027] Figure 4 A block diagram of an electronic device suitable for a target detection method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0028] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0029] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0030] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0031] In the case of using expressions such as "at least one of A, B, and C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.). In the case of using expressions such as "at least one of A, B, or C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, or C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0032] In the technical solution disclosed in the present invention, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations, necessary confidentiality measures are taken, and do not violate public order and good morals.
[0033] In the related art, the method for detecting objects in videos is generally to calculate each frame of the video separately, and then output the calculation results of each frame. This calculation method has a large amount of calculation, and due to the limitation of computing power, the detection speed cannot be improved. Therefore, there is at least one target detection method in the related art that is limited by the capacity of computing resources and is difficult to meet the detection timeliness.
[0034] Based on the above problems, an embodiment of the present disclosure provides a target detection method. The method includes obtaining the Mth frame image in the target detection video, where M is a positive integer greater than or equal to 2; processing the Mth frame image to obtain multiple first convolution windows; for each first convolution window, according to the pixel value of the first convolution window and the pixel value of the second convolution window of the M-1th frame image in the target detection video, determining the similarity between the first convolution window and the second convolution window, wherein the first position corresponding to the first convolution window in the Mth frame image is the same as the second position corresponding to the second convolution window in the M-1th frame image, and the second convolution window has a corresponding output matrix; determining a target first convolution window whose similarity meets a preset condition from multiple first convolution windows, wherein the target first convolution window has a target second convolution window with the same position; determining the output matrix corresponding to the target second convolution window as the first output matrix of the target first convolution window; detecting the target in the Mth frame image according to the second output matrices corresponding to the other first convolution windows except the target first convolution window in the multiple first convolution windows, and the first output matrix.
[0035] Figure 1 The flowchart of the target detection method according to the embodiment of the present disclosure is schematically shown.
[0036] like Figure 1 As shown, the method includes operations S101 to S106.
[0037] In operation S101, an M-th frame image in a target detection video is acquired, where M is a positive integer greater than or equal to 2.
[0038] According to an embodiment of the present disclosure, the target detection video may be a video recorded by an autonomous driving vehicle during its current driving, or a video recorded by a drone during flight, or a video recorded by other equipment that needs to detect targets.
[0039] In operation S102, the Mth frame image is processed to obtain a plurality of first convolution windows.
[0040] According to an embodiment of the present disclosure, the pixel value corresponding to each pixel in the Mth frame image can be calculated, and then the pixel value is expressed in a matrix form, and then the matrix is divided into multiple regions to obtain multiple first convolution windows.
[0041] According to another embodiment of the present disclosure, the first convolution window may be a 3*3 matrix or a 4*4 matrix.
[0042] In operation S103, for each first convolution window, determine the similarity between the first convolution window and the second convolution window according to the pixel values of the first convolution window and the pixel values of the second convolution window in the (M - 1)-th frame image of the target detection video, where the first position corresponding to the first convolution window in the M-th frame image is the same as the second position corresponding to the second convolution window in the (M - 1)-th frame image, and the second convolution window has a corresponding output matrix.
[0043] According to an embodiment of the present disclosure, the (M - 1)-th frame image may be the previous frame image of the M-th frame image in the target detection video.
[0044] According to another embodiment of the present disclosure, the first position may be the position corresponding to the first convolution window in the M-th frame image, the second position may be the position corresponding to the second convolution window in the (M - 1)-th frame image, and the first position and the second position may be the same.
[0045] According to another embodiment of the present disclosure, by comparing the pixel values of the first convolution window and the pixel values of the second convolution window, the similarity between the first convolution window and the second convolution window can be determined. For example, the absolute value of the difference between the pixel values of the first convolution window and the pixel values of the second convolution window may be compared, and then the similarity is determined.
[0046] According to another embodiment of the present disclosure, the similarity can be calculated by the following formula (I):
[0047] |a i -b i |=threshold (I)
[0048] where a i and b i are respectively the pixel values of the first convolution window and the corresponding second convolution window, and threshold represents the absolute value of the difference between the pixel values of the first convolution window and the pixel values of the second convolution window.
[0049] According to another embodiment of the present disclosure, the output matrix may be the matrix corresponding to the result obtained by calculating the second convolution window.
[0050] In operation S104, determine a target first convolution window whose similarity meets a preset condition from multiple first convolution windows, where the target first convolution window has a target second convolution window with the same position.
[0051] According to an embodiment of the present disclosure, the preset condition may be a condition for judging similarity preset by the user. For example, the preset condition may be that the absolute value of the difference between the pixel values of the first convolution window and the pixel values of the second convolution window is less than 0.005.
[0052] According to yet another embodiment of the present disclosure, the position of the target first convolution window on the Mth frame image is the same as the position of the target second convolution window on the M-1th frame image.
[0053] In operation S105, an output matrix corresponding to the target second convolution window is determined as a first output matrix of the target first convolution window.
[0054] According to an embodiment of the present disclosure, the output matrix corresponding to the target second convolution window may be copied to the position of the output matrix corresponding to the target first convolution window to obtain the first output matrix.
[0055] In operation S106, the target in the M-th frame image is detected according to the second output matrices respectively corresponding to the other first convolution windows among the plurality of first convolution windows except the target first convolution window, and the first output matrix.
[0056] According to an embodiment of the present disclosure, the second output matrix may be obtained by calculating other first convolution windows except the target first convolution window, and the first output matrix and the second output matrix may be the output results of the Mth frame image.
[0057] In an embodiment of the present disclosure, a configuration file of a target detection video can be read; based on the configuration file, structural information of a neural network is determined and weights of each network layer are assigned, wherein the network layer includes a convolutional layer; the M-1th frame image is input into the convolutional layer to obtain a second convolutional window; based on the second convolutional window and the convolutional kernel in the convolutional layer, an output matrix of the M-1th frame image is determined.
[0058] According to an embodiment of the present disclosure, the configuration file may be a program file for detecting the target detection video, and may be pre-set in the mobile terminal and read by a program of the mobile terminal.
[0059] According to another embodiment of the present disclosure, the structural information of the neural network may include the number of layers of the network, the category of each network layer, the dimensions of the output and input, and the like.
[0060] According to another embodiment of the present disclosure, when assigning weights to each network layer, the assignment may be performed according to a weight file in a configuration file.
[0061] According to another embodiment of the present disclosure, the M-1th frame image can be read from the target detection video, and the image can be input into the convolution layer. After calculation by the convolution layer, the pixel values corresponding to the pixels of the M-1th frame image can be represented in matrix form, and then the matrix is divided into a second convolution window.
[0062] According to another embodiment of the present disclosure, the matrix corresponding to the second convolution window may be multiplied by the convolution kernel to obtain an output matrix of the M-1th frame image.
[0063] Through the target detection method provided by the embodiment of the present application, the Mth frame image in the target detection video can be obtained, and then the Mth frame image is processed to obtain multiple first convolution windows, and then for each first convolution window, the similarity between the first convolution window and the second convolution window is determined according to the pixel value of the first convolution window and the pixel value of the second convolution window of the M-1th frame image in the target detection video, and then the target first convolution window whose similarity meets the preset conditions is determined from the multiple first convolution windows, and the output matrix corresponding to the target second convolution window with the same position as the target first convolution window is determined as the first output matrix of the target first convolution window, and then the target in the Mth frame image is detected according to the second output matrix and the first output matrix corresponding to the other first convolution windows except the target first convolution window in the multiple first convolution windows. In this way, the Mth frame image can use the result calculated by the previous frame image, reducing the amount of calculation for the Mth frame image, thereby improving the detection speed of the target in the video.
[0064] Reference below Figure 2A to Figure 2G , combined with specific embodiments Figure 1 The method shown is further explained.
[0065] Figure 2A A schematic diagram showing the input matrix of the input image and the convolution kernel.
[0066] like Figure 2A As shown, the input image is represented in matrix form with pixel values of pixels, and the shaded area can be represented as the first convolution window. For the convenience of calculation, each convolution window can be expanded into a column through the im2col (image to column) operation. The first column in the input matrix b1 is the expanded result of the first convolution window, and the corresponding convolution kernel a1 can also be expanded into a row. It should be noted that the integers shown in the matrices of the drawings of the present disclosure are for the convenience of display and do not represent the pixel values corresponding to the actual image pixels.
[0067] Figure 2B It is a schematic diagram of computational reuse of the Mth frame image and the M-1th frame image of the target detection video.
[0068] like Figure 2B As shown, the rectangular annotation box in the Mth frame image corresponds to the first position, and the rectangular annotation box in the M-1th frame image corresponds to the second position, and the first position is the same as the second position. The output matrix can be obtained by multiplying the input matrix b2 corresponding to the M-1th frame image with the corresponding convolution kernel a2.
[0069] Among them, the similarity between the target second convolution window corresponding to the shaded part in the input matrix b2 in the M-1 frame and the target first convolution window of the M-1 frame image can meet the preset conditions, and the output matrix corresponding to the target second convolution window in the M-1 frame is the shaded part in c2, and the output matrix corresponding to the target second convolution window is copied to the first output matrix position corresponding to the target first convolution window, such as the shaded part in the output matrix c3 corresponding to the M-1 frame image.
[0070] Figure 2C The figure shows the result of the prior art on the target detection in the image.
[0071] Among them, target detection is performed on each frame in the video of the BDD video set to generate a benchmark for comparison, and then the target detection method of the present invention is used to detect the video again, and the detection result is compared with the previous benchmark to obtain relative accuracy. The benchmark detection frame and the detection frame obtained at the same position using the target detection method in the embodiment of the present invention are called a detection frame pair.
[0072] like Figure 2C As shown, the first line is the frame number, followed by the category and probability of an object, and finally 4 floating-point numbers representing the position of the target detection frame. From left to right are the x and y coordinates of the center and the width and height of the detection frame. They are all normalized here and are the ratios relative to the width and height of the image. If the centers of two detection frames with the same label are close enough, it is considered that the two detection frames have detected the same target, that is, it is considered that the target detection method disclosed in the present invention has correctly detected a target. The ratio of the number of targets detected correctly in all frames of a video to the number of benchmark targets is the relative accuracy.
[0073] Furthermore, the intersection-over-union ratio of the detection box can be calculated as follows: Figure 2D shown. Figure 2D The diagram shows the calculation method of the intersection-over-union ratio of the detection box pair. It can be calculated by the following formula (II):
[0074]
[0075] Wherein, the detection frame x1 is the reference detection frame, and the detection frame x2 is the detection frame obtained at a relative position by the target detection method in the embodiment of the present disclosure. S1 is the intersection of the areas of x1 and x2, and S2 is the union of the areas of x1 and x2. The average of the intersection-and-union ratios of all frames is the average intersection-and-union ratio.
[0076] Table 1 schematically shows the experimental results under different similarity thresholds. From Table 1, it can be seen that the overall trend is that as the threshold increases, the computational reuse increases, the amount of computation decreases, and the reasoning time decreases. However, the relative accuracy also decreases. The smaller the threshold, the higher the accuracy, but the smaller the speed improvement. Therefore, the selection of the threshold should be a compromise between accuracy and speed.
[0077] Experiments show that when the threshold is 0.005, the accuracy exceeds 99% and the inference time is reduced by about 25% compared to not using computational reuse. Since the algorithm needs to store the input and output of each convolutional layer for computational reuse, the memory consumption is about twice the original, which is the space cost of saving time.
[0078] Table 1
[0079]
[0080] Figure 2E A schematic diagram of a line graph showing the experimental results under different similarity thresholds in Table 1.
[0081] like Figure 2E As shown, the trend in Table 1 is more intuitive. Among them, relative accuracy is a relatively rough way to evaluate the quality of the results, which can only tell us the overall trend. To know more details, it is necessary to analyze the average center distance and average intersection-over-union ratio of the detection box. The average distance and average intersection-over-union ratio of each frame are calculated by comparing the results obtained by the neural network before and after the IACR algorithm is used. The detection box of the same target is a detection box pair, and we can calculate the center Euclidean distance and intersection-over-union ratio of the detection box pair. The average Euclidean distance of the center of all detection box pairs is averaged to obtain the average distance, and similarly the average intersection-over-union ratio is obtained.
[0082] Figure 2F A line graph showing the variation of the similarity of adjacent frames with the threshold according to an embodiment of the present disclosure is shown.
[0083] like Figure 2F As shown in the figure, the horizontal axis is the frame number, and the vertical axis represents the ratio of similar convolution windows between this frame and the previous frame to the total convolution windows. Because these six figures represent the similarity of adjacent frames of the same video, their similarity trends with the change of frame number are also similar. However, the similarity is different under different thresholds. A larger threshold leads to more similarity because the constraint becomes less strict.
[0084] Figure 2G A line graph showing changes in the average intersection-over-union ratio and the average center distance of each frame with the threshold according to an embodiment of the present disclosure is shown.
[0085] like Figure 2G As shown in the figure, the horizontal axis is the frame number, and the vertical axis is the ratio of the convolution windows that are similar between this frame and the previous frame to the total convolution windows. From the figure, we can see that the smaller the similarity threshold, the closer the intersection-union ratio is to 1, and the smaller the average distance between the detection frames is, which means the higher the relative accuracy is. As the similarity threshold increases, the farther the intersection-union ratio is from 1, the larger the average distance between the detection frames is, which means the lower the relative accuracy is.
[0086] Figure 3 A block diagram of a target detection device according to an embodiment of the present disclosure is schematically shown.
[0087] like Figure 3 As shown, the target detection device 300 includes an acquisition module 310 , a first processing module 320 , a first determination module 330 , a second determination module 340 , a third determination module 350 and a detection module 360 .
[0088] The acquisition module 310 is used to acquire the Mth frame image of the target detection video, where M is a positive integer greater than or equal to 2.
[0089] The first processing module 320 is used to process the M-th frame image to obtain a plurality of first convolution windows.
[0090] The first determination module 330 is used to determine, for each first convolution window, the similarity between the first convolution window and the second convolution window according to the pixel value of the first convolution window and the pixel value of the second convolution window of the M-1th frame image in the target detection video.
[0091] The second determination module 340 is used to determine a target first convolution window whose similarity meets a preset condition from the multiple first convolution windows, wherein the target first convolution window has a target second convolution window with the same position.
[0092] The third determination module 350 is used to determine the output matrix corresponding to the target second convolution window as the first output matrix of the target first convolution window.
[0093] The detection module 360 is used to detect the target in the M-th frame image according to the second output matrices corresponding to the other first convolution windows except the target first convolution window in the multiple first convolution windows and the first output matrix.
[0094] According to an embodiment of the present disclosure, the second determination module 340 may be configured to determine the similarity between the first convolution window and the second convolution window according to an absolute value of a difference between a pixel value of the first convolution window and a pixel value of the second convolution window.
[0095] According to another embodiment of the present disclosure, the above-mentioned device 300 also includes: a reading module, which is used to read the configuration file of the target detection video; a fourth determination module, which is used to determine the structural information of the neural network and assign weights to each network layer according to the configuration file, wherein the network layer includes a convolution layer; an input module, which is used to input the M-1th frame image into the convolution layer to obtain a second convolution window; and a fifth determination module, which is used to determine the output matrix of the M-1th frame image according to the second convolution window and the convolution kernel in the convolution layer.
[0096] According to another embodiment of the present disclosure, the above-mentioned device 300 further includes: a saving module, used to save the second convolution window and output matrix of the M-1th frame image in the target detection video.
[0097] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.
[0098] For example, any multiple of the acquisition module 310, the first processing module 320, the first determination module 330, the second determination module 340, the third determination module 350, and the detection module 360 can be combined in one module / unit / sub-unit for implementation, or any one of the modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functions of one or more of the modules / units / sub-units can be combined with at least part of the functions of other modules / units / sub-units and implemented in one module / unit / sub-unit. According to an embodiment of the present disclosure, at least one of the acquisition module 310, the first processing module 320, the first determination module 330, the second determination module 340, the third determination module 350, and the detection module 360 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware and firmware or by an appropriate combination of any of them. Alternatively, at least one of the acquisition module 310, the first processing module 320, the first determination module 330, the second determination module 340, the third determination module 350, and the detection module 360 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be performed.
[0099] Figure 4 A block diagram of an electronic device suitable for implementing the target detection method described above according to an embodiment of the present disclosure is schematically shown. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0100] like Figure 4 As shown, the electronic device 400 according to an embodiment of the present disclosure includes a processor 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage part 408 into a random access memory (RAM) 403. The processor 401 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 401 may also include an onboard memory for caching purposes. The processor 401 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0101] In RAM 403, various programs and data required for the operation of electronic device 500 are stored. Processor 401, ROM 402 and RAM 403 are connected to each other via bus 404. Processor 401 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 402 and / or RAM 403. It should be noted that the program can also be stored in one or more memories other than ROM 402 and RAM 403. Processor 401 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0102] According to an embodiment of the present disclosure, the electronic device 500 may further include an input / output (I / O) interface 405, which is also connected to the bus 404. The system 500 may further include one or more of the following components connected to the I / O interface 405: an input section 406 including a keyboard, a mouse, etc.; an output section 407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN card, a modem, etc. The communication section 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the I / O interface 405 as needed. A removable medium 411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 410 as needed, so that a computer program read therefrom is installed into the storage section 408 as needed.
[0103] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 409, and / or installed from the removable medium 411. When the computer program is executed by the processor 401, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
[0104] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0105] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.
[0106] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 402 and / or the RAM 403 described above and / or one or more memories other than the ROM 402 and the RAM 403 .
[0107] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It can be understood by those skilled in the art that the features recorded in the various embodiments and / or claims of the present disclosure can be combined and / or combined in a variety of ways, even if such a combination or combination is not explicitly recorded in the present disclosure. In particular, without departing from the spirit and teaching of the present disclosure, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0108] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A target detection method, comprising: Obtain the Mth frame image in the target detection video, where M is a positive integer greater than or equal to 2; Processing the M-th frame image to obtain a plurality of first convolution windows; For each of the first convolution windows, determining the similarity between the first convolution window and the second convolution window according to a pixel value of the first convolution window and a pixel value of a second convolution window of an M-1th frame image in the target detection video, wherein a first position corresponding to the first convolution window in the M-th frame image is the same as a second position corresponding to the second convolution window in the M-1th frame image, and the second convolution window has a corresponding output matrix; Determine a target first convolution window whose similarity satisfies a preset condition from the plurality of first convolution windows, wherein the target first convolution window has a target second convolution window at the same position; Determine the output matrix corresponding to the target second convolution window as the first output matrix of the target first convolution window; The target in the M-th frame image is detected according to the second output matrices respectively corresponding to the other first convolution windows among the plurality of first convolution windows except the target first convolution window, and the first output matrix.
2. The method according to claim 1, wherein: The determining, for each of the first convolution windows, a similarity between the first convolution window and the second convolution window according to a pixel value of the first convolution window and a pixel value of a second convolution window of an M-1th frame image in the target detection video, comprises: The similarity between the first convolution window and the second convolution window is determined according to the absolute value of the difference between the pixel value of the first convolution window and the pixel value of the second convolution window.
3. The method according to claim 1, further comprising: Reading a configuration file of the target detection video; According to the configuration file, determine the structural information of the neural network and assign a value to the weight of each network layer, wherein the network layer includes a convolutional layer; Inputting the M-1th frame image into the convolution layer to obtain the second convolution window; The output matrix of the M-1th frame image is determined according to the second convolution window and the convolution kernel in the convolution layer.
4. The method according to any one of claims 1 to 3, further comprising: Save the second convolution window and the output matrix of the M-1th frame image in the target detection video.
5. A target detection device, comprising: An acquisition module is used to acquire the Mth frame image of the target detection video, where M is a positive integer greater than or equal to 2; A first processing module, used for processing the M-th frame image to obtain a plurality of first convolution windows; A first determination module is used to determine, for each of the first convolution windows, a similarity between the first convolution window and the second convolution window according to a pixel value of the first convolution window and a pixel value of a second convolution window of an M-1th frame image in the target detection video; A second determining module is used to determine a target first convolution window whose similarity satisfies a preset condition from the plurality of the first convolution windows, wherein the target first convolution window has a target second convolution window with the same position; A third determining module, configured to determine an output matrix corresponding to the target second convolution window as a first output matrix of the target first convolution window; A detection module is used to detect the target in the M-th frame image according to the second output matrices corresponding to the other first convolution windows except the target first convolution window in the plurality of first convolution windows, and the first output matrix.
6. The device according to claim 5, wherein: The second determination module is specifically used for: The similarity between the first convolution window and the second convolution window is determined according to the absolute value of the difference between the pixel value of the first convolution window and the pixel value of the second convolution window.
7. The device according to claim 5 or 6, further comprising: A reading module, used to read the configuration file of the target detection video; A fourth determination module, used to determine the structural information of the neural network and assign a value to the weight of each network layer according to the configuration file, wherein the network layer includes a convolutional layer; An input module, used for inputting the M-1th frame image into the convolution layer to obtain the second convolution window; The fifth determination module is used to determine the output matrix of the M-1th frame image according to the second convolution window and the convolution kernel in the convolution layer.
8. A target detection device, comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are enabled to execute the method according to any one of claims 1 to 4.
9. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the method according to any one of claims 1 to 4.
10. A computer program product, comprising computer executable instructions, wherein the computer executable instructions are used to implement the method according to any one of claims 1 to 4 when executed.
Citation Information
Patent Citations
Projection convolution-based satellite-borne laser radar incoherent accumulation detection method
CN108254756A
Method, device and equipment for extracting image data in multiple convolution windows in parallel and computer readable storage medium
CN112306555A
