Method for detecting blocking state of image acquisition device, electronic device and storage medium
AssigneeShenzhen Sensetime Technology Co., Ltd.
InventorsJie Xiang, Shaopeng Yin
Life of this patent
Estimating the term…
Abstract
A method for detecting a blocking state of an image acquisition device, an electronic device, and a computer storage medium are provided. The method includes: an image acquired by an image acquisition device is obtained; and it is determined, according to the acquired image, whether the image acquisition device is in a blocked state.
Claims15
A method for detecting a blocking state of an image acquisition device, comprising:
- obtaining an image acquired by an image acquisition device;
- and
- determining, according to the acquired image, whether the image acquisition device is in a blocked state, the determining comprises:
- determining average brightness of the acquired image according to the acquired image;
- in response to the average brightness of the acquired image is greater than or equal to a first brightness threshold and is less than or equal to a second brightness threshold, the first brightness threshold being less than the second brightness threshold, determining a ratio of a foreground area to an effective area of the acquired image, wherein the foreground area represents an area of a foreground portion of an image recognized from the acquired image, and the effective area is predetermined and is less than or equal to an area of the acquired image;
- in response to the ratio of the foreground area to the effective area of the acquired image is less than or equal to a set value, determining a number of outlines in the acquired image, wherein the number of outlines is a number of target outlines obtained by performing outline detection on the acquired image;
- in response to a duration in which the number of outlines in the acquired image is less than a set number, the duration being greater than or equal to a first set duration, determining that the image acquisition device is in the blocked state, and
- in response to the number of outlines in the acquired image being greater than or equal to the set number, determining that the image acquisition device is in an unblocked state.
An electronic device, comprising:
- a processor;
- and
- a memory, configured to store a computer program that, when executed by the processor, causes the processor to perform the following operations including:
- obtaining an image acquired by an image acquisition device;
- and
- determining, according to the acquired image, whether the image acquisition device is in a blocked state, the determining comprises:
- determining average brightness of the acquired image according to the acquired image;
- in response to the average brightness of the acquired image is greater than or equal to a first brightness threshold and is less than or equal to a second brightness threshold, the first brightness threshold being less than the second brightness threshold, determining a ratio of a foreground area to an effective area of the acquired image, wherein the foreground area represents an area of a foreground portion of an image recognized from the acquired image, and the effective area is predetermined and is less than or equal to an area of the acquired image;
- in response to the ratio of the foreground area to the effective area of the acquired image is less than or equal to a set value, determining a number of outlines in the acquired image, wherein the number of outlines is a number of target outlines obtained by performing outline detection on the acquired image;
- in response to a duration in which the number of outlines in the acquired image is less than a set number, the duration being greater than or equal to a first set duration, determining that the image acquisition device is in the blocked state, and
- in response to the number of outlines in the acquired image being greater than or equal to the set number, determining that the image acquisition device is in an unblocked state.
A non-transitory computer-readable storage medium, having stored thereon a computer program that, when executed by a processor, causes the processor to perform a method for detecting a blocking state of an image acquisition device, the method comprising:
- obtaining an image acquired by an image acquisition device;
- and
- determining, according to the acquired image, whether the image acquisition device is in a blocked state, the determining comprises:
- determining average brightness of the acquired image according to the acquired image;
- in response to the average brightness of the acquired image is greater than or equal to a first brightness threshold and is less than or equal to a second brightness threshold, the first brightness threshold being less than the second brightness threshold, determining a ratio of a foreground area to an effective area of the acquired image, wherein the foreground area represents an area of a foreground portion of an image recognized from the acquired image, and the effective area is predetermined and is less than or equal to an area of the acquired image;
- in response to the ratio of the foreground area to the effective area of the acquired image is less than or equal to a set value, determining a number of outlines in the acquired image, wherein the number of outlines is a number of target outlines obtained by performing outline detection on the acquired image;
- in response to a duration in which the number of outlines in the acquired image is less than a set number, the duration being greater than or equal to a first set duration, determining that the image acquisition device is in the blocked state, and
- in response to the number of outlines in the acquired image being greater than or equal to the set number, determining that the image acquisition device is in an unblocked state.
Dependencies are inferred from the claim text.