CN-122023351-A - Image detection method and device
Abstract
The invention provides an image detection method and device, wherein the method comprises the steps of obtaining a video stream collected by shooting equipment according to an image detection request initiated by a user, collecting candidate video frames from the video stream, carrying out quality detection on the candidate video frames based on the resolution of the candidate video frames, determining an intermediate video frame from the candidate video frames based on a quality detection result, screening target video frames from the intermediate video frames based on a pre-configured service detection dimension corresponding to a service scene of the image detection request, and determining a detection result corresponding to the image detection request based on a service detection result of the target video frames. According to the embodiment, the image detection can be carried out in a mode of capturing the video stream and extracting the video frame, the problem that a user repeatedly shoots due to the fact that the image detection is not passed is avoided, and the user experience can be improved while the image detection efficiency is improved.
Inventors
- GAO MING
- WANG ZHONGHAO
Assignees
- 北京京东远升科技有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260130
Claims (10)
- 1. An image detection method, comprising: acquiring a video stream acquired by shooting equipment according to an image detection request initiated by a user; Collecting candidate video frames from the video stream, detecting the quality of the candidate video frames based on the resolution of the candidate video frames, and determining intermediate video frames from the candidate video frames based on a quality detection result; screening a target video frame from the intermediate video frame based on a pre-configured service detection dimension corresponding to the service scene of the image detection request; And determining a detection result corresponding to the image detection request based on the service detection result of the target video frame.
- 2. The method of claim 1, wherein collecting candidate video frames from the video stream, quality detecting the candidate video frames based on their resolution, comprises: Collecting candidate video frames from the video stream according to a preset frame rate; Determining the resolution of the candidate video frames, and storing the candidate video frames with the resolution larger than or equal to a first threshold value into a first cache queue; And in response to the data volume in the first buffer queue being greater than or equal to a second threshold, cleaning the first buffer queue according to the storage time of each historical video frame corresponding to the video stream in the first buffer queue so as to store the candidate video frames into the first buffer queue.
- 3. The method of claim 2, wherein determining an intermediate video frame from the candidate video frames comprises: Obtaining candidate video frames from the first buffer queue, performing size normalization processing on the candidate video frames, and converting the candidate video frames subjected to the size normalization processing into a gray level map; Calculating pixel variance of the candidate video frames based on the gray level map, marking the candidate video frames with the pixel variance larger than or equal to a third threshold as qualified video frames, and marking the candidate video frames with the pixel variance smaller than the third threshold as useless video frames; Calculating the pixel mean square error between the qualified video frame and the last qualified video frame, taking the qualified video frame with the pixel mean square error larger than or equal to a fourth threshold value as an intermediate video frame, and taking the qualified video frame with the pixel mean square error smaller than the fourth threshold value as an useless video frame; and storing the intermediate video frames into a second buffer queue, and removing the useless video frames from the first buffer queue so as to delete the useless video frames.
- 4. The method of claim 1, wherein selecting the target video frame from the intermediate video frames based on a pre-configured traffic detection dimension corresponding to the traffic scene of the image detection request comprises: determining at least one artificial intelligent model for detecting the intermediate video frame according to the service detection dimension; Transmitting the intermediate video frames to the at least one artificial intelligent model to obtain the compliance probability of the intermediate video frames output by each artificial intelligent model; and determining the service detection result of the intermediate video frame according to the preset result reference dimension and the compliance probability output by each artificial intelligent model, and screening a target video frame from the intermediate video frame based on the service detection result.
- 5. The method of claim 4, wherein determining a target video frame from the intermediate video frames based on the traffic detection result comprises: And determining a target video frame from at least two intermediate video frames according to the image definition of the at least two intermediate video frames and the confidence level of an artificial intelligent model for carrying out service detection on the at least two intermediate video frames in response to the fact that the service detection result of the at least two intermediate video frames meets the preset requirement.
- 6. The method according to any one of claims 1-5, further comprising: And responding to the condition that the video stream acquisition time length is greater than or equal to a preset fifth threshold value and the target video frame does not exist, initiating an acquisition termination instruction to the shooting equipment, generating invalid prompt information based on a service detection result of the intermediate video frame, and pushing the invalid prompt information to the user.
- 7. An image detection apparatus, comprising: the acquisition module is used for acquiring a video stream acquired by the shooting equipment according to an image detection request initiated by a user; the quality detection module is used for collecting candidate video frames from the video stream, detecting the quality of the candidate video frames based on the resolution of the candidate video frames, and determining intermediate video frames from the candidate video frames based on a quality detection result; The service detection module is used for screening target video frames from the intermediate video frames based on a pre-configured service detection dimension corresponding to the service scene of the image detection request; And the determining module is used for determining a detection result corresponding to the image detection request based on the service detection result of the target video frame.
- 8. An electronic device, comprising: one or more processors; storage means for storing one or more programs, When executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-6.
- 9. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-6.
- 10. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-6.
Description
Image detection method and device Technical Field The invention relates to the technical field of computers, in particular to an image detection method and device. Background At present, an image detection method of 'post-shooting detection' is generally adopted, namely, a user needs to acquire an image to be detected by triggering a shooting button, then the acquired image is detected, and if the detection is not passed, the user needs to repeatedly shoot until the image detection is passed. This results in low image detection efficiency, failing to meet the stable detection requirements in multiple scenarios, and also affecting the user experience. Disclosure of Invention In view of the above, embodiments of the present invention provide at least an image detection method, an image detection device, an electronic device, and a storage medium, which can perform image detection by capturing a video stream and extracting a video frame, so that the problem of repeated shooting of a user caused by failed image detection is avoided, and the image detection efficiency is improved while the user experience is also improved. In a first aspect, an embodiment of the present invention provides an image detection method, including: acquiring a video stream acquired by shooting equipment according to an image detection request initiated by a user; collecting candidate video frames from a video stream, detecting the quality of the candidate video frames based on the resolution of the candidate video frames, and determining intermediate video frames from the candidate video frames based on a quality detection result; Screening a target video frame from the intermediate video frames based on a service detection dimension which is preset and corresponds to a service scene of the image detection request; and determining a detection result corresponding to the image detection request based on the service detection result of the target video frame. Optionally, collecting candidate video frames from the video stream, and performing quality detection on the candidate video frames based on the resolution of the candidate video frames, including: collecting candidate video frames from the video stream according to a preset frame rate; determining the resolution of candidate video frames, and storing the candidate video frames with the resolution larger than or equal to a first threshold value into a first cache queue; and in response to the data amount in the first buffer queue being greater than or equal to a second threshold, cleaning the first buffer queue according to the storage time of each historical video frame corresponding to the video stream in the first buffer queue so as to store the candidate video frames in the first buffer queue. Optionally, determining an intermediate video frame from the candidate video frames includes: Obtaining candidate video frames from the first buffer queue, performing size normalization processing on the candidate video frames, and converting the candidate video frames subjected to the size normalization processing into gray level images; Calculating pixel variance of the candidate video frames based on the gray level map, marking the candidate video frames with the pixel variance larger than or equal to a third threshold as qualified video frames, and marking the candidate video frames with the pixel variance smaller than the third threshold as useless video frames; Calculating the pixel mean square error between the qualified video frame and the last qualified video frame, taking the qualified video frame with the pixel mean square error larger than or equal to a fourth threshold value between the qualified video frame and the last qualified video frame as an intermediate video frame, and taking the qualified video frame with the pixel mean square error smaller than the fourth threshold value between the qualified video frame and the last qualified video frame as a useless video frame; And storing the intermediate video frames into a second buffer queue, and removing the useless video frames from the first buffer queue so as to delete the useless video frames. Optionally, selecting the target video frame from the intermediate video frames based on a pre-configured service detection dimension corresponding to the service scene of the image detection request, including: Determining at least one artificial intelligent model for detecting the intermediate video frame according to the service detection dimension; Transmitting the intermediate video frames to at least one artificial intelligent model to obtain the compliance probability of the intermediate video frames output by each artificial intelligent model; And determining the service detection result of the intermediate video frame according to the preset result reference dimension and the compliance probability output by each artificial intelligent model, and screening the target video frame from the intermediate video frame based on