Image detection method, image detection device, electronic equipment and storage medium

By acquiring the local image of the previous frame image and splicing it with the current frame image, and determining the output frame with the target detection results and position information, the continuity and repetitive detection problems of object detection during image acquisition are solved, and the continuity and accuracy of detection are improved.

CN119887786AActive Publication Date: 2025-04-25BEIJING HONEST TECHNOLOGY CO LTD

Patent Information

Application Number
CN202510388219.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-31
Publication Date
2025-04-25
Estimated Expiration
2045-03-31

AI Technical Summary

Technical Problem

During the image acquisition process, there are problems of continuity and repeated detection of object detection between continuous frames, which affects the detection results.

Method used

By acquiring a local image of the previous frame image and splicing it with the current frame image, the target image is formed for detection, and the output frame is determined based on the target detection results and position information.

Benefits of technology

It reduces visual breaks when objects move between frames, improves the continuity and accuracy of object detection, and avoids information loss caused by inter-frame switching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119887786A_ABST
    Figure CN119887786A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image detection, in particular to an image detection method, an image detection device, electronic equipment and a storage medium. The invention provides an image detection method. The method comprises the following steps: acquiring a current frame image; if the previous frame of image exists, a first local image extracted from the bottom of the previous frame of image is obtained, the distance between the bottom edge position of a first detection frame corresponding to the first local image and the bottom edge position of the previous frame of image is smaller than a first distance, and the first local image comprises the top edge of the first detection frame; splicing the first local image at the top of the current frame image to obtain a first target image; and determining and outputting a target output box corresponding to the current frame image based on a second target detection result obtained by performing target detection on the first target image and the first position information. According to the invention, the situation of information loss caused by inter-frame switching can be effectively avoided, so that the reliability and accuracy of target detection can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of image detection, and in particular to an image detection method, an image detection device, an electronic device, and a computer-readable storage medium. Background Art

[0002] In the actual image acquisition process, in order to improve the acquisition efficiency, a specific size is used for image acquisition, so as to increase the acquisition speed while ensuring the acquisition of certain image information. It is suitable for scenarios that require rapid acquisition of image data, such as industrial automation detection, high-speed video surveillance, etc.

[0003] However, when performing target detection and analysis on continuously acquired image frames, problems such as the continuity of the target between different frames and repeated detection will be encountered, which will affect the detection results. Summary of the invention

[0004] To overcome the problems existing in the related art, an exemplary embodiment of the present disclosure provides an image detection method, the method comprising: obtaining a current frame image; if there is a previous frame image, obtaining a first local image extracted from the bottom of the previous frame image, wherein the first local image is obtained based on a first target detection result corresponding to the previous frame image, the first target detection result includes a first detection frame corresponding to the first local image and first position information of the first detection frame, the distance between the bottom edge position of the first detection frame and the bottom edge position of the previous frame image is less than the first distance, and the first local image includes a top edge of the first detection frame; splicing the first local image on the top of the current frame image to obtain a first target image; performing target detection on the first target image to obtain a second target detection result corresponding to the current frame image; based on the second target detection result and the first position information, determining and outputting a target output frame corresponding to the current frame image.

[0005] In some embodiments, based on the second target detection result and the first position information, a target output frame corresponding to the current frame image is determined and output, including: according to the second target detection result, respectively determining multiple detection frames corresponding to the first target image and the position information of each detection frame; based on the position information of each detection frame and the first position information, determining the target output frame corresponding to the current frame image from multiple detection frames; and outputting the target output frame.

[0006] In some embodiments, based on the position information and the first position information of each detection frame, a target output frame corresponding to the current frame image is determined from multiple detection frames, including: determining a first target position in the first target image, the first target position being a position in the first local image that is a first distance away from the top edge position of the current frame image; determining the category of each detection frame according to the position information, the first target position and the first position information of each detection frame according to the classification strategy; determining the target output frame corresponding to the current frame image based on the category of each detection frame; wherein the classification strategy includes: a first classification strategy: taking the detection frame whose position information overlaps with the first target position as the first category, and the detection frames of the first category include the detection frames that overlap with the first position information; a second classification strategy: taking the detection frame whose position information is between the first target position and the second target position as the second category, and the second target position is a position in the current frame image that is a first distance away from the bottom edge position of the current frame image; a third classification strategy: taking the detection frame whose position information is between the top edge position of the first local image and the top edge position of the current frame image as the third category.

[0007] In some embodiments, based on the category of each detection frame, a target output frame corresponding to the current frame image is determined, including: taking a detection frame that is a union of the first category and the second category but a difference from the third category as the target output frame corresponding to the current frame image; and / or determining a third detection frame that intersects the first category and the third category among multiple detection frames; determining the region area of ​​the third detection frame according to the position information of the third detection frame; determining a reference detection frame for deduplication detection in the previous frame image and the third position information of the reference detection frame based on the position information of the fourth detection frame in the previous frame image, the fourth detection frame being a detection frame whose position information overlaps with the position of the top edge of the first local image in the previous frame image; determining the intersection area between the third detection frame and the reference detection frame according to the position information of the third detection frame and the third position information; and if the ratio between the intersection area and the region area is less than a specified threshold, taking the third detection frame as the target output frame corresponding to the current frame image.

[0008] In some embodiments, based on the category of each detection frame, determining the target output frame corresponding to the current frame image also includes: if the distance between the bottom edge position of the detection frame and the bottom edge position of the current frame image is less than a first distance, then using the detection frame as a non-target output frame corresponding to the current frame image; and / or if the ratio between the intersection area and the region area is greater than or equal to a specified threshold, then using the third detection frame as a non-target output frame corresponding to the current frame image.

[0009] In some embodiments, the method also includes: based on the second position information of each second detection frame, determining the second distance between the top edge position of each second detection frame and the bottom edge position of the current frame image, wherein the second detection frame is a detection frame in which the distance between the bottom edge position of the detection frame and the bottom edge of the image of the current frame image is less than the first distance; based on the maximum second distance, determining the image extraction height; based on the third target position corresponding to the image extraction height, extracting the second local image from the bottom of the current frame image; saving the second local image to be spliced ​​on the top of the next frame image, and determining the target output frame corresponding to the next frame image.

[0010] In some embodiments, the classification strategy also includes a fourth classification strategy: the detection box whose position information overlaps with the third target position is regarded as a fourth category; the method also includes: saving the position information corresponding to the detection box of the fourth category for determining the non-target output box corresponding to the next frame image.

[0011] In some embodiments, the first partial image is stitched on top of the current frame image to obtain a first target image, including: stitching the first partial image on top of the current frame image to obtain a stitched image; determining the image height of the first partial image; determining the first stitching height of the stitched image according to the image height of the first partial image and the image height of the current frame image; determining the second stitching height of the previous frame image corresponding to the first target image; if the second stitching height is greater than the first stitching height, then according to the height difference between the second stitching height and the first stitching height, clearing the top area image corresponding to the first target image of the previous frame image and the height difference to obtain an intermediate image; overlaying the stitched image on the intermediate image to obtain the first target image.

[0012] In some embodiments, the method further includes: if there is no previous frame image, performing target detection on the current frame image to obtain a third target detection result corresponding to the current frame image; based on the third target detection result, determining and outputting a target output box corresponding to the current frame image.

[0013] In some embodiments, based on the third target detection result, a target output frame corresponding to the current frame image is determined and output, including: according to the third target detection result, multiple detection frames corresponding to the current frame image and the position information of each detection frame are respectively determined; according to the position information of each detection frame, a detection frame belonging to the fifth category is used as the target output frame corresponding to the current frame image; wherein the detection frame of the fifth category is a detection frame whose position information is between the top edge position of the current frame image and the second target position, and the second target position is a position in the current frame image that is a first distance away from the bottom edge position of the current frame image.

[0014] In a second aspect, the present disclosure also provides an image detection device, which includes: a first acquisition module, used to acquire a current frame image; a second acquisition module, used to acquire a first local image extracted from the bottom of a previous frame image if there is a previous frame image, wherein the first local image is obtained based on a first target detection result corresponding to the previous frame image, the first target detection result includes a first detection frame corresponding to the first local image and first position information of the first detection frame, the distance between the bottom edge position of the first detection frame and the bottom edge position of the previous frame image is less than the first distance, and the first local image includes a top edge of the first detection frame; a splicing module, used to splice the first local image on the top of the current frame image to obtain a first target image; a first detection module, used to perform target detection on the first target image to obtain a second target detection result corresponding to the current frame image; a first processing module, used to determine and output a target output frame corresponding to the current frame image based on the second target detection result and the first position information.

[0015] In a third aspect, the present disclosure further provides an electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the image detection method provided in any one of the above aspects by executing the computer instructions.

[0016] In a fourth aspect, the present disclosure further provides a computer-readable storage medium, which stores the following program, and the program is used to execute the image detection method provided in any of the above aspects.

[0017] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.

[0018] The technical solution provided by the embodiment of the present disclosure may include the following beneficial effects: According to the image detection method provided by the present disclosure, in the case of the existence of a previous frame image, a first partial image extracted from the bottom of the previous frame image is obtained, and the first target image is obtained by splicing it with the current frame image, which helps to reduce the visual discontinuity when the object moves between frames, thereby improving the continuity and accuracy of target detection. Wherein, the first partial image is obtained based on the first target detection result corresponding to the previous frame image, and the height between the first partial image and the image bottom edge of the previous frame image is determined according to the top edge position of the first detection frame in the first partial image, thereby ensuring the reliability and flexibility of the extraction of the first partial image, and adapting to a variety of image splicing scenes, thereby helping to improve the accuracy of the spliced ​​image and ensure the integrity of the object target detection. In addition, by performing target detection on the first target image, and determining and outputting the target output frame corresponding to the current frame image based on the obtained second target detection result and the first position information of the first detection frame, it is possible to effectively avoid the situation where information loss occurs due to switching between frames, thereby effectively improving the reliability and accuracy of target detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The present disclosure may be better understood by describing exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, in which:

[0020] Figure 1 A schematic diagram of a flow chart of an image detection method shown in an exemplary embodiment of the present disclosure;

[0021] Figure 2 A schematic flow chart of another image detection method according to an exemplary embodiment of the present disclosure;

[0022] Figure 3 A schematic diagram of the position distribution of a detection frame shown in an exemplary embodiment of the present disclosure;

[0023] Figure 4 A schematic diagram of another detection frame position distribution according to an exemplary embodiment of the present disclosure;

[0024] Figure 5 A schematic diagram of the position distribution of another detection frame shown in an exemplary embodiment of the present disclosure;

[0025] Figure 6 A schematic diagram of a target image shown in an exemplary embodiment of the present disclosure;

[0026] Figure 7 A schematic flow chart of another image detection method shown in an exemplary embodiment of the present disclosure;

[0027] Figure 8A schematic diagram of the position distribution of another detection frame shown in an exemplary embodiment of the present disclosure;

[0028] Fig. 9 A schematic diagram of a flow chart of another image detection method according to an exemplary embodiment of the present disclosure;

[0029] Fig.10 A schematic diagram of a background image shown in an exemplary embodiment of the present disclosure;

[0030] Fig.11 A schematic diagram of another target image shown in an exemplary embodiment of the present disclosure;

[0031] Fig.12 A schematic flow chart of an image detection method shown in another exemplary embodiment of the present disclosure;

[0032] Fig.13 It is a structural schematic diagram of an image detection method and device shown in another exemplary embodiment of the present disclosure;

[0033] Fig.14 The figure is a schematic diagram of the structure of an electronic device shown in an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0034] The specific implementation methods of the present disclosure will be described below. It should be noted that in the specific description of these implementation methods, in order to provide a concise description, it is impossible for this specification to provide a detailed description of all the features of the actual implementation methods. It should be understood that in the actual implementation of any implementation method, just as in the process of any engineering project or design project, in order to achieve the specific goals of the developer and to meet system-related or business-related restrictions, various specific decisions are often made, and this will also change from one implementation method to another. In addition, it can also be understood that although the efforts made in this development process may be complex and lengthy, for ordinary technicians in the field related to the content disclosed by the present disclosure, some changes in design, manufacturing or production based on the technical content disclosed in the present disclosure are just conventional technical means, and should not be understood as insufficient content of the present disclosure.

[0035] Unless otherwise defined, the technical terms or scientific terms used in the present disclosure shall have the usual meanings understood by persons with ordinary skills in the technical field to which the present disclosure belongs. The words "first", "second" and similar words used in the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. Words such as "one" or "one" and the like do not indicate a quantitative limitation, but rather indicate the presence of at least one. Words such as "include" or "comprise" and the like mean that the elements or objects appearing before "include" or "comprise" cover the elements or objects listed after "include" or "comprise" and their equivalents, and do not exclude other elements or objects. Words such as "connect" or "connected" and the like are not limited to physical or mechanical connections, nor are they limited to direct or indirect connections.

[0036] In the field of industrial image detection, the traditional frame-by-frame target detection method has many limitations in the process of industrial continuous shooting. For example, in practical applications, when an object is at the edge of the picture, it is easy for the object to be cut off, which in turn affects the integrity of the detection results.

[0037] In the actual image acquisition process, in order to improve the acquisition efficiency, a specific size is used for image acquisition, so as to ensure the acquisition of certain image information while improving the acquisition speed. It is suitable for scenes that require rapid acquisition of image data, such as industrial automation detection, high-speed video surveillance, etc. For example, the size of the acquired image can be width*height, and height=1 / 8width.

[0038] However, when performing target detection and analysis on continuously acquired frame images, problems such as the continuity of the target between different frames and repeated detection will be encountered, which will affect the detection results.

[0039] In the related art, in order to solve the above problems, a fixed cropping area is used to perform image stitching to achieve cross-frame detection. However, since the size and movement speed of objects vary, the use of this method for image detection is likely to affect the detection effect. For example, for objects with larger sizes or slower movement speeds, they may not be completely contained in the cropping area, resulting in incomplete object information and thus detection failure. Alternatively, for objects with smaller sizes or faster movement speeds, the cropping area may be too large, resulting in unnecessary computational burden and false detection.

[0040] To solve the above problems, an exemplary embodiment of the present disclosure provides an image detection method. Figure 1 As shown, the image detection method may include the following steps:

[0041] Step S110, obtaining the current frame image.

[0042] The current frame image refers to the frame image that currently needs to be processed for target detection. The current frame image is one of the continuous multiple frame images. The multiple frame images can be acquired locally, from the cloud, or in real time. The image content corresponding to the current frame image may depend on the corresponding image acquisition scene. For example, taking the image acquisition scene as an ore sorting scene as an example, the image content corresponding to the current frame image may be the ore transmitted by the transmission mechanism of the ore sorting machine.

[0043] Step S120: if there is a previous frame image, obtain a first partial image extracted from the bottom of the previous frame image.

[0044] Since objects may be cut off at the edge of the picture during the actual image acquisition process, in order to determine whether there is an object cut off at the edge of the picture in the previous frame image, it is first determined whether there is a previous frame image. The previous frame image refers to a frame image that is adjacent to the current frame image and has been processed by target detection.

[0045] If there is a previous frame image, a first partial image extracted from the bottom of the previous frame image is obtained, wherein the first partial image is obtained based on the first target detection result corresponding to the previous frame image, the first target detection result includes a first detection frame corresponding to the first partial image and first position information of the first detection frame, the distance between the bottom edge position of the first detection frame and the bottom edge position of the previous frame image is less than the first distance, and the first partial image includes the top edge of the first detection frame.

[0046] That is, the first distance can be understood as the minimum distance used to determine whether the information of the detection frame is complete. According to the first target detection result, the position information of each detection frame in the previous frame image can be clarified. The distance between the bottom edge position of each detection frame and the bottom edge position of the previous frame image is compared with the first distance respectively. If the distance between the bottom edge position of the detection frame and the bottom edge position of the previous frame image is greater than or equal to the first distance, it indicates that the object corresponding to the detection frame is not cut off by the edge of the picture during the actual image acquisition process, and the information of the detection frame is complete. However, if the distance between the bottom edge position of the detection frame and the bottom edge position of the previous frame image is less than the first distance, it indicates that the object corresponding to the detection frame may be cut off by the edge of the picture during the actual image acquisition process, and the information of the detection frame may be incomplete. In order to ensure the integrity of the information of the object, it can be considered that the detection frame is the first detection frame in the previous frame image that needs to be detected across frames.

[0047] In order to ensure the information integrity of the first detection frame, the height of the first partial image is determined according to the position of the first detection frame to ensure the rationality of the extraction of the first partial image. In some embodiments, if the number of first detection frames corresponding to the previous frame image is one, the height of the first partial image may be greater than or equal to the distance between the top edge position of the first detection frame and the bottom edge position of the previous frame image, so as to avoid the situation where the partial image is over-extracted and the computing resources are wasted. In other embodiments, if the number of first detection frames corresponding to the previous frame image is multiple, the height of the first partial image may depend on the maximum distance between the top edge positions of the multiple first detection frames and the bottom edge positions of the previous frame image, so as to avoid the situation where the first detection frame is incomplete due to under-extraction of the partial image.

[0048] In some examples, the height of the first partial image may be equal to the maximum distance between the top edge position of the first detection frame and the bottom edge position of the previous frame image, so that the first partial image extracted from the bottom of the previous frame image can be quickly determined. For example, if the maximum distance between the top edge position of the first detection frame and the bottom edge position of the previous frame image is max_H, then the first partial image extracted from the bottom of the previous frame image is a local area with a height of max_H from the bottom edge of the image of the previous frame image as a reference.

[0049] In other examples, in order to ensure the extraction integrity of the first detection frame, the tolerance pixel height of the corresponding detection frame mark is determined according to the adopted target detection algorithm, and then the sum of the tolerance pixel height and the maximum distance between the top edge position of the first detection frame and the bottom edge position of the previous frame image is used as the height of the first partial image. The target detection algorithm corresponds to the tolerance pixel height one by one. For example, the tolerance pixel height is determined to be top_h, and the maximum distance between the top edge position of the first detection frame and the bottom edge position of the previous frame image is max_H. Then the first partial image extracted from the bottom of the previous frame image is a local area with a height of H=max_H+top_h from the bottom edge of the image of the previous frame image as a reference. For example, taking the target detection algorithm as YOLOv5 as an example, the tolerance pixel height of the corresponding detection frame mark is 2-3 pixels, and then the tolerance pixel height top_h can be selected as 3.

[0050] In some implementation scenarios, taking the industrial image acquisition scenario as an example, the object may include but is not limited to ore, cotton, plastic, metal, etc., and can be specifically determined based on the actual image acquisition scenario.

[0051] Step S130, splicing the first partial image on top of the current frame image to obtain a first target image.

[0052] Since the first partial image is the tail image of the previous frame image, and the distance between the bottom edge position of the first detection frame in the first partial image and the bottom edge position of the previous frame image is less than the first distance, in order to determine whether the information of the first detection frame is complete and whether the object image corresponding to the first detection frame is truncated by the image edge, the first partial image is spliced ​​on the top of the current frame image to obtain the first target image, so as to reduce the visual discontinuity of the same object when moving between frames, thereby helping to improve the continuity and accuracy of target detection.

[0053] Step S140, performing target detection on the first target image to obtain a second target detection result corresponding to the current frame image.

[0054] Target detection is performed on the first target image, and the result of the target detection on the first target image is used as the second target detection result corresponding to the current frame image, so that the distribution of each object image in the current frame image can be determined based on the second target detection result, thereby facilitating subsequent targeted tracking and identification.

[0055] Step S150: determining and outputting a target output frame corresponding to the current frame image based on the second target detection result and the first position information.

[0056] By combining the second target detection result with the first position information, the detection frame information corresponding to the object image involved in target detection across image frames can be made more complete, and then it can be clear which detection frames among the multiple detection frames corresponding to the current frame image are target detection frames that can be output, so that the target output frame corresponding to the current frame image determined and output is more reliable, and the information loss caused by switching between frames can be effectively avoided, which is more helpful to ensure the accuracy of target detection. That is, the target detection frame can be understood as the detection frame that can be output corresponding to the current frame image.

[0057] According to the image detection method provided by the present disclosure, in the presence of a previous frame image, a first partial image extracted from the bottom of the previous frame image is obtained, and the first target image is obtained by splicing it with the current frame image, which helps to reduce the visual discontinuity when the object moves between frames, thereby improving the continuity and accuracy of target detection. Wherein, the first partial image is obtained based on the first target detection result corresponding to the previous frame image, and the height between the first partial image and the image bottom edge of the previous frame image is determined according to the top edge position of the first detection frame in the first partial image, thereby ensuring the extraction reliability and flexibility of the first partial image, and adapting to a variety of image splicing scenes, thereby helping to improve the accuracy of the spliced ​​image and ensure the integrity of object target detection. In addition, by performing target detection on the first target image, and determining and outputting the target output frame corresponding to the current frame image based on the obtained second target detection result and the first position information of the first detection frame, it is possible to effectively avoid the situation where information loss occurs due to switching between frames, thereby effectively improving the reliability and accuracy of target detection.

[0058] In some embodiments, Figure 2 As shown, the above step S150 may include the following steps:

[0059] Step S151, according to the second target detection result, determine a plurality of detection frames corresponding to the first target image and position information of each detection frame.

[0060] According to the second target detection result, it can be determined whether there is a recognized object image in the first target image. If there is a recognized object image, the detection frame corresponding to each recognized object image in the first target image and the position information of the detection frame can be determined respectively through the second target detection result.

[0061] Step S152: determining a target output frame corresponding to the current frame image from multiple detection frames based on the position information of each detection frame and the first position information.

[0062] According to the position information of each detection frame, the distribution position of the corresponding object image in the target frame image can be determined, and then combined with the first position information, multiple detection frames corresponding to the first target image are targeted for screening, and the target output frame corresponding to the current frame image is determined among the multiple detection frames, which can effectively reduce the occurrence of false detection or missed detection, thereby improving the accuracy of target detection.

[0063] Step S153, output the target output frame.

[0064] By outputting the target output frame, it helps relevant personnel to clearly identify the object corresponding to the current frame image, so as to perform targeted processing on the object corresponding to the target output frame in the future to meet relevant task requirements. For example, the object corresponding to the target output frame can be tracked, identified or monitored.

[0065] According to the above method, by combining the position information of multiple detection frames corresponding to the first target image with the first position information of the previous frame, the target detection frame corresponding to the current frame image is determined, which helps to improve the robustness and accuracy of target detection.

[0066] Moreover, in dynamic scenes, determining the target detection frame corresponding to the current frame image in this way can also effectively track objects and reduce detection errors caused by scene changes, thereby helping to improve the reliability and accuracy of target detection.

[0067] In some other embodiments, the above step S152 may include the following steps:

[0068] Step a1, determining a first target position in a first target image;

[0069] Step a2, determining the category of each detection frame according to the position information of each detection frame, the first target position and the first position information according to the classification strategy;

[0070] Step a3: Based on the category of each detection frame, determine the target output frame corresponding to the current frame image.

[0071] Specifically, in order to better distinguish whether the detection frame is detected for the first time, the first target position is first determined according to the first target image. The first target position can be understood as a position in the first partial image that is a first distance away from the top edge of the current frame image. Figure 3 As shown, if the top edge position of the current frame image is start_y, the first target position is a position that is a first distance h from start_y and belongs to the first partial image.

[0072] Since the first distance is the minimum distance for determining whether the information of the detection frame is complete, the position type of each detection frame can be classified according to the position information of the detection frame, the first target position and the first position information, and then according to the category corresponding to each detection frame, it is determined whether each detection frame is a repeated detection frame and whether the information of the detection frame is complete.

[0073] Among them, the classification strategies include: the first classification strategy: the detection frame whose position information overlaps with the first target position is taken as the first category, and the detection frame of the first category includes the detection frame overlapping with the first position information; the second classification strategy: the detection frame whose position information is between the first target position and the second target position is taken as the second category, and the second target position is the position in the current frame image whose distance from the bottom edge position of the current frame image is the first distance; the third classification strategy: the detection frame whose position information is between the top edge position of the first partial image and the top edge position of the current frame image is taken as the third category. For example, the detection frame that meets the first category can be Figure 3 The detection box with a filled color in the second category can be Figure 4 The detection box with a filled color in the ; the detection box that meets the third category can be Figure 5 The detection box has a filled color. Figure 3-5 In the example, the first target position is a position that is a first distance h from start_y and belongs to the first partial image, and the second target position is a position that is a first distance h from the bottom edge position end_y of the current frame image and belongs to the current frame image. It should be noted that Figure 3-5 The positions of the detection boxes are only used as examples, and the specific positions of the detection boxes depend on the actual second target detection results.

[0074] In some application scenarios, such as Figure 6 As shown, for ease of description, the top edge position of the current frame image can be determined as start_y, the bottom edge position of the current frame image can be determined as end_y, the top edge position is higher than the bottom edge position, but the value of end_y is greater than the value of start_y, and the first distance is h. When dividing the detection frame according to the first classification strategy, the detection frame whose top edge position is higher than or equal to the first target position, whose bottom edge position is lower than or equal to the first target position, and whose bottom edge position is less than or equal to end_y can be divided into the first category. When dividing the detection frame according to the second classification strategy, the detection frame whose top edge position is lower than or equal to the first target position, and whose bottom edge position is higher than or equal to the second target position can be divided into the second category. When dividing the detection frame according to the third classification strategy, the detection frame whose bottom edge position is lower than or equal to start_y can be divided into the third category.

[0075] The results of the classification according to each classification strategy show that:

[0076] There is a detection frame in the first category that overlaps with the first position information of the first detection frame. Therefore, the detection frame of this category may be obtained based on cross-frame detection or may be obtained by detecting the first partial image.

[0077] The second category of detection frames is obtained by performing target detection on the current frame image. This type of detection frame is not obtained by repeatedly detecting the same object image and the information of this type of detection frame is complete;

[0078] The detection frame of the third category is obtained by performing target detection on the previous frame image. There is a situation where the same object image is detected repeatedly, but the information of this type of detection frame may be incomplete.

[0079] After clarifying the categories corresponding to each detection frame, targeted screening can be performed according to the categories of each detection frame, so as to determine the target output frame corresponding to the current frame image, so as to ensure the reliability and accuracy of the determination of the target output frame.

[0080] In some examples, the above step a2 may determine the target output box in any one or a combination of the following ways:

[0081] Method 1: The detection frame that is the union of the first and second categories but the difference of the third category is used as the target output frame corresponding to the current frame image. Since the detection frame of the third category is obtained by performing target detection on the previous frame image, but there may be detection frames in the first category or the second category whose position information overlaps with the detection frame of the third category, in order to avoid repeated output of the detection frames of the same object image, the detection frames in the first category that overlap with the position information of the third category and the detection frames in the second category that overlap with the position information of the third category are excluded, and the detection frame that is the union of the first and second categories but the difference of the third category is used as the target output frame corresponding to the current frame image to ensure the reliability and accuracy of the determination of the target output frame.

[0082] Method 2: Determine a third detection frame among multiple detection frames that intersects the first category and the third category; determine the region area of ​​the third detection frame based on the position information of the third detection frame; determine the reference detection frame used for deduplication detection in the previous frame image and the third position information of the reference detection frame based on the position information of the fourth detection frame in the previous frame image; determine the intersection area between the third detection frame and the reference detection frame based on the position information of the third detection frame and the third position information; and if the ratio between the intersection area and the region area is less than a specified threshold, use the third detection frame as the target output frame corresponding to the current frame image.

[0083] Specifically, since the target detection algorithm may generate different detection frames when performing multiple target detections on the same object image due to detection accuracy issues during the actual execution of the target detection process, for example, there may be differences in the size or position of the detection frame. The first category of detection frames is a detection frame whose position information overlaps with the first target position, and the third category of detection frames is a detection frame whose position information is between the top edge position of the first local image and the top edge position of the current frame image. If the same detection frame belongs to both the first category and the third category, it can be considered that part or all of the object image corresponding to the detection frame belongs to the previous frame image. Therefore, in order to avoid repeatedly outputting the detection frame corresponding to the same object, the detection frame that belongs to both the first category and the third category among multiple detection frames is first used as the third detection frame, and the area of ​​the third detection frame is determined based on the position information of the third detection frame.

[0084] Determine the position information of the fourth detection frame in the previous frame image. The fourth detection frame can be understood as a detection frame whose position information overlaps with the position of the top edge of the first local image in the previous frame image, and the position information of each detection frame in the previous frame image is determined based on the first target detection result. The object image corresponding to the fourth detection frame can be considered as the object image that has been identified in the previous frame image. Since the first local image is extracted from the previous frame image, the first local image includes part or all of the fourth detection frame. Therefore, the fourth detection frame whose position information overlaps with the position of the first local image in the previous frame image is used as a reference detection frame for deduplication detection, and the third position information of the reference detection frame is determined.

[0085] In order to determine whether the object image corresponding to the third detection frame and the object image corresponding to the reference detection frame are the same object image, the judgment can be made by the intersection over union (IOU) method. That is, according to the position information of the third detection frame and the third position information of the reference detection frame, the intersection area between the third detection frame and the reference detection frame is determined. If the ratio between the intersection area and the area of ​​the region is less than the specified threshold, the image area representing the intersection between the third detection frame and the reference detection frame accounts for a small proportion of the area of ​​the third detection frame, and it can be determined that the object image corresponding to the third detection frame and the object image corresponding to the reference detection frame are not the same object image. Therefore, it can be determined that the object image corresponding to the third detection frame has not been repeatedly detected, so the third detection frame can be used as the target output frame corresponding to the current frame image. Among them, the specified threshold can be understood as the minimum ratio within the allowable error range for considering that the two object images are the same object image.

[0086] In some other examples, the above step a2 may also use any one or a combination of the following methods to determine the non-target output box:

[0087] Method 1: If the distance between the bottom edge position of the detection frame and the bottom edge position of the current frame image is less than the first distance, the detection frame is used as a non-target output frame corresponding to the current frame image. Since the first distance is the minimum distance used to determine whether the information of the detection frame is complete, if the distance between the bottom edge position of the detection frame and the bottom edge position of the current frame image is less than the first distance, the information representing the detection frame may be incomplete. Therefore, in order to ensure the reliability of target detection, the detection frame is used as a non-target output frame corresponding to the current frame image to avoid misidentification, thereby ensuring the accuracy of the target output frame.

[0088] Method 2: If the ratio between the intersection area and the regional area is greater than or equal to the specified threshold, the third detection frame is used as the non-target output frame corresponding to the current frame image. If the ratio between the intersection area and the regional area is greater than or equal to the specified threshold, the image region area representing the intersection between the third detection frame and the reference detection frame accounts for a large proportion of the regional area of ​​the third detection frame, and it can be considered that the object image corresponding to the third detection frame and the object image corresponding to the reference detection frame are the same object image. Since the object image corresponding to the reference detection frame is an object image that has been identified and marked, in order to avoid the detection frame of the same object image being output repeatedly, the third detection frame can be used as the non-target output frame corresponding to the current frame image to avoid affecting the output result of the target output frame corresponding to the current frame image, thereby helping to reduce the need for manual intervention to reduce the weight, improve the reliability of target detection, and help reduce the occurrence of false alarms triggered by repeated detection.

[0089] like Figure 7 As shown, the image detection method may include the following steps:

[0090] Step S110, obtaining the current frame image.

[0091] Step S120: if there is a previous frame image, obtain a first partial image extracted from the bottom of the previous frame image.

[0092] Step S130, splicing the first partial image on top of the current frame image to obtain a first target image.

[0093] Step S140, performing target detection on the first target image to obtain a second target detection result corresponding to the current frame image.

[0094] Step S150: determining and outputting a target output frame corresponding to the current frame image based on the second target detection result and the first position information.

[0095] Step S160: Based on the second position information of each second detection frame, determine the second distance between the top edge position of each second detection frame and the bottom edge position of the current frame image.

[0096] The second detection frame is a detection frame in which the distance between the bottom edge position of the detection frame and the bottom edge of the image of the current frame image is less than the first distance. The number of second detection frames is at least one. In order to ensure the information integrity of the object corresponding to the second detection frame, the second distance between the top edge position of each second detection frame and the bottom edge position of the current frame image is determined respectively according to the second position information of each second detection frame, so as to determine the maximum second distance therefrom.

[0097] Step S170: determining the image extraction height based on the maximum second distance.

[0098] According to the maximum second distance, it can be ensured that the top edge position of each second detection frame can be included, so based on the maximum second distance, the image extraction height is determined. The image extraction height refers to the position along the top edge direction of the current frame image upwards with the bottom edge position of the current frame image as the reference, and the distance is the image extraction height.

[0099] In some examples, the maximum second distance may be directly used as the maximum second distance, thereby helping to improve the efficiency of determining the image extraction height.

[0100] In other examples, different target detection algorithms have different tolerance pixel sizes when marking detection frames. The tolerance pixel size includes tolerance pixel width and tolerance pixel height. Therefore, when determining the maximum second distance, the image extraction height can be determined in combination with the tolerance pixel height corresponding to the current target detection algorithm. For example, the image extraction height can be the sum of the maximum second distance plus the tolerance pixel height corresponding to the current target detection algorithm. In some application scenarios, the tolerance pixel height can be 3 pixels or 5 pixels, which can be determined based on the actual target detection algorithm and requirements.

[0101] Step S180 , extracting a second partial image from the bottom of the current frame image based on a third target position corresponding to the image extraction height.

[0102] According to the image extraction height, a third target position in the current frame image whose distance from the bottom edge of the current frame image is the image extraction height is determined, and the current frame image is intercepted according to the third target position, thereby obtaining a second local image extracted from the bottom of the current frame image.

[0103] Step S190, saving the second partial image to be spliced ​​on top of the next frame image, and determining the target output frame corresponding to the next frame image.

[0104] The second partial image is saved so that the second partial image can be subsequently spliced ​​on top of the next frame image, and cross-frame detection is performed using the position information of the second detection frame corresponding to the second partial image to determine the target output frame corresponding to the next frame image.

[0105] According to the image detection method provided by the present invention, the height of the local image to be extracted can be dynamically adjusted based on the distance between the bottom edge position of each detection box in each frame image and the bottom edge position of the corresponding frame image, so that the image detection method can be adapted to application scenarios for target detection of multiple objects, thereby not only improving the reliability of image stitching, but also helping to ensure the accuracy of cross-frame target detection, thereby helping to enhance the reliability and versatility of target detection and adapting to the needs of multiple target detection.

[0106] In some other embodiments, the classification strategy further includes a fourth classification strategy: the detection box whose position information overlaps with the third target position is regarded as the fourth category. For example, the detection box that meets the fourth category can be Figure 8 The detection box with fill color in the image. Note that Figure 8 The positions of the detection frames are only used as examples. The specific positions of the detection frames depend on the actual second target detection results. Figure 6 , the image extraction height between the third target position and the current frame image is H, and then when the detection frame is divided according to the fourth classification strategy, the detection frame whose position information overlaps with H can be divided into the fourth category, and then the detection frame of the four categories can be used to assist the next frame image in determining whether there is a repeated detection of the same object image, so as to ensure the reliability and accuracy of the target detection of the next frame image. Therefore, the image detection method can also include: saving the position information corresponding to the detection frame of the fourth category, so as to determine the non-target output frame corresponding to the next frame image, so as to ensure that the task of target detection for multiple frames of images can be carried out in an orderly manner.

[0107] In some embodiments, Fig. 9 As shown, the above step S130 may include the following steps:

[0108] Step S131 , splicing the first partial image on top of the current frame image to obtain a spliced ​​image.

[0109] Step S132, determining the image height of the first partial image.

[0110] Step S133, determining a first stitching height of the stitched image according to the image height of the first partial image and the image height of the current frame image.

[0111] Since the image height of the first partial image is determined based on the distance between the top edge position of the first detection frame and the bottom edge position of the previous frame image, and the height of the first partial image corresponding to each frame image is different, therefore, in order to determine the overall image height of the stitched image, the first stitching height of the stitched image is determined according to the image height of the first partial image and the image height of the current frame image.

[0112] Step S134, determining a second stitching height of the previous frame image corresponding to the first target image.

[0113] The previous frame image corresponds to the first target image, which is an image spliced ​​from the local image extracted from the bottom of the previous frame image of the previous frame image and the previous frame image. Since the extractable local image corresponding to each frame image is determined based on the corresponding target detection result, the height of the local image corresponding to each frame image may be different. In order to improve the accuracy of target detection for the current frame image, the second splicing height of the previous frame image corresponding to the first target image is determined.

[0114] Step S135, if the second stitching height is greater than the first stitching height, then according to the height difference between the second stitching height and the first stitching height, clear the top of the previous frame image corresponding to the first target image and the area image corresponding to the height difference to obtain an intermediate image.

[0115] If the second stitching height is greater than the first stitching height, it indicates that if the stitching image is directly placed on the first target image corresponding to the previous frame image for target detection, the higher part of the regional image will affect the accuracy of the second target detection result of the target detection of the stitching image. For example, misidentification occurs. Therefore, according to the height difference between the second stitching height and the first stitching height, the regional image corresponding to the top of the first target image corresponding to the previous frame image and the height difference is cleared to eliminate the interference of the regional image on the image detection method of the stitching image, thereby obtaining an intermediate image.

[0116] In some examples, if the second stitching height is less than or equal to the first stitching height, the stitching image may be directly overlaid on the first target image corresponding to the previous frame image.

[0117] Step S136, overlaying the stitched image on the intermediate image to obtain a first target image.

[0118] Overlaying the stitched image on the intermediate image can ensure that the image sizes processed are the same when performing target detection on each frame of the image, and thus the efficiency of target detection can be effectively improved when target detection is subsequently performed based on the obtained first target image.

[0119] By obtaining the first target image in the above manner, it is possible to avoid interference of the first target image corresponding to the previous frame image with target detection of the current frame image, thereby helping to ensure the accuracy and efficiency of target detection.

[0120] In some optional application scenarios, in order to improve the efficiency of image acquisition, and when performing target detection on each frame of image, the sizes of the corresponding spliced ​​target images (including the first target image and the second target image) can be the same, then create the following Fig.10 The background image shown. The background color of the background image is white, which is helpful for subsequent image processing and visualization, and is convenient for distinguishing the detection frame and the target. The background image can be a square image with the same height and width. For example, the background image can have the same height and width as the width of the image frame, which is convenient for mapping and cross-frame detection when performing subsequent target detection.

[0121] In some other optional application scenarios, combined with Fig.10 The background image shown in FIG. 1 and the first target image obtained after stitching can be shown as Fig.11 shown.

[0122] The present disclosure also provides another image detection method. Fig.12 As shown, the image detection method may include the following steps:

[0123] Step S110, obtaining the current frame image.

[0124] Step S120: if there is a previous frame image, obtain a first partial image extracted from the bottom of the previous frame image.

[0125] Step S130, splicing the first partial image on top of the current frame image to obtain a first target image.

[0126] Step S140, performing target detection on the first target image to obtain a second target detection result corresponding to the current frame image.

[0127] Step S150: determining and outputting a target output frame corresponding to the current frame image based on the second target detection result and the first position information.

[0128] Step S1100: If there is no previous frame image, target detection is performed on the current frame image to obtain a third target detection result corresponding to the current frame image.

[0129] If there is no previous frame image, the current frame image is characterized as the first frame image. In order to ensure the information integrity of the detection frame of the object image at the top of the first frame image, target detection is performed on the current frame image to identify the object image included in the current frame image, and the corresponding detection frame is marked for the identified object image, thereby obtaining the third target detection result corresponding to the current frame image.

[0130] Step S1110: Based on the third target detection result, determine and output the target output frame corresponding to the current frame image.

[0131] According to the third target detection result, the detection frame corresponding to the object image recognized in the current frame image can be clarified, so that based on the position of each detection frame, the target output frame corresponding to the current frame image can be determined and output to ensure the accuracy of target detection.

[0132] According to the image detection method provided by the present disclosure, the use of detection information between consecutive frames can be fully considered, thereby effectively ensuring the information integrity of objects during cross-frame detection, thereby not only ensuring the continuity of target detection, but also helping to ensure the accuracy of target detection. Therefore, applying the image detection method provided by the present disclosure in dynamic scenes can fully capture the features of each object, avoid the loss of information caused by switching between frames, and make the target detection process more reliable.

[0133] In some examples, the above step S1110 may include the following steps:

[0134] Step b1, determining a plurality of detection frames corresponding to the current frame image and position information of each detection frame according to the third target detection result;

[0135] Step b2: according to the position information of each detection frame, the detection frame belonging to the fifth category is used as the target output frame corresponding to the current frame image.

[0136] Since the current frame image is the first frame image, the multiple detection frames obtained by performing target detection on the frame image are all obtained by the first detection. Since the distance between the second target position and the bottom edge position of the current frame image is the first distance, in order to ensure the information integrity and accuracy of the detection frame, the detection frame belonging to the fifth category is screened from the multiple detection frames, and the detection frame of the fifth category is used as the target output frame corresponding to the current frame image to ensure the reliability of the determination of the target output frame. Among them, the detection frame of the fifth category is a detection frame whose position information is between the top edge position of the current frame image and the second target position, and the second target position is a position in the current frame image whose distance from the bottom edge position of the current frame image is the first distance.

[0137] In some application scenarios, if the numerical value corresponding to the first distance is smaller than the image height value of the actual object image, the detection frame of the third category can be considered as misidentified noise. In order to improve the accuracy of the target output frame, the detection frame that is the union of the first category and the second category but the difference from the third category can be used as the target output frame corresponding to the current frame image to improve the reliability of determining the target output frame.

[0138] In some optional application scenarios, the process of performing target detection by the image detection method provided by the present disclosure may be as follows:

[0139] Create a background image with the same width and height as the frame image. The width of the frame image is greater than the height of the frame image. For example, if the frame image height is a and the frame image width is 8a, the size of the background image is 8a. 8a.

[0140] For the first frame image: obtain the current frame image, and overlay the current frame image on the background image, so that the bottom of the current frame image is flush with the bottom of the background image, and obtain the second target image. Based on the currently used target detection algorithm, perform image scaling processing on the second target image so that the size of the processed second target image can meet the requirements of the corresponding processing model of the target detection algorithm, thereby helping to improve the accuracy of target detection.

[0141] Perform target detection on the second target image to obtain a third target detection result corresponding to the current frame image, and determine multiple detection frames corresponding to the second target image and position information of each detection frame according to the third target detection result.

[0142] Based on the position information of each detection frame, the detection frame belonging to the fifth category is used as the target output frame corresponding to the current frame image and is output. In some examples, since the image height of the second target image is greater than the image height of the current frame image, the detection frame belonging to the third category can also be used as the target output frame and output according to the position information of each detection frame to ensure the output integrity of the target output frame.

[0143] According to the third target detection result, determine a second detection frame whose distance between the bottom edge position of the detection frame and the bottom edge of the image of the current frame is less than the first distance. Based on the second position information of each second detection frame, determine the second distance between the top edge position of each second detection frame and the bottom edge position of the current frame image. Based on the maximum second distance, determine the image extraction height; based on the third target position corresponding to the image extraction height, extract the second partial image from the bottom of the current frame image; save the second partial image to be spliced ​​on the top of the next frame image, and determine the target output frame corresponding to the next frame image.

[0144] For the second frame image: The difference from the first frame image processing is that the second partial image needs to be spliced ​​on top of the second frame image, and the splicing result is overlaid on the first target image corresponding to the first frame image, thereby obtaining the first target image corresponding to the second frame image. In addition, when determining the target output frame corresponding to the second frame image, it is necessary to combine the position information of the second detection frame in the second partial image (wherein the first frame image can be considered as the previous frame image of the second frame image, the second partial image is the first partial image extracted from the bottom of the previous frame image, the second detection frame can be considered to be determined based on the first target detection result of the previous frame image, and the position information of the second detection frame can be considered to be the first position information of the first detection frame) and the target detection result of the first target image corresponding to the second frame image to jointly determine, so as to ensure the information integrity of the object during cross-frame detection.

[0145] For the middle frame image and the last frame image: the difference from the second frame image processing is that the first stitching height of the stitched image obtained by stitching the current frame image with the first partial image of the previous frame image needs to be compared with the second stitching height of the first target image corresponding to the previous frame image. If the second stitching height is greater than the first stitching height, then according to the height difference between the second stitching height and the first stitching height, the top of the first target image corresponding to the previous frame image and the regional image corresponding to the height difference are cleared to obtain the middle image; and the stitched image is overlaid on the middle image to obtain the first target image corresponding to the current frame image, so as to avoid the occurrence of false detection and ensure the reliability of target detection of continuous frame images. If the second stitching height is less than or equal to the first stitching height, the stitched image can be directly overlaid on the first target image corresponding to the previous frame image.

[0146] In other optional application scenarios, the image detection method provided by the present disclosure can be applied to ore sorting equipment. For example, in the process of transmitting ore by the transmission mechanism, the image detection method provided by the present disclosure can be used to perform target detection on the image collected by the currently transmitted ore, so as to determine the position of the ore according to the target output frame corresponding to each frame of the image, thereby helping to improve the accuracy of determining the position of the ore, so that when the ore is subsequently sorted, the sorting efficiency can be improved and the performance of the ore sorting equipment can be guaranteed.

[0147] Based on the same inventive concept, the present disclosure also provides an image detection device. Fig.13 As shown, the image detection device 200 includes:

[0148] A first acquisition module 210, used to acquire a current frame image;

[0149] A second acquisition module 220 is configured to acquire a first partial image extracted from the bottom of the previous frame image if there is a previous frame image, wherein the first partial image is obtained based on a first target detection result corresponding to the previous frame image, the first target detection result includes a first detection frame corresponding to the first partial image and first position information of the first detection frame, the distance between the bottom edge position of the first detection frame and the bottom edge position of the previous frame image is less than the first distance, and the first partial image includes a top edge of the first detection frame;

[0150] A stitching module 230 is used to stitch the first partial image on top of the current frame image to obtain a first target image;

[0151] The first detection module 240 is used to perform target detection on the first target image to obtain a second target detection result corresponding to the current frame image;

[0152] The first processing module 250 is used to determine and output a target output frame corresponding to the current frame image based on the second target detection result and the first position information.

[0153] In some embodiments, the first processing module 250 includes: a first determination unit, used to determine multiple detection frames corresponding to the first target image and the position information of each detection frame according to the second target detection result; a first screening unit, used to determine the target output frame corresponding to the current frame image from the multiple detection frames based on the position information of each detection frame and the first position information; and an output unit, used to output the target output frame.

[0154] In some embodiments, the first screening unit includes: a position determination unit, which is used to determine a first target position in a first target image, where the first target position is a position in the first partial image that is a first distance away from the top edge position of the current frame image; a classification unit, which is used to determine the category of each detection frame according to the position information, the first target position and the first position information of each detection frame according to the classification strategy; a screening subunit, which is used to determine the target output frame corresponding to the current frame image based on the category of each detection frame; wherein the classification strategy includes: a first classification strategy: taking the detection frame whose position information overlaps with the first target position as the first category, and the detection frame of the first category includes the detection frame overlapping with the first position information; a second classification strategy: taking the detection frame whose position information is between the first target position and the second target position as the second category, and the second target position is a position in the current frame image that is a first distance away from the bottom edge position of the current frame image; a third classification strategy: taking the detection frame whose position information is between the top edge position of the first partial image and the top edge position of the current frame image as the third category.

[0155] In some embodiments, the screening sub-unit includes: a first execution unit, which is used to use the detection frame that is a union of the first category and the second category but a difference from the third category as a target output frame corresponding to the current frame image; and / or a second execution unit, which is used to determine a third detection frame that intersects the first category and the third category among multiple detection frames; a third execution unit, which is used to determine the region area of ​​the third detection frame according to the position information of the third detection frame; a fourth execution unit, which is used to determine the intersection area between the third detection frame and the reference detection frame according to the position information of the third detection frame and the third position information; a fifth execution unit, which is used to determine the reference detection frame used for deduplication detection in the previous frame image and the third position information of the reference detection frame based on the position information of the fourth detection frame in the previous frame image, the fourth detection frame being a detection frame whose position information overlaps with the position of the top edge of the first partial image in the previous frame image; and a sixth execution unit, which is used to use the third detection frame as the target output frame corresponding to the current frame image if the ratio between the intersection area and the region area is less than a specified threshold.

[0156] In some embodiments, the screening sub-unit also includes: a seventh execution unit, which is used to use the detection frame as a non-target output frame corresponding to the current frame image if the distance between the bottom edge position of the detection frame and the bottom edge position of the current frame image is less than a first distance; and / or an eighth execution unit, which is used to use the third detection frame as a non-target output frame corresponding to the current frame image if the ratio between the intersection area and the region area is greater than or equal to a specified threshold.

[0157] In some embodiments, the image detection device 200 also includes: a second processing module, which is used to determine the second distance between the top edge position of each second detection frame and the bottom edge position of the current frame image based on the second position information of each second detection frame, and the second detection frame is a detection frame in which the distance between the bottom edge position of the detection frame and the bottom edge of the image of the current frame image is less than the first distance; a third processing module, which is used to determine the image extraction height based on the maximum second distance; an extraction module, which is used to extract the second local image from the bottom of the current frame image based on the third target position corresponding to the image extraction height; and a saving module, which is used to save the second local image for splicing at the top of the next frame image to determine the target output frame corresponding to the next frame image.

[0158] In some embodiments, the classification strategy also includes a fourth classification strategy: the detection box whose position information overlaps with the third target position is regarded as a fourth category; the image detection device 200 also includes: a saving module, used to save the position information corresponding to the detection box of the fourth category, so as to determine the non-target output box corresponding to the next frame image.

[0159] In some embodiments, the stitching module includes: a first processing unit, used to stitch the first partial image on the top of the current frame image to obtain a stitched image; a second determination unit, used to determine the image height of the first partial image; a third determination unit, used to determine the first stitching height of the stitched image based on the image height of the first partial image and the image height of the current frame image; a fourth determination unit, used to determine the second stitching height of the previous frame image corresponding to the first target image; the second processing unit, used to clear the top of the previous frame image corresponding to the first target image and the area image corresponding to the height difference between the second stitching height and the first stitching height if the second stitching height is greater than the first stitching height, to obtain an intermediate image; the third processing unit, used to overlay the stitched image on the intermediate image to obtain the first target image.

[0160] In some embodiments, the image detection device 200 also includes: a second detection module, which is used to perform target detection on the current frame image if there is no previous frame image, and obtain a third target detection result corresponding to the current frame image; and a fourth processing module, which is used to determine and output a target output box corresponding to the current frame image based on the third target detection result.

[0161] In some embodiments, the fourth processing module includes: a fifth determination unit, used to determine, according to the third target detection result, multiple detection frames corresponding to the current frame image and the position information of each detection frame; a second screening unit, used to take the detection frame belonging to the fifth category as the target output frame corresponding to the current frame image according to the position information of each detection frame; wherein the detection frame of the fifth category is a detection frame whose position information is between the top edge position of the current frame image and the second target position, and the second target position is a position in the current frame image that is a first distance away from the bottom edge position of the current frame image.

[0162] Regarding the image detection device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0163] Based on the same inventive concept, Fig.14As shown, one embodiment of the present disclosure provides an electronic device 300. The electronic device includes: one or more processors 310, a memory 320, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig.14 A processor 310 is taken as an example.

[0164] The processor 310 may be a central processing unit, a network processor or a combination thereof. The processor 310 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0165] The memory 320 stores instructions executable by at least one processor 310, so that at least one processor 310 executes the image detection method shown in the above embodiment.

[0166] The memory 320 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 320 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 320 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0167] The memory 320 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 320 may also include a combination of the above types of memory.

[0168] The electronic device also includes an input device 330 and an output device 340. The processor 310, the memory 320, the input device 330 and the output device 340 may be connected via a bus or other means. Fig.13 The example of connecting through bus is taken in the following.

[0169] The input device 330 can receive input digital or character information and generate key signal input related to the user settings and function control of the electronic device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 340 may include a display device, an auxiliary lighting device (e.g., an LED), and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display, and a plasma display. In some optional embodiments, the display device may be a touch screen.

[0170] Based on the same inventive concept, the present disclosure further provides a computer-readable storage medium, which stores the following program, and the program is used to execute the image detection method of any of the aforementioned embodiments.

[0171] The present disclosure uses specific words to describe the embodiments of the present disclosure. For example, "one embodiment", "an embodiment", and / or "some embodiments" refer to a certain feature, structure or characteristic related to at least one embodiment of the present disclosure. Therefore, it should be emphasized and noted that "one embodiment" or "an embodiment" or "an alternative embodiment" mentioned twice or more in different locations in this specification does not necessarily refer to the same embodiment. In addition, certain features, structures or characteristics in one or more embodiments of the present disclosure may be appropriately combined.

[0172] In the context of the present disclosure, unless the context clearly indicates an exception, the words "a", "an", "a kind" and / or "the" do not refer to the singular, but may also include the plural. Generally speaking, the terms "include" and "comprise" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list, and the method or device may also include other steps or elements.

[0173] Similarly, it should be noted that in order to simplify the description of the disclosure and thus help understand one or more application embodiments, in the above description of the embodiments of the disclosure, multiple features are sometimes combined into one embodiment, figure or description thereof. However, this disclosure method does not mean that the features required by the object of the disclosure are more than the features required for protection. In fact, the features of the embodiment are less than all the features of the single embodiment disclosed above.

[0174] The basic concepts have been described above. Obviously, for those skilled in the art, the above disclosure is only an example and does not constitute a limitation of the present disclosure. Although not explicitly stated herein, those skilled in the art may make various modifications, improvements and corrections to the present disclosure. Such modifications, improvements and corrections are suggested in the present disclosure, so such modifications, improvements and corrections still belong to the spirit and scope of the embodiments of the present disclosure.

Claims

1. An image detection method, characterized in that: The method comprises: Get the current frame image; If there is a previous frame image, obtain a first partial image extracted from the bottom of the previous frame image, wherein the first partial image is obtained based on a first target detection result corresponding to the previous frame image, the first target detection result includes a first detection frame corresponding to the first partial image and first position information of the first detection frame, the distance between the bottom edge position of the first detection frame and the bottom edge position of the previous frame image is less than a first distance, and the first partial image includes a top edge of the first detection frame; splicing the first partial image on top of the current frame image to obtain a first target image; Performing target detection on the first target image to obtain a second target detection result corresponding to the current frame image; Based on the second target detection result and the first position information, a target output frame corresponding to the current frame image is determined and output.

2. The image detection method according to claim 1, characterized in that: The determining and outputting a target output frame corresponding to the current frame image based on the second target detection result and the first position information includes: Determine, according to the second target detection result, a plurality of detection frames corresponding to the first target image and position information of each detection frame; Based on the position information of each of the detection frames and the first position information, determining a target output frame corresponding to the current frame image from the plurality of detection frames; The target output frame is output.

3. The image detection method according to claim 2, characterized in that: The determining, based on the position information of each of the detection frames and the first position information, a target output frame corresponding to the current frame image from the plurality of detection frames comprises: Determine a first target position in the first target image, where the first target position is a position in the first partial image that is the first distance away from a top edge position of the current frame image; Determining the category of each detection frame according to the position information of each detection frame, the first target position, and the first position information according to a classification strategy; Based on the category of each of the detection frames, determining a target output frame corresponding to the current frame image; The classification strategy includes: A first classification strategy: taking the detection frame whose position information overlaps with the first target position as a first category, wherein the detection frame of the first category includes the detection frame overlapping with the first position information; A second classification strategy: taking the detection frame whose position information is between the first target position and the second target position as a second category, wherein the second target position is a position in the current frame image whose distance from the bottom edge position of the current frame image is the first distance; The third classification strategy: the detection box whose position information is between the top edge position of the first local image and the top edge position of the current frame image is taken as the third category.

4. The image detection method according to claim 3, characterized in that: The step of determining a target output frame corresponding to the current frame image based on the category of each detection frame includes: Using the detection frame that is a union of the first category and the second category but a difference from the third category as a target output frame corresponding to the current frame image; and / or Determine a third detection frame among the plurality of detection frames that intersects the first category and the third category; Determining the area of ​​the third detection frame according to the position information of the third detection frame; Based on the position information of the fourth detection frame in the previous frame image, determine a reference detection frame for deduplication detection in the previous frame image and third position information of the reference detection frame, the fourth detection frame being a detection frame whose position information overlaps with the position of the top edge of the first partial image in the previous frame image; Determining an intersection area between the third detection frame and the reference detection frame according to the position information of the third detection frame and the third position information; and If the ratio of the intersection area to the region area is less than a specified threshold, the third detection frame is used as a target output frame corresponding to the current frame image.

5. The image detection method according to claim 4, characterized in that: The step of determining a target output frame corresponding to the current frame image based on the category of each of the detection frames further includes: If the distance between the bottom edge position of the detection frame and the bottom edge position of the current frame image is less than the first distance, the detection frame is used as a non-target output frame corresponding to the current frame image; and / or If the ratio of the intersection area to the region area is greater than or equal to the specified threshold, the third detection frame is used as a non-target output frame corresponding to the current frame image.

6. The image detection method according to claim 5, characterized in that: The method further comprises: Based on the second position information of each second detection frame, respectively determine a second distance between the top edge position of each second detection frame and the bottom edge position of the current frame image, the second detection frame being the detection frame whose distance between the bottom edge position of the detection frame and the image bottom edge of the current frame image is less than the first distance; Determining an image extraction height based on the largest of the second distances; Extracting a second partial image from the bottom of the current frame image based on a third target position corresponding to the image extraction height; The second partial image is saved to be spliced ​​on top of a next frame image, and a target output frame corresponding to the next frame image is determined.

7. The image detection method according to claim 6, characterized in that: The classification strategy also includes a fourth classification strategy: taking the detection frame whose position information overlaps with the third target position as a fourth category; The method further comprises: The position information corresponding to the detection frame of the fourth category is saved to determine the non-target output frame corresponding to the next frame image.

8. The image detection method according to claim 1, characterized in that: The step of splicing the first partial image on top of the current frame image to obtain a first target image includes: splicing the first partial image on top of the current frame image to obtain a spliced ​​image; determining an image height of the first partial image; Determining a first stitching height of the stitched image according to an image height of the first partial image and an image height of the current frame image; Determine a second stitching height of the previous frame image corresponding to the first target image; If the second stitching height is greater than the first stitching height, according to the height difference between the second stitching height and the first stitching height, clear the top of the first target image corresponding to the previous frame image and the area image corresponding to the height difference to obtain an intermediate image; The stitched image is overlaid on the intermediate image to obtain the first target image.

9. The image detection method according to claim 1, characterized in that: The method further comprises: If the previous frame image does not exist, performing target detection on the current frame image to obtain a third target detection result corresponding to the current frame image; Based on the third target detection result, a target output frame corresponding to the current frame image is determined and output.

10. The image detection method according to claim 9, characterized in that: The determining and outputting a target output frame corresponding to the current frame image based on the third target detection result includes: According to the third target detection result, respectively determine a plurality of detection frames corresponding to the current frame image and position information of each detection frame; According to the position information of each detection frame, taking the detection frame belonging to the fifth category as the target output frame corresponding to the current frame image; Among them, the detection box of the fifth category is a detection box whose position information is between the top edge position of the current frame image and the second target position, and the second target position is a position in the current frame image whose distance from the bottom edge position of the current frame image is the first distance.

11. An image detection device, characterized in that: The device comprises: A first acquisition module, used to acquire a current frame image; a second acquisition module, configured to acquire, if there is a previous frame image, a first partial image extracted from the bottom of the previous frame image, wherein the first partial image is obtained based on a first target detection result corresponding to the previous frame image, the first target detection result includes a first detection frame corresponding to the first partial image and first position information of the first detection frame, the distance between the bottom edge position of the first detection frame and the bottom edge position of the previous frame image is less than a first distance, and the first partial image includes a top edge of the first detection frame; A splicing module, used for splicing the first partial image on top of the current frame image to obtain a first target image; A first detection module, configured to perform target detection on the first target image to obtain a second target detection result corresponding to the current frame image; The first processing module is used to determine and output a target output frame corresponding to the current frame image based on the second target detection result and the first position information.

12. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the image detection method according to any one of claims 1 to 10 by executing the computer instructions. 13 . A computer-readable storage medium storing the following program, wherein the program is used to execute the image detection method according to claim 1 .

Citation Information

Patent Citations

  • Traffic flow statistical method, device and equipment and storage medium

    CN115131725A

  • Generation method and device of instrument use data and storage medium

    CN118898753A

  • Target tracking method and device

    CN119722738A

  • Multi-target tracking method and apparatus, and electronic device, storage medium and program

    WO2023050678A1

Cited By

  • Multi-modal commodity information extraction method, system and device, medium and product

    CN120913214A