CN110717891A - Picture detection method and device based on grouping batch and storage medium - Google Patents

Picture detection method and device based on grouping batch and storage medium Download PDF

Info

Publication number
CN110717891A
CN110717891A CN201910875540.7A CN201910875540A CN110717891A CN 110717891 A CN110717891 A CN 110717891A CN 201910875540 A CN201910875540 A CN 201910875540A CN 110717891 A CN110717891 A CN 110717891A
Authority
CN
China
Prior art keywords
pictures
processed
picture
information
group
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910875540.7A
Other languages
Chinese (zh)
Inventor
郭玲玲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910875540.7A priority Critical patent/CN110717891A/en
Priority to PCT/CN2019/117891 priority patent/WO2021051580A1/en
Publication of CN110717891A publication Critical patent/CN110717891A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/172Classification, e.g. identification

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Quality & Reliability (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to an image processing technology, and provides a picture detection method, a device and a storage medium based on grouping batch, wherein the method is applied to an electronic device and comprises the following steps: grouping the pictures to be processed according to the length-width ratio information of the pictures to be processed to obtain a plurality of groups of pictures to be processed; acquiring corresponding preprocessing information according to each group of pictures to be processed, and respectively preprocessing each group of pictures to be processed based on the corresponding preprocessing information; and respectively inputting each group of preprocessed pictures into a preset detection module, and detecting the pictures through the detection module. The invention divides the pictures into a plurality of groups according to the length-width ratio, respectively adjusts each group to the pictures with preset sizes, fills zero in the insufficient positions, and then respectively processes each group of pictures, so that the part for filling or filling zero can be reduced, thereby leading the network of the biological detector to carry out less invalid calculation, reducing the carrying pressure of a computer, accelerating the calculation speed of the computer and increasing the working efficiency.

Description

Picture detection method and device based on grouping batch and storage medium
Technical Field
The invention relates to the technical field of image processing, in particular to a method and a device for detecting pictures based on grouping batches and a computer readable storage medium.
Background
Image recognition refers to a technology for processing, analyzing and understanding images by using a computer to recognize various different modes of objects and objects, and is an important field of artificial intelligence. In order to create a computer program that simulates human image recognition activities, different image recognition models have been proposed. For example, face recognition is a biometric technology for identification based on facial feature information of a person. A series of related technologies, also commonly called face recognition and face recognition, are used to collect images or video streams containing faces by using a camera or a video camera, automatically detect and track the faces in the images, and then perform face recognition on the detected faces.
With the development of science and technology, the application scenes of the face recognition system are more and more, and the face recognition technology is also developed. The existing face recognition system mainly comprises a face detection module, wherein the face detection module is accelerated in a batch processing mode, namely, a batch of pictures are read into a memory at one time and are put into a video memory, and a GPU (graphics processing Unit) is used for face detection. It can be known that if the aspect ratio difference of each picture is too large, for example, one picture is 1:2 and the other picture is 2:1, the complementary area is too much, and the complementary part has no face and is not required to be calculated originally, so that the network of the face detector performs too many invalid calculations, and the face detection efficiency is reduced.
Disclosure of Invention
The invention provides a picture detection method based on grouping batch, an electronic device and a computer readable storage medium, and mainly aims to reduce invalid calculation in an image detection process and improve detection efficiency and detection quality.
In order to achieve the above object, the present invention provides a picture detection method based on grouping batch, which is applied to an electronic device, and the method includes:
grouping the pictures to be processed according to the length-width ratio information of the pictures to be processed to obtain a plurality of groups of pictures to be processed;
acquiring corresponding preprocessing information according to each group of pictures to be processed, and respectively preprocessing each group of pictures to be processed based on the corresponding preprocessing information;
and respectively inputting each group of preprocessed pictures into a preset detection module, and detecting the pictures through the detection module.
In an embodiment, the step of obtaining corresponding preprocessing information according to each group of pictures to be processed and respectively preprocessing each group of pictures to be processed based on the corresponding preprocessing information includes:
setting template picture information respectively corresponding to each group of pictures to be processed, wherein the template picture information comprises width information and height information;
carrying out equal-scale amplification or reduction on all the pictures to be processed in the same group until the width of the pictures to be processed is not larger than the width information of the template picture and the height of the pictures to be processed is not larger than the height information of the template picture;
and taking the template picture as a frame, and carrying out feature configuration processing on the picture to be processed after the equal-scale amplification or reduction.
In one embodiment, after grouping the pictures to be processed and obtaining a plurality of groups of pictures to be processed, and before obtaining corresponding preprocessing information according to each group of pictures to be processed, the method further includes:
acquiring picture characteristics of a picture to be processed, wherein the picture characteristics are picture definition or contrast;
and regrouping the multiple groups of pictures to be processed according to the picture characteristics.
In one embodiment, the step of setting template picture information respectively corresponding to each group of pictures to be processed includes: reading the height and width information of all the pictures to be processed in the same group;
comparing the width information of each picture to be processed to obtain a maximum width value; meanwhile, comparing the height information of each picture to be processed to obtain a maximum height value;
and setting a template picture according to the maximum width value and the maximum height value, so that the height of the template picture is the maximum height value, and the width of the template picture is the maximum width value.
In one embodiment, the step of setting template picture information respectively corresponding to each group of pictures to be processed includes:
reading the height and width information of all the pictures to be processed in the same group;
acquiring an average width value and an average height value according to the height and width information of all the pictures to be processed in the same group;
and setting a template picture according to the average width value and the average height value, wherein the height of the template picture is the average height value, and the width is the average width value.
In one embodiment, the step of performing feature configuration processing on the to-be-processed image after being scaled up or down by using the template image as a frame includes:
placing the picture to be processed after the equal-scale enlargement or reduction in the frame;
and setting the RGB information of the part without the picture coverage in the frame as 0.
In one embodiment, the detection module includes one or more of a face detection module, a lip recognition module, a gesture recognition module, an emotion analysis module, or a pedestrian recognition model.
In addition, to achieve the above object, the present invention also provides an electronic device including: the picture detection program based on the grouping batch is executed by the processor to realize the following steps:
grouping the pictures to be processed according to the length-width ratio information of the pictures to be processed to obtain a plurality of groups of pictures to be processed;
acquiring corresponding preprocessing information according to each group of pictures to be processed, and respectively preprocessing each group of pictures to be processed based on the corresponding preprocessing information;
and respectively inputting each group of preprocessed pictures into a preset detection module, and detecting the pictures through the detection module.
In an embodiment, the step of obtaining corresponding preprocessing information according to each group of pictures to be processed and respectively preprocessing each group of pictures to be processed based on the corresponding preprocessing information includes:
setting template picture information respectively corresponding to each group of pictures to be processed, wherein the template picture information comprises width information and height information;
carrying out equal-scale amplification or reduction on all the pictures to be processed in the same group until the width of the pictures to be processed is not larger than the width information of the template picture and the height of the pictures to be processed is not larger than the height information of the template picture;
and taking the template picture as a frame, and carrying out feature configuration processing on the picture to be processed after the equal-scale amplification or reduction.
In addition, to achieve the above object, the present invention further provides a computer-readable storage medium, where the computer-readable storage medium includes a grouping batch-based picture detection program, and when the grouping batch-based picture detection program is executed by a processor, the grouping batch-based picture detection program implements any step in the grouping batch-based picture detection method as described above.
The image detection method based on grouping batch, the electronic device and the computer readable storage medium provided by the invention divide the image into a plurality of groups according to the length-width ratio, respectively adjust each group to the image with the preset size, fill zero at the insufficient part, and then respectively process each group of images, so that the part for filling or filling zero can be reduced, thereby leading the network of the image detector to carry out less invalid calculation, reducing the carrying pressure of the computer, accelerating the operation speed of the computer and increasing the working efficiency.
Drawings
FIG. 1 is a diagram illustrating an application environment of a packet batch-based image detection method according to a preferred embodiment of the present invention;
FIG. 2 is a block diagram of a preferred embodiment of the batch-based picture inspection process of FIG. 1;
FIG. 3 is a flowchart illustrating a method for detecting pictures based on grouping batches according to a preferred embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides a picture detection method based on grouping batch, which is applied to an electronic device 1. Fig. 1 is a schematic diagram of an application environment of a packet batch-based picture detection method according to a preferred embodiment of the present invention.
In the present embodiment, the electronic device 1 may be a terminal device having an arithmetic function, such as a server, a smart phone, a tablet computer, a portable computer, or a desktop computer.
The electronic device 1 includes: a processor 12, a memory 11, a network interface 14, and a communication bus 15.
The memory 11 includes at least one type of readable storage medium. The at least one type of readable storage medium may be a non-volatile storage medium such as a flash memory, a hard disk, a multimedia card, a card-type memory 11, and the like. In some embodiments, the readable storage medium may be an internal storage unit of the electronic apparatus 1, such as a hard disk of the electronic apparatus 1. In other embodiments, the readable storage medium may also be an external memory 11 of the electronic device 1, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device 1.
In the present embodiment, the readable storage medium of the memory 11 is generally used for storing the grouping batch-based picture inspection program 10 and the like installed in the electronic device 1. The memory 11 may also be used to temporarily store data that has been output or is to be output.
The processor 12 may be a Central Processing Unit (CPU), microprocessor or other data Processing chip in some embodiments, and is used for executing program codes stored in the memory 11 or Processing data, such as executing the packet batch-based picture inspection program 10.
The network interface 14 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), and is typically used to establish a communication link between the electronic apparatus 1 and other electronic devices.
The communication bus 15 is used to realize connection communication between these components.
Fig. 1 only shows the electronic device 1 with components 11-15, but it is to be understood that not all of the shown components are required to be implemented, and that more or fewer components may alternatively be implemented.
Optionally, the electronic device 1 may further include a user interface, the user interface may include an input unit such as a Keyboard (Keyboard), a voice input device such as a microphone (microphone) or other equipment with a voice recognition function, a voice output device such as a sound box, a headset, etc., and optionally the user interface may further include a standard wired interface, a wireless interface.
Optionally, the electronic device 1 may further comprise a display, which may also be referred to as a display screen or a display unit. In some embodiments, the display device may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an Organic Light-Emitting Diode (OLED) touch device, or the like. The display is used for displaying information processed in the electronic apparatus 1 and for displaying a visualized user interface.
Optionally, the electronic device 1 further comprises a touch sensor. The area provided by the touch sensor for the user to perform touch operation is called a touch area. Further, the touch sensor described herein may be a resistive touch sensor, a capacitive touch sensor, or the like. The touch sensor may include not only a contact type touch sensor but also a proximity type touch sensor. Further, the touch sensor may be a single sensor, or may be a plurality of sensors arranged in an array, for example.
The area of the display of the electronic device 1 may be the same as or different from the area of the touch sensor. Optionally, a display is stacked with the touch sensor to form a touch display screen. The device detects touch operation triggered by a user based on the touch display screen.
Optionally, the electronic device 1 may further include a Radio Frequency (RF) circuit, a sensor, an audio circuit, and the like, which are not described herein again.
In the apparatus embodiment shown in fig. 1, a memory 11, which is a kind of computer storage medium, may include therein an operating system, and a picture detection program 10 based on a grouping batch; the processor 12, when executing the packet batch based picture inspection program 10 stored in the memory 11, implements the following steps:
grouping the pictures to be processed according to the length-width ratio information of the pictures to be processed to obtain a plurality of groups of pictures to be processed;
acquiring corresponding preprocessing information according to each group of pictures to be processed, and respectively preprocessing each group of pictures to be processed based on the corresponding preprocessing information;
and respectively inputting each group of preprocessed pictures into a preset detection module, and detecting the pictures through the detection module.
In an embodiment, the step of obtaining corresponding preprocessing information according to each group of pictures to be processed and respectively preprocessing each group of pictures to be processed based on the corresponding preprocessing information includes:
setting template picture information respectively corresponding to each group of pictures to be processed, wherein the template picture information comprises width information and height information;
carrying out equal-scale amplification or reduction on all the pictures to be processed in the same group until the width of the pictures to be processed is not larger than the width information of the template picture and the height of the pictures to be processed is not larger than the height information of the template picture;
and taking the template picture as a frame, and carrying out feature configuration processing on the picture to be processed after the equal-scale amplification or reduction.
In one embodiment, after grouping the pictures to be processed and obtaining a plurality of groups of pictures to be processed, and before obtaining corresponding preprocessing information according to each group of pictures to be processed, the method further includes:
acquiring picture characteristics of a picture to be processed, wherein the picture characteristics are picture definition or contrast;
and regrouping the multiple groups of pictures to be processed according to the picture characteristics.
Then, according to each group of the images to be processed after the regrouping, corresponding template image information is set, as shown in the following.
In one embodiment, the step of setting template picture information respectively corresponding to each group of pictures to be processed includes: reading the height and width information of all the pictures to be processed in the same group;
comparing the width information of each picture to be processed to obtain a maximum width value; meanwhile, comparing the height information of each picture to be processed to obtain a maximum height value;
and setting a template picture according to the maximum width value and the maximum height value, so that the height of the template picture is the maximum height value, and the width of the template picture is the maximum width value.
In one embodiment, the step of setting template picture information respectively corresponding to each group of pictures to be processed includes:
reading the height and width information of all the pictures to be processed in the same group;
acquiring an average width value and an average height value according to the height and width information of all the pictures to be processed in the same group;
and setting a template picture according to the average width value and the average height value, wherein the height of the template picture is the average height value, and the width is the average width value.
In one embodiment, the step of performing feature configuration processing on the to-be-processed image after being scaled up or down by using the template image as a frame includes:
placing the picture to be processed after the equal-scale enlargement or reduction in the frame;
and setting the RGB information of the part without the picture coverage in the frame as 0.
In one embodiment, the detection module includes one or more of a face detection module, a lip recognition module, a gesture recognition module, an emotion analysis module, or a pedestrian recognition model.
In other embodiments, the batch-based picture inspection program 10 may be further divided into one or more modules, and the one or more modules are stored in the memory 11 and executed by the processor 12 to implement the present invention. The modules referred to herein are referred to as a series of computer program instruction segments capable of performing specified functions. Referring to fig. 2, a block diagram of a preferred embodiment of the batch-based picture inspection program 10 of fig. 1 is shown.
As shown in fig. 2, the picture inspection program 10 based on the grouping batch may be divided into a grouping processing unit 11, a preprocessing unit 12, and an inspection unit 13. The functions or operation steps performed by the modules 11-13 are similar to those described above and will not be described in detail here, for example, where:
the grouping processing unit 11 is configured to group the pictures to be processed according to length-width ratio information of the pictures to be processed, and obtain a plurality of groups of pictures to be processed;
the preprocessing unit 12 is configured to obtain corresponding preprocessing information according to each group of pictures to be processed, and preprocess each group of pictures to be processed based on the corresponding preprocessing information;
and the detection unit 13 is configured to input each group of preprocessed pictures into a preset detection module respectively, and detect the pictures through the detection module.
According to the picture detection device based on the grouping batch, the pictures are divided into a plurality of groups according to the length-width ratio, each group of pictures is adjusted to be pictures with preset sizes, insufficient parts are filled with zero, then each group of pictures are processed respectively, and the parts for filling or filling with zero can be reduced, so that the network of the face detector performs less invalid calculation, the carrying pressure of a computer is reduced, the calculation speed of the computer is increased, and the working efficiency is increased.
In addition, the invention also provides a picture detection method based on grouping batch. Referring to fig. 3, a flowchart of a preferred embodiment of the method for detecting pictures based on grouping batch according to the present invention is shown. The method may be performed by an apparatus, which may be implemented by software and/or hardware.
In this embodiment, the method for detecting pictures based on grouping batches includes: step S110-step S130.
Step S110: and according to the length-width ratio information of the pictures to be processed, grouping the pictures to be processed and obtaining a plurality of groups of pictures to be processed.
The pictures to be processed can be divided into a plurality of groups of picture sets according to the length-width ratio information of the pictures, and each group of pictures is combined with different corresponding length ratio ranges.
For example, five levels are set according to the aspect ratio of the pictures, wherein the aspect ratio ranges from 1:3 to 2:3, the aspect ratio ranges from 2:3 to 3:2, the aspect ratio ranges from 3:2 to 3:1, and the aspect ratio is greater than 1:3, and then the pictures to be processed are grouped according to the five groups of aspect ratio ranges. The grouping number of the pictures can be set by self according to the number of the specific pictures to be processed and the detection requirement.
Step S120: and acquiring corresponding preprocessing information according to each group of pictures to be processed, and respectively preprocessing each group of pictures to be processed based on the corresponding preprocessing information.
The method comprises the following steps of obtaining corresponding preprocessing information according to each group of pictures to be processed, and respectively preprocessing each group of pictures to be processed based on the corresponding preprocessing information, wherein the steps of preprocessing each group of pictures to be processed comprise:
1. and setting template picture information respectively corresponding to each group of pictures to be processed, wherein the template picture information comprises width information and height information.
2. And carrying out equal-scale amplification or reduction on all the pictures to be processed in the same group until the width of the pictures to be processed is not more than the width information of the template picture and the height of the pictures to be processed is not more than the height information of the template picture.
3. And taking the template picture as a frame, and carrying out feature configuration processing on the picture to be processed after the equal-scale amplification or reduction.
Further, after grouping the pictures to be processed and obtaining a plurality of groups of pictures to be processed, and before obtaining corresponding preprocessing information according to each group of pictures to be processed, the method further comprises the following steps:
acquiring picture characteristics of a picture to be processed, wherein the picture characteristics are picture definition or contrast, but are not limited to the picture definition or contrast and the like;
and regrouping the multiple groups of pictures to be processed according to the picture characteristics.
The step 1 of setting template picture information corresponding to each group of pictures to be processed includes:
(1) and reading the height and width information of all the pictures to be processed in the same group.
(2) Comparing the width information of each picture to be processed to obtain a maximum width value; meanwhile, comparing the height information of each picture to be processed to obtain the maximum height value.
(3) And setting a template picture according to the maximum width value and the maximum height value, so that the height of the template picture is the maximum height value, and the width of the template picture is the maximum width value.
It can be known that the height or width of the template picture is not limited to the maximum height value or the maximum width value.
In another embodiment, the step of setting template picture information respectively corresponding to each group of pictures to be processed includes:
reading the height and width information of all the pictures to be processed in the same group;
acquiring an average width value and an average height value according to the height and width information of all the pictures to be processed in the same group;
and setting a template picture according to the average width value and the average height value, wherein the height of the template picture is the average height value, and the width is the average width value.
For example, if the maximum width value of all the pictures to be processed in the same group is denoted as maxw and the maximum height value is denoted as maxh, each picture in the same group is enlarged to the size of (maxw, maxh) in an equal proportion, that is, a picture with the size of (w1, h1) before enlargement is processed, so that the enlarged size of the picture is (w1', h1'), wherein,
if h1/w1 maxw < ═ maxh, then w1'═ maxw is specified, and h1' ═ h1/w1 maxw; otherwise, w1 ═ w1/h1 ═ maxh and h1 ═ maxh are specified.
The step 3 of performing feature configuration processing on the to-be-processed image after the equal-scale enlargement or reduction by using the template image as a frame includes:
(1) placing the picture to be processed after the equal-scale enlargement or reduction in the frame;
(2) and setting the RGB information of the part without the picture coverage in the frame as 0.
When the picture to be processed is enlarged or reduced in equal proportion, the proportion a of the maximum width value and the maximum height value and the proportion b of the width and the height of each picture in the same group can be obtained firstly; when a is larger than b, the amplification ratio of the picture to be processed corresponding to the ratio b is set as: the maximum height value of the template picture information/the height of the picture to be processed; when a is less than b, the amplification ratio of the picture to be processed corresponding to the ratio b is set as: maximum width value of template picture information/width of picture to be processed.
In addition, each picture to be processed is centered and 0-supplemented through a corresponding word vector (a, b, c, d, e) identifier, wherein a and b in the word vector refer to the position of the picture, c, e, d respectively represent the color of RGD of the picture, and the part cde of the picture which needs zero-supplementing is defaulted to be 0.
Step S130: and respectively inputting each group of preprocessed pictures into a preset detection module, and detecting the pictures through the detection module.
The detection module comprises one or more of a face detection module, a lip recognition module, a gesture recognition module, an emotion analysis module or a pedestrian recognition module and other detection modules, after the preprocessed pictures are input into the detection modules, the parts of the pictures for supplementing 0 can be reduced, namely the number of times of increased invalid calculation is smaller, the acceleration effect of batch acceleration is kept, and the efficiency of image detection is further improved.
The following description will be given by taking as an example two pictures of which the width w is 1, the height h is 3 (hereinafter referred to as type a) and the width w is 3, and the height h is 1 (hereinafter referred to as type B).
The method comprises the steps of setting 10 pictures to be processed of the type A and the type B respectively, wherein the number of the pictures to be processed of the type A and the number of the pictures to be processed of the type B are 20, the sequence of the received pictures is ABAB …, the detection module is a pedestrian recognition model, and the number of the images which can be processed in batch at one time by the pedestrian recognition model is 10.
In the first case: without using grouping, the pedestrian recognition model may process the pictures in FIFO (first in first out) order, and may take 5 pictures of type a and 5 pictures of type B. In the recognition process, assuming processing is done on the size of picture a as a standard, then pictures of type a do not need to be scaled, while images of type B need to be scaled down to match the size of type a (assuming a centered alignment strategy is used).
For the picture of type B, after zooming, the effective area of the picture is changed from w to 3, h to 1 to w to 1, h to 1/3, and the effective area including the pedestrian detection information occupies only C to 1/9, but the pedestrian detection model still processes the whole picture including the zero padding area, so that the processor (GPU) performs approximately 8/9 to 89% of the processing as the ineffective processing, and the efficiency PB of the type B picture processing becomes 11.1%.
Since the type a picture does not need to be scaled, and all areas contain valid information for pedestrian detection, PA is 100%.
Further, the efficiency of one batch process including 5 type a pictures and 5 type B pictures is calculated, where P ═ PA + PB)/2 ═ 55.6%. Meanwhile, since the picture of type B is reduced to 1/9, the picture details are reduced, and the accuracy of pedestrian detection is also reduced.
In the second case, when the pictures are grouped by the method for detecting pictures using grouping batches according to the present invention, the pictures of type a and type B are grouped into two groups, and scaling is not required, so that the picture processing efficiency PA is 100%, the two groups are allocated to different batches for execution, and the processing efficiency P of each batch is 100%.
And, because the picture has no detail loss, pedestrian's precision that detects also can not receive the influence.
According to the image detection method based on the grouping batch, the images are divided into a plurality of groups according to the length-width ratio, each group is adjusted to be the image with the preset size, the insufficient part is filled with zero, then each group of images are processed respectively, and the part for filling or filling with zero can be reduced, so that the network of the face detector performs less invalid calculation, the carrying pressure of a computer is reduced, the calculation speed of the computer is increased, and the working efficiency is increased.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium includes a picture detection program based on a grouping batch, and when executed by a processor, the picture detection program based on the grouping batch implements the following operations:
grouping the pictures to be processed according to the length-width ratio information of the pictures to be processed to obtain a plurality of groups of pictures to be processed;
acquiring corresponding preprocessing information according to each group of pictures to be processed, and respectively preprocessing each group of pictures to be processed based on the corresponding preprocessing information;
and respectively inputting each group of preprocessed pictures into a preset detection module, and detecting the pictures through the detection module.
In an embodiment, the step of obtaining corresponding preprocessing information according to each group of pictures to be processed and respectively preprocessing each group of pictures to be processed based on the corresponding preprocessing information includes:
setting template picture information respectively corresponding to each group of pictures to be processed, wherein the template picture information comprises width information and height information;
carrying out equal-scale amplification or reduction on all the pictures to be processed in the same group until the width of the pictures to be processed is not larger than the width information of the template picture and the height of the pictures to be processed is not larger than the height information of the template picture;
and taking the template picture as a frame, and carrying out feature configuration processing on the picture to be processed after the equal-scale amplification or reduction.
In one embodiment, after grouping the pictures to be processed and obtaining a plurality of groups of pictures to be processed, and before obtaining corresponding preprocessing information according to each group of pictures to be processed, the method further includes:
acquiring picture characteristics of a picture to be processed, wherein the picture characteristics are picture definition or contrast;
and regrouping the multiple groups of pictures to be processed according to the picture characteristics.
In one embodiment, the step of setting template picture information respectively corresponding to each group of pictures to be processed includes: reading the height and width information of all the pictures to be processed in the same group;
comparing the width information of each picture to be processed to obtain a maximum width value; meanwhile, comparing the height information of each picture to be processed to obtain a maximum height value;
and setting a template picture according to the maximum width value and the maximum height value, so that the height of the template picture is the maximum height value, and the width of the template picture is the maximum width value.
In one embodiment, the step of setting template picture information respectively corresponding to each group of pictures to be processed includes:
reading the height and width information of all the pictures to be processed in the same group;
acquiring an average width value and an average height value according to the height and width information of all the pictures to be processed in the same group;
and setting a template picture according to the average width value and the average height value, wherein the height of the template picture is the average height value, and the width is the average width value.
In one embodiment, the step of performing feature configuration processing on the to-be-processed image after being scaled up or down by using the template image as a frame includes:
placing the picture to be processed after the equal-scale enlargement or reduction in the frame;
and setting the RGB information of the part without the picture coverage in the frame as 0.
In one embodiment, the detection module includes one or more of a face detection module, a lip recognition module, a gesture recognition module, an emotion analysis module, or a pedestrian recognition model.
The specific implementation of the computer-readable storage medium of the present invention is substantially the same as the above-mentioned image detection method based on grouping batch and the specific implementation of the electronic device, and will not be described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments. Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A picture detection method based on grouping batch is applied to an electronic device, and is characterized by comprising the following steps:
grouping the pictures to be processed according to the length-width ratio information of the pictures to be processed to obtain a plurality of groups of pictures to be processed;
acquiring corresponding preprocessing information according to each group of pictures to be processed, and respectively preprocessing each group of pictures to be processed based on the corresponding preprocessing information;
and respectively inputting each group of preprocessed pictures into a preset detection module, and detecting the pictures through the detection module.
2. The method according to claim 1, wherein the step of obtaining the corresponding preprocessing information according to each group of pictures to be processed and the step of preprocessing each group of pictures to be processed based on the corresponding preprocessing information respectively comprise:
setting template picture information respectively corresponding to each group of pictures to be processed, wherein the template picture information comprises width information and height information;
carrying out equal-scale amplification or reduction on all the pictures to be processed in the same group until the width of the pictures to be processed is not larger than the width information of the template picture and the height of the pictures to be processed is not larger than the height information of the template picture;
and taking the template picture as a frame, and carrying out feature configuration processing on the picture to be processed after the equal-scale amplification or reduction.
3. The method for detecting pictures based on grouping batches according to claim 1, wherein after grouping the pictures to be processed and obtaining a plurality of groups of pictures to be processed, and before acquiring corresponding preprocessing information according to each group of pictures to be processed, the method further comprises:
acquiring picture characteristics of a picture to be processed, wherein the picture characteristics are picture definition or contrast;
and regrouping the multiple groups of pictures to be processed according to the picture characteristics.
4. The method according to claim 2, wherein the step of setting template picture information respectively corresponding to each group of pictures to be processed comprises:
reading the height and width information of all the pictures to be processed in the same group;
comparing the width information of each picture to be processed to obtain a maximum width value; meanwhile, comparing the height information of each picture to be processed to obtain a maximum height value;
and setting a template picture according to the maximum width value and the maximum height value, so that the height of the template picture is the maximum height value, and the width of the template picture is the maximum width value.
5. The method according to claim 2, wherein the step of setting template picture information respectively corresponding to each group of pictures to be processed comprises:
reading the height and width information of all the pictures to be processed in the same group;
acquiring an average width value and an average height value according to the height and width information of all the pictures to be processed in the same group;
and setting a template picture according to the average width value and the average height value, wherein the height of the template picture is the average height value, and the width is the average width value.
6. The method according to claim 2, wherein the step of performing feature configuration processing on the to-be-processed picture after the scaling up or down by using the template picture as a frame comprises:
placing the picture to be processed after the equal-scale enlargement or reduction in the frame;
and setting the RGB information of the part without the picture coverage in the frame as 0.
7. The batch-based picture inspection method of claim 1,
the detection module includes one or more of a face detection module, a lip recognition module, a gesture recognition module, an emotion analysis module, or a pedestrian recognition model.
8. An electronic device, comprising: the picture detection program based on the grouping batch is executed by the processor to realize the following steps:
grouping the pictures to be processed according to the length-width ratio information of the pictures to be processed to obtain a plurality of groups of pictures to be processed;
acquiring corresponding preprocessing information according to each group of pictures to be processed, and respectively preprocessing each group of pictures to be processed based on the corresponding preprocessing information;
and respectively inputting each group of preprocessed pictures into a preset detection module, and detecting the pictures through the detection module.
9. The electronic device according to claim 8, wherein the step of obtaining the corresponding preprocessing information according to each group of pictures to be processed and respectively preprocessing each group of pictures to be processed based on the corresponding preprocessing information comprises:
setting template picture information respectively corresponding to each group of pictures to be processed, wherein the template picture information comprises width information and height information;
carrying out equal-scale amplification or reduction on all the pictures to be processed in the same group until the width of the pictures to be processed is not larger than the width information of the template picture and the height of the pictures to be processed is not larger than the height information of the template picture;
and taking the template picture as a frame, and carrying out feature configuration processing on the picture to be processed after the equal-scale amplification or reduction.
10. A computer-readable storage medium, characterized in that a grouped batch-based picture detection program is included in the computer-readable storage medium, and when the grouped batch-based picture detection program is executed by a processor, the steps of the grouped batch-based picture detection method according to any one of claims 1 to 5 are implemented.
CN201910875540.7A 2019-09-17 2019-09-17 Picture detection method and device based on grouping batch and storage medium Pending CN110717891A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910875540.7A CN110717891A (en) 2019-09-17 2019-09-17 Picture detection method and device based on grouping batch and storage medium
PCT/CN2019/117891 WO2021051580A1 (en) 2019-09-17 2019-11-13 Grouping batch-based picture detection method and apparatus, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910875540.7A CN110717891A (en) 2019-09-17 2019-09-17 Picture detection method and device based on grouping batch and storage medium

Publications (1)

Publication Number Publication Date
CN110717891A true CN110717891A (en) 2020-01-21

Family

ID=69209888

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910875540.7A Pending CN110717891A (en) 2019-09-17 2019-09-17 Picture detection method and device based on grouping batch and storage medium

Country Status (2)

Country Link
CN (1) CN110717891A (en)
WO (1) WO2021051580A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113139589A (en) * 2021-04-12 2021-07-20 网易(杭州)网络有限公司 Picture similarity detection method and device, processor and electronic device
CN113362218A (en) * 2021-05-21 2021-09-07 北京百度网讯科技有限公司 Data processing method and device, electronic equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012000135A1 (en) * 2010-07-02 2012-01-05 Intel Corporation Face detecting method and apparatus
CN103839224A (en) * 2012-11-26 2014-06-04 镇江京江软件园有限公司 Method for performing zoom process on batch pictures
CN106919889A (en) * 2015-12-25 2017-07-04 株式会社日立制作所 The method and apparatus detected to the number of people in video image
US20170277955A1 (en) * 2016-03-23 2017-09-28 Le Holdings (Beijing) Co., Ltd. Video identification method and system
WO2018228118A1 (en) * 2017-06-13 2018-12-20 腾讯科技(深圳)有限公司 Method and device for identifying similar pictures and storage medium
CN109325518A (en) * 2018-08-20 2019-02-12 Oppo广东移动通信有限公司 Classification method, device, electronic equipment and the computer readable storage medium of image
WO2019109526A1 (en) * 2017-12-06 2019-06-13 平安科技(深圳)有限公司 Method and device for age recognition of face image, storage medium
US20190236371A1 (en) * 2018-01-30 2019-08-01 Deluxe Entertainment Services Group Inc. Cognitive indexing of images in digital video content

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105335714B (en) * 2015-10-28 2019-06-14 小米科技有限责任公司 Photo processing method, device and equipment
CN105472239B (en) * 2015-11-17 2019-08-16 小米科技有限责任公司 Photo processing method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012000135A1 (en) * 2010-07-02 2012-01-05 Intel Corporation Face detecting method and apparatus
CN103839224A (en) * 2012-11-26 2014-06-04 镇江京江软件园有限公司 Method for performing zoom process on batch pictures
CN106919889A (en) * 2015-12-25 2017-07-04 株式会社日立制作所 The method and apparatus detected to the number of people in video image
US20170277955A1 (en) * 2016-03-23 2017-09-28 Le Holdings (Beijing) Co., Ltd. Video identification method and system
WO2018228118A1 (en) * 2017-06-13 2018-12-20 腾讯科技(深圳)有限公司 Method and device for identifying similar pictures and storage medium
WO2019109526A1 (en) * 2017-12-06 2019-06-13 平安科技(深圳)有限公司 Method and device for age recognition of face image, storage medium
US20190236371A1 (en) * 2018-01-30 2019-08-01 Deluxe Entertainment Services Group Inc. Cognitive indexing of images in digital video content
CN109325518A (en) * 2018-08-20 2019-02-12 Oppo广东移动通信有限公司 Classification method, device, electronic equipment and the computer readable storage medium of image

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113139589A (en) * 2021-04-12 2021-07-20 网易(杭州)网络有限公司 Picture similarity detection method and device, processor and electronic device
CN113139589B (en) * 2021-04-12 2023-02-28 网易(杭州)网络有限公司 Picture similarity detection method and device, processor and electronic device
CN113362218A (en) * 2021-05-21 2021-09-07 北京百度网讯科技有限公司 Data processing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
WO2021051580A1 (en) 2021-03-25

Similar Documents

Publication Publication Date Title
CN109684980B (en) Automatic scoring method and device
CN110443140B (en) Text positioning method, device, computer equipment and storage medium
US20110305397A1 (en) Systems and methods for retargeting an image utilizing a saliency map
JP2020515983A (en) Target person search method and device, device, program product and medium
US11893767B2 (en) Text recognition method and apparatus
CN109784304B (en) Method and apparatus for labeling dental images
CN110070063B (en) Target object motion recognition method and device and electronic equipment
CN112380978B (en) Multi-face detection method, system and storage medium based on key point positioning
CN110796664B (en) Image processing method, device, electronic equipment and computer readable storage medium
CN103353881B (en) Method and device for searching application
CN110555334B (en) Face feature determination method and device, storage medium and electronic equipment
WO2017067287A1 (en) Fingerprint recognition method, apparatus, and terminal
CN110620884B (en) Expression-driven-based virtual video synthesis method and device and storage medium
CN110717891A (en) Picture detection method and device based on grouping batch and storage medium
CN112528318A (en) Image desensitization method and device and electronic equipment
CN112055244A (en) Image acquisition method and device, server and electronic equipment
CN111080747A (en) Face image processing method and electronic equipment
CN108270973B (en) Photographing processing method, mobile terminal and computer readable storage medium
CN111179287A (en) Portrait instance segmentation method, device, equipment and storage medium
CN113393477A (en) Image processing method and system
CN113132786A (en) User interface display method and device and readable storage medium
CN114780181B (en) Resource display method, device, computer equipment and medium
CN113392820B (en) Dynamic gesture recognition method and device, electronic equipment and readable storage medium
CN113453017B (en) Video processing method, device, equipment and computer program product
WO2022257433A1 (en) Processing method and apparatus for feature map of image, storage medium, and terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination