Camera occlusion detection method and apparatus, camera device, and storage medium

By acquiring feature points and contour information from camera images, and combining threshold judgment and face recognition, the efficiency and accuracy issues of camera occlusion detection are solved, making it adaptable to various scenarios and environments.

CN116249015BActive Publication Date: 2026-01-02SHENZHEN HONGDIAN TECH CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211659053.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-22
Publication Date
2026-01-02
Estimated Expiration
2042-12-22

AI Technical Summary

Technical Problem

Existing camera occlusion detection methods have limitations and cannot efficiently and accurately determine whether a camera is occluded in various scenarios, especially due to limitations imposed by reference frames, long reaction times, or strong light.

Method used

By acquiring the number of feature points, contour information, and average pixel value of the image to be detected, multiple thresholds are set to determine whether the camera is occluded, and face recognition results are introduced when necessary to improve accuracy.

Benefits of technology

It improves the efficiency and accuracy of camera occlusion detection, adapts to various scenarios and environments, and reduces false judgments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116249015B_ABST
    Figure CN116249015B_ABST
Patent Text Reader

Abstract

The application is suitable for the field of image recognition technology, and provides a camera shielding detection method and device, a camera device and a storage medium. The method comprises the following steps: acquiring a to-be-detected image; acquiring the number of feature points and contour information in the to-be-detected image, wherein the contour information comprises a total contour area and a contour number; if the number of feature points is greater than a preset first threshold value, the contour number is less than a preset second threshold value, and the total contour area is greater than a preset third threshold value, it is judged that the camera is shielded. The application can adapt to various situations to judge whether the camera is shielded, and improves the efficiency and accuracy of camera shielding detection.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of image recognition, and particularly relates to a camera occlusion detection method and device, a camera device, and a storage medium. BACKGROUND

[0002] In-vehicle devices usually use infrared cameras to monitor the state of the driver and assist the driver in work. However, when the infrared camera or other cameras are partially occluded by malicious objects or objects, the monitoring function of the camera will be invalid.

[0003] In the prior art, a camera is used to collect relevant image features to determine whether the camera is occluded. When the camera collects image features, a frame difference method based on a reference frame, a dynamic modeling background modeling method based on consecutive frames of a video, and a feature point method based on corner point detection are usually used. When the frame difference method based on the reference frame is used, the occlusion is easily limited by the reference frame. The selected reference frame may not meet some application scenarios, resulting in the inability to determine whether the camera is occluded. When the dynamic modeling background modeling method based on consecutive frames of a video is used, multiple frames of data within a certain time are required, and the reaction time required for judgment is long, which cannot be applied to real-time scenarios, and cannot identify mobile occlusions. When the feature point method based on corner point detection is used, if a part of the image is irradiated by strong light, the average distribution of the pixel intensity value of the entire image will be caused, and the extracted corner points will be too few to cause misjudgment.

[0004] The above three methods used in the prior art have certain limitations in occlusion judgment, and cannot accurately and efficiently determine whether the camera is occluded when special situations occur. SUMMARY

[0005] Embodiments of the present application provide a camera occlusion detection method, device, camera device, and storage medium, which can improve the efficiency and accuracy of camera occlusion detection.

[0006] In a first aspect, the embodiments of the present application provide a camera occlusion detection method, which includes the following steps:

[0007] Obtaining a to-be-detected image;

[0008] Obtaining the number of feature points and contour information in the to-be-detected image, wherein the contour information includes a total contour area and a contour number;

[0009] If the number of feature points is greater than a preset first threshold, the contour number is less than a preset second threshold, and the total contour area is greater than a preset third threshold, it is determined that the camera is occluded.

[0010] In a possible implementation manner of the first aspect, before judging whether the camera is blocked, the method further includes:

[0011] obtaining pixel values of the feature points, and obtaining a total pixel value according to the pixel values of the feature points, wherein the total pixel value is a sum of the pixel values of all the feature points;

[0012] obtaining a pixel mean value, wherein the pixel mean value is a quotient obtained by dividing the total pixel value by the number of the feature points;

[0013] if the pixel mean value is greater than a fourth preset threshold value, obtaining a face recognition result of the to-be-detected image;

[0014] if the face feature exists in the face recognition result, judging that the camera is not blocked, and if not, judging that the camera is blocked.

[0015] In a possible implementation manner of the first aspect, the number of the feature points and the contour information in the to-be-detected image are obtained, including:

[0016] obtaining the to-be-detected image, and scaling the to-be-detected image to a preset target size;

[0017] performing color space conversion on the scaled to-be-detected image to convert the to-be-detected image into a grayscale image;

[0018] obtaining all pixel points and pixel values corresponding to the pixel points from the grayscale image;

[0019] obtaining the number of the feature points according to the all pixel points and the pixel values corresponding to the pixel points in combination with a preset binarization threshold value;

[0020] performing binarization processing on the grayscale image according to the all pixel points and the pixel values corresponding to the pixel points in combination with the preset binarization threshold value to obtain the contour information.

[0021] In a possible implementation manner of the first aspect, the number of the feature points is obtained according to the all pixel points and the pixel values corresponding to the pixel points in combination with the preset binarization threshold value, including:

[0022] if a pixel value corresponding to any pixel point in the all pixel points is greater than the preset binarization threshold value, the pixel point is a feature point;

[0023] obtaining the number of the feature points.

[0024] In a possible implementation manner of the first aspect, the contour information is obtained by performing binarization processing on the grayscale image according to the all pixel points and the pixel values corresponding to the pixel points in combination with the preset binarization threshold value, including:

[0025] The binarization processing is to set any pixel point with a pixel value greater than the preset binarization threshold in the grayscale image as a white pixel point, and otherwise, set as a black pixel point.

[0026] An object contour is acquired by using a contour searching method in combination with the black pixel points.

[0027] Contour information is acquired according to the object contour.

[0028] In a possible implementation manner of the first aspect, the object contour is acquired by using the contour searching method in combination with the black pixel points, including:

[0029] The black pixel points are sequentially searched by using the contour searching method.

[0030] The object contour is a sequentially connected set of the black pixel points.

[0031] In a possible implementation manner of the first aspect, the contour information is acquired according to the object contour, including:

[0032] An outermost contour is reserved, and small contours and contained contours are excluded, wherein the small contours are contours smaller than a preset contour size, and the contained contours are contours contained in the outermost contour.

[0033] Contour information is acquired according to the outermost contour.

[0034] In the second aspect, an embodiment of the present application provides a camera occlusion detection device, including:

[0035] An image acquisition module is configured to acquire a to-be-detected image.

[0036] A feature point and contour acquisition module is configured to acquire a feature point quantity and contour information in the to-be-detected image, wherein the contour information includes a total contour area and a contour quantity.

[0037] A judgment module is configured to judge that a camera is occluded if the feature point quantity is greater than a preset first threshold, the contour quantity is smaller than a preset second threshold, and the total contour area is greater than a preset third threshold.

[0038] In the third aspect, an embodiment of the present application provides a camera device, including a lens, a memory, a processor, and a computer program stored in the memory and executable on the processor, the lens is configured to acquire a to-be-detected image, and the processor implements the camera occlusion detection method in any one of the first aspect when executing the computer program.

[0039] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the method in any one of the first aspect.

[0040] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a display screen, the display screen performs the camera occlusion detection method in any one of the first aspect.

[0041] It can be understood that the beneficial effects of the above-mentioned second aspect to the fifth aspect can be referred to the related description in the first aspect, which will not be repeated here.

[0042] Compared with the prior art, the beneficial effects of the embodiments of the present application are as follows:

[0043] In the prior art, there are three conventional methods for judging the occlusion of the camera: 1. frame difference method based on reference frame, which is limited by the selection of the reference frame and is not suitable for some scenes; 2. dynamic modeling background modeling method based on video continuous frames, which cannot identify the mobility of the occlusion, and cannot be applied to scenes requiring real-time feedback because multiple frames of images need to be obtained; 3. feature point method based on corner detection, which cannot obtain enough corners when a picture with strong light directivity is obtained, and is prone to misjudgment. In summary, the three methods in the prior art have certain limitations and cannot efficiently and accurately judge whether the camera is occluded. The camera occlusion judgment method, device, camera and storage medium provided by the present application can judge only by obtaining one frame of image, improve the efficiency of camera occlusion detection, and set the first threshold value, the second threshold value and the third threshold value by extracting the feature points and the edge contour of the image to judge the occlusion condition. When the number of feature points is greater than the first threshold value, the number of contours is less than the second threshold value, and the total contour area is greater than the third threshold value, it is judged that the camera is occluded. When the three conditions are met, the face recognition result can be further extracted to judge whether it is really occluded, thereby improving the accuracy of camera occlusion detection. In summary, the present application can improve the efficiency and accuracy of judging whether the camera is occluded. BRIEF DESCRIPTION OF DRAWINGS

[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0045] Figure 1is a flowchart of a camera shielding detection method provided by an embodiment of the present application;

[0046] Figure 2 is a flowchart of a camera shielding detection method provided by an embodiment of the present application;

[0047] Figure 3 is a flowchart of a camera shielding detection method provided by an embodiment of the present application;

[0048] Figure 4 is a flowchart of a camera shielding detection method provided by an embodiment of the present application;

[0049] Figure 5 is a flowchart of a camera shielding detection method provided by an embodiment of the present application;

[0050] Figure 6 is a flowchart of a camera shielding detection method provided by an embodiment of the present application. DETAILED DESCRIPTION

[0051] In the following description, for the purposes of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc., in order to provide a thorough understanding of the embodiments of the application. However, it will be apparent to those skilled in the art that the present application can be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.

[0052] It should be understood that the term "comprises" when used in this specification and the appended claims, specifies the presence of stated features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0053] It should also be understood that the term "and / or" when used in this specification and the appended claims, means any one or more of the associated listed items can be present, and includes multiples of any associated listed item.

[0054] In addition, in the description of the specification and the appended claims, the terms "first", "second", "third", etc. are used only to distinguish descriptions, and cannot be understood as indicating or implying relative importance.

[0055] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0056] This application provides a method, apparatus, camera device, and storage medium for camera occlusion detection, which can solve the problems of low efficiency and low accuracy in camera occlusion detection. In traditional camera occlusion detection, the detection results may be limited by the selected reference object or environmental factors. However, when applied to camera occlusion detection, this application can adapt well to a variety of different situations or environments, improving the efficiency and accuracy of camera occlusion detection.

[0057] Figure 1 A schematic flowchart of a camera occlusion detection method provided in an embodiment of this application is shown. Figure 1 As shown, the method includes the following steps:

[0058] S101, acquire the image to be detected.

[0059] In the above steps, one possible implementation is that the camera captures a frame of the image to be detected and reads the image to be detected. One possible type of the image to be detected is an infrared image. The above capture of a frame of the image to be detected is to capture a still image.

[0060] S102, Obtain the number and contour information of feature points in the image to be detected.

[0061] One possible implementation of the above steps is to scale the image to be detected to a target size before acquiring the feature points in the image to be detected. That is, to scale the image to be detected to a preset target size. The preset target size is used to uniformly convert the size of the identified image when using the camera occlusion detection method.

[0062] In a possible implementation, after the image to be detected is scaled, color space conversion is performed to obtain a gray scale feature map, i.e., a gray scale image (English full name: Gray Scale Image or Grey Scale Image). Color space conversion refers to conversion of an image from one color space to another color space, where a color space is a color range defined by a one-dimensional, two-dimensional, three-dimensional or even four-dimensional spatial coordinate. In this application, RGB color space (regular color image) is converted to GRAY color space (i.e., gray scale image). A gray scale image is an image in which white and black are divided into several levels according to a logarithmic relationship, the levels are divided into gray scales, and the image features are displayed through the gray scales.

[0063] In a possible implementation, after the gray scale feature map is obtained, all pixel points in the image and pixel values corresponding to the pixel points are obtained, the number of feature points in the gray scale feature map is calculated according to a preset binarization threshold value through histogram statistics, where a histogram is a representation of data distribution by a series of vertical stripes or line segments with different heights, and generally, the horizontal axis represents data types and the vertical axis represents distribution.

[0064] In a possible implementation, when the contour information is obtained, the obtained gray scale feature map is binarized according to a preset binarization threshold value, and the edge contour is strengthened before the contour information is obtained. The contour information includes a total contour area and a contour number. The binarization processing is as follows: the pixel points with pixel values greater than the preset binarization threshold value in the gray scale feature map are adjusted to white pixel points, and the pixel points with pixel values less than the preset binarization threshold value are adjusted to black pixel points, so as to strengthen the edge contour of the image. The white pixel point is a pixel point with a pixel value of 255px, the black pixel point is a pixel point with a pixel value of 0px, and px is a unit of the pixel value. In this step, the pixel points are adjusted to white or black pixel points by adjusting the pixel values of the pixel points.

[0065] In a possible implementation, after the gray scale feature Figure Two is binarized, a contour finding method is used to collect the contour information in the binarized gray scale feature map. The flow steps and schematic diagram of the contour finding method are shown in subsequent embodiments. Figure 3

[0066] S103, if the number of feature points is greater than a preset first threshold value, the number of contours is less than a preset second threshold value, and the total contour area is greater than a preset third threshold value, jump to S104 to determine that the camera is blocked, and if not, jump to S105 to determine that the camera is not blocked. ​

[0067] In the above steps, one possible implementation is that, after the number of feature points and the contour information in the to-be-detected image are acquired, the to-be-detected image is judged.

[0068] In one possible implementation, the first threshold is a preset feature point number threshold, the second threshold is a preset contour number threshold, and the third threshold is a preset occlusion area threshold. When the number of pixel points greater than the preset binary threshold in the to-be-detected image is greater than the preset feature point number threshold, the contour number is less than the contour number threshold, and the total contour area is greater than the preset occlusion area, that is, the above three conditions are all met, it can be determined that the camera is occluded.

[0069] In one possible application scenario, when the camera collects the to-be-detected image, if it is directly irradiated by sunlight or other light sources, the collected to-be-detected image may be overexposed. At this time, the feature points and contours in the to-be-detected image may be lost to a certain extent, resulting in a misjudgment in the judgment process of the above three conditions, and an accurate judgment cannot be made on whether the camera is occluded.

[0070] Optionally, when the above three conditions are all met, the brightness of the image can be judged by a preset bright threshold. When the brightness of the collected to-be-detected image is too high, the face recognition result can be further introduced to judge whether the camera is occluded. The process is as shown in Figure 2 Figure 2 A flowchart for judging whether a camera is occluded by face recognition is shown. The method includes the following steps:

[0071] S201, acquiring a pixel mean value.

[0072] In the above steps, one possible implementation is that, in S102 of the embodiment of the present application, the pixel points in the gray feature map and the pixel values corresponding to the pixel points are acquired. In this step, the pixel values of all feature points are added and divided by the number of feature points to obtain the pixel mean value, wherein the pixel mean value is used to judge the brightness of the to-be-detected image.

[0073] S202, if the pixel mean value is greater than a preset fourth threshold, jump to S203 to acquire a face recognition result and jump to S205, otherwise, jump to S204 to judge whether the camera is occluded.

[0074] In the above steps, one possible implementation is that, the preset fourth threshold is a preset bright threshold, that is, a preset pixel value. If the pixel mean value is greater than the preset bright threshold, the camera may be directly irradiated by strong light, and the feature point acquisition may have errors. At this time, the face recognition result of the to-be-detected image can be introduced to further judge whether the camera is occluded, so as to improve the accuracy of the judgment. ​

[0075] S205, if the face feature exists in the face recognition result, jump to S206 to determine that the camera is not blocked, otherwise, jump to S207 to determine that the camera is blocked.

[0076] In the above steps, one possible implementation is that the face recognition result in the image to be detected is obtained, and if one or more of the face features such as ear features, nose features, eye features, eyebrow features, jawbone features, forehead features, cheek features, or mouth features exist in the face recognition result, it is determined that the camera is not blocked, and if not, it is determined that the camera is blocked.

[0077] Figure 3 A flowchart of a contour finding method provided by an embodiment of the present application is shown. As shown in the figure, the method includes the following steps: Figure 3

[0078] S301, find the black pixel point in the binary grayscale feature map, and take the first found black pixel point as the starting point.

[0079] In the above steps, one possible implementation is to start searching from the bottom-left corner pixel point of the binary grayscale feature map, first search from top to bottom, and then search from left to right, to find the black pixel point with a pixel value of 0px. When the first black pixel point is found, the first black pixel point is taken as the starting point for the subsequent search steps.

[0080] S302, find the next black pixel point from the starting point.

[0081] In the above steps, one possible implementation is to search all pixel points in the Moore neighborhood of the starting point in a clockwise order to find the next black pixel point.

[0082] In one possible implementation, the Moore neighborhood is also called the eight-neighborhood or indirect neighborhood. Assuming that each region in a 3x3 region has 1 pixel point, the 3x3 region has a total of 9 pixel points. In this step, the center pixel point in the 3x3 region is the starting point, and the eight pixel points near the starting point are searched in a clockwise direction. When the next black pixel point is found, the pixel point is recorded as a boundary pixel point, and then the white pixel point passed through before is returned. The next black pixel point is searched in the Moore neighborhood of the white pixel point in a clockwise direction, and the search is ended when no black pixel point is found.

[0083] S303, obtain the ordered set of all found black pixel points, which is the object contour.

[0084] ​In the above step, one possible implementation manner is that the boundary pixel points recorded in sequence in the step S302 are calculated, and a sequence set of all the found boundary pixel points is obtained, and the sequence connection of all the boundary pixel points in the sequence set is the object contour.

[0085] In the step S304, the object contour is selected, and the total contour area and the contour number are calculated.

[0086] In the above step, one possible implementation manner is that the object contour is cleaned, and the small contour and the contained contour in the obtained contour are excluded, and only the outermost contour is reserved. The small contour is a contour with a size smaller than a preset contour size, and the contained contour is a contour contained in the outermost contour.

[0087] In one possible implementation manner, after the contour cleaning, the contour number and the total contour area are obtained from the reserved outermost contour, that is, the number of the reserved outermost contour is calculated, the areas of these contours are calculated respectively, the areas of all the contours are added, and the total contour area is obtained.

[0088] Figure 4 A scene schematic diagram of camera shielding detection provided by an embodiment of the present application is shown. As shown in the figure, the first scene is a normal scene in which the camera is not shielded at all. The second scene is a scene conforming to the foregoing steps in the embodiment of the present application. The third scene is a scene conforming to the foregoing steps in the embodiment of the present application. Figure 4 Figure 1 Figure 2

[0089] In the above first scene, the number of pixel points greater than the preset binarization threshold in the image to be detected is less than the preset feature point number threshold, the contour number is greater than the contour number threshold, and the total contour area is less than the preset shielding area. At this time, the camera is not shielded.

[0090] In the above second scene, the number of pixel points greater than the preset binarization threshold in the image to be detected is greater than the preset feature point number threshold, the contour number is less than the contour number threshold, and the total contour area is greater than the preset shielding area. The average pixel value of the feature point is less than the preset bright threshold. At this time, the camera is shielded.

[0091] In the above third scene, the number of pixel points greater than the preset binarization threshold in the image to be detected is greater than the preset feature point number threshold, the contour number is less than the contour number threshold, and the total contour area is greater than the preset shielding area. The average pixel value of the feature point is greater than the preset bright threshold, but the face recognition result has a face feature. At this time, the camera is not shielded.

[0092] Figure 5 ​​​A structural schematic diagram of a camera shielding detection device is shown. As shown in the figure Figure 5 The camera shielding detection device has an image acquisition module 501, a feature point and contour acquisition module 502, and a judgment module 503.

[0093] The camera shielding detection device is used to acquire a to-be-detected image, acquire feature points and contour information in the to-be-detected image, judge whether the camera is shielded according to the acquired feature points and contour information, and return the judgment result. Wherein:

[0094] The image acquisition module 501 is used to acquire a to-be-detected image.

[0095] Optionally, after acquiring the to-be-detected image, the image acquisition module 501 can perform secondary conversion on the to-be-detected image to acquire a scaled to-be-detected image, a gray feature map of the to-be-detected image, and a binary to-be-detected image gray feature map.

[0096] The feature point and contour acquisition module 502 is used to acquire the number of feature points and contour information in the to-be-detected image.

[0097] Optionally, the feature point and contour acquisition module 502 acquires the pixel points and pixel values greater than the preset binary threshold in the gray feature map of the to-be-detected image through the preset binary threshold.

[0098] Optionally, the feature point and contour acquisition module 502 also acquires all pixel points and pixel values corresponding to the pixel points in the gray feature map of the to-be-detected image, which is used for subsequent face recognition result judgment and contour information acquisition.

[0099] Optionally, the feature point and contour acquisition module 502 acquires the enhanced edge contour in the binary to-be-detected image gray feature map through contour finding method.

[0100] The judgment module 503 is used to judge whether the camera is shielded. If the number of pixel points greater than the preset binary threshold in the to-be-detected image is greater than the number of preset feature points, the number of contours is less than the number of preset contours, and the total contour area is greater than the preset shielding area, that is, all three conditions are met, it can be judged that the camera is shielded.

[0101] Optionally, when the above three conditions are met, face recognition results can be introduced for further judgment. If the pixel mean value is greater than the preset bright threshold, the face recognition result is acquired. If one or more of the face features such as ear features, nose features, eye features, eyebrow features, jawbone features, forehead features, cheek features, or mouth features exist in the face recognition result, it is judged that the camera is not shielded. If not, it is judged that the camera is shielded.

[0102] Figure 6 A structural schematic diagram of a camera device is provided for an embodiment of the present application. As shown in the figure, the camera device 6 of the embodiment includes at least one lens 60, a processor 61 (only one is shown in the figure), a memory 62, and a computer program 63 stored in the memory 62 and executable on the at least one processor 61, the lens 60 being configured to acquire an image to be detected in any of the steps of the camera occlusion detection method embodiments described above, and the processor 61 being configured to implement the steps of any of the camera occlusion detection method embodiments described above when executing the computer program 63. Figure 6 Figure 6 The camera device 6 can be a wide dynamic camera, a strong light suppression camera, a road monitoring special camera, an infrared camera, an all-in-one camera, etc. The camera device 6 can include, but is not limited to, the lens 60, the processor 61, and the memory 62. Those skilled in the art can understand that the camera device 6 is only an example and does not limit the camera device 6, and can include more or fewer components than shown in the figure, or combine certain components, or different components, for example, can also include an input / output device, a network access device, etc.

[0103] The lens 60 can be classified as a wide-angle lens, a telephoto lens, a zoom lens, a variable focus lens, or a pinhole lens, etc. according to the field of view size, and can be a spherical lens or an aspherical lens, etc. according to the shape, and can be a short focal length wide-angle lens, a medium focal length standard lens, a long focal length telephoto lens, or a variable focal length lens, etc. according to the focal length. In addition to the above lens types, it can also be a conventional lens classified according to any other type. Figure 6 The processor 61 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.

[0104] The memory 62 can include a volatile memory (e.g., a random access memory, a dynamic random access memory (DRAM) or a static random access memory (SRAM)), or a non-volatile memory (e.g., a read only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically EPROM (EEPROM), a flash memory, etc.), or a combination thereof.

[0105] The computer program 63 can include a computer program code, which can be any expression, in a any language, code, or notation, of a set of instructions intended to cause a set of instructions executable by the at least one processor 61 to perform the steps of any of the camera occlusion detection method embodiments described above.

[0106] ​The memory 62 can be an internal storage unit of the camera device 6, such as a hard disk or a memory of the camera device 6 in some embodiments. The memory 62 can also be an external storage device of the camera device 6, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the camera device 6 in other embodiments. Further, the memory 62 can include both an internal storage unit and an external storage device of the camera device 6. The memory 62 is used to store an operating system, an application program, a boot loader, data, and other programs, such as program codes of the computer program, etc. The memory 62 can also be used to temporarily store data that has been output or is to be output.

[0107] It should be noted that the information interaction and execution process between the above devices / units are based on the same concept as the method embodiments of the present application, and the specific functions and technical effects brought by the above devices / units can be referred to the method embodiments part, which will not be repeated here.

[0108] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of functional units and modules is exemplified, and in actual application, the above-mentioned functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the above-described functions. Each functional unit and module in the embodiment can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or software. In addition, the specific names of each functional unit and module are only for easy distinction, and do not limit the protection scope of the present application. The specific working process of the unit and module in the system can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.

[0109] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in each of the above method embodiments can be implemented.

[0110] The embodiment of the present application provides a computer program product. When the computer program product is run on a mobile terminal, the mobile terminal executes the steps in each of the above method embodiments.

[0111] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the present application can implement all or part of the processes in the above-mentioned embodiment methods through a computer program to instruct relevant hardware to complete, and the computer program can be stored in a computer readable storage medium. When the computer program is executed by a processor, the steps of each method embodiment described above can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable files or some intermediate forms. The computer readable medium can at least include any entity or device capable of carrying the computer program code to the photographing device / terminal equipment, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium. For example, U disk, mobile hard disk, magnetic disk or optical disk, etc. In some jurisdictions, according to legislation and patent practice, the computer readable medium can not be an electrical carrier signal and a telecommunication signal.

[0112] In the above embodiments, the description of each embodiment has its own focus, and the parts not described or recorded in detail in a certain embodiment can be referred to the relevant description of other embodiments.

[0113] Those of ordinary skill in the art can understand that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0114] In the embodiments provided in the present application, it should be understood that the disclosed apparatus / network device and method can be implemented in other ways. For example, the above-described apparatus / network device embodiments are only schematic. For example, the division of the modules or units is only a logical function division, and there can be another division manner in actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection between each of the units can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or in other forms.

[0115] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may also be distributed to multiple network units. Part or all of the units can be selected to achieve the purpose of the embodiment scheme according to actual needs.

[0116] The above embodiments are only used to illustrate the technical solutions of the present application, but not limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can still be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.

Claims

1. A method for detecting camera occlusion, characterized in that, The method comprises: acquiring an image to be detected; acquiring the number of feature points and contour information in the image to be detected, wherein the contour information comprises a total contour area and a contour number; if the number of feature points is greater than a preset first threshold, the contour number is less than a preset second threshold, and the total contour area is greater than a preset third threshold, it is determined that the camera is blocked; wherein the acquiring the number of feature points and contour information in the image to be detected comprises: acquiring the image to be detected, and scaling the image to be detected to a preset target size; performing color space conversion on the scaled image to be detected to convert it into a grayscale image; from the grayscale image, acquiring all pixel points and pixel values corresponding to the pixel points; according to the all pixel points and the pixel values corresponding to the pixel points, and in combination with a preset binarization threshold, acquiring the number of feature points.

2. The method of claim 1, wherein, Before determining whether the camera is blocked, the method further comprises: acquiring pixel values of feature points, and according to the pixel values of the feature points, acquiring a total pixel value, wherein the total pixel value is the sum of the pixel values of all the feature points; acquiring a pixel mean value, wherein the pixel mean value is the quotient obtained by dividing the total pixel value by the number of feature points; if the pixel mean value is greater than a preset fourth threshold, acquiring a face recognition result of the image to be detected; if there is a face feature in the face recognition result, it is determined that the camera is not blocked, and if not, it is determined that the camera is blocked.

3. The method of claim 1, wherein: according to the all pixel points and the pixel values corresponding to the pixel points, and in combination with a preset binarization threshold, performing binarization processing on the grayscale image to acquire contour information.

4. The method of claim 3, wherein, According to the all pixel points and the pixel values corresponding to the pixel points, and in combination with a preset binarization threshold, acquiring the number of feature points comprises: if the pixel value corresponding to any pixel point in the all pixel points is greater than the preset binarization threshold, the pixel point is a feature point; acquiring the number of feature points.

5. The method of claim 3, wherein, According to the all pixel points and the pixel values corresponding to the pixel points, and in combination with a preset binarization threshold, performing binarization processing on the grayscale image to acquire contour information comprises: the binarization processing is to set any pixel point in the grayscale image whose pixel value is greater than the preset binarization threshold as a white pixel point, and otherwise, as a black pixel point; acquiring an object contour in combination with the black pixel points through a contour finding method; acquiring contour information according to the object contour.

6. The method of claim 5, wherein, Acquiring an object contour in combination with the black pixel points through the contour finding method comprises: sequentially finding the black pixel points through the contour finding method; the object contour is a sequentially connected set of the black pixel points.

7. The method of claim 5, wherein, Acquiring the contour information according to the object contour comprises: reserving an outermost contour, and excluding small contours and containing contours, wherein the small contour is a contour smaller than a preset contour size, and the containing contour is a contour contained in the outermost contour; acquiring contour information according to the outermost contour.

8. A camera occlusion detection apparatus, characterized by, It comprises: an image acquisition module configured to acquire an image to be detected; The feature point and contour collection module is configured to acquire a feature point quantity and contour information in the image to be detected, wherein the contour information comprises a total contour area and a contour quantity. The judgment module is configured to judge that the camera is blocked if the feature point quantity is greater than a preset first threshold, the contour quantity is less than a preset second threshold, and the total contour area is greater than a preset third threshold. The feature point and contour collection module is specifically configured to: acquire the image to be detected, and scale the image to be detected to a preset target size; perform color space conversion on the scaled image to be detected to convert the image to a grayscale image; acquire all pixel points and pixel values corresponding to the pixel points from the grayscale image; acquire the feature point quantity according to all the pixel points and the pixel values corresponding to the pixel points in combination with a preset binary threshold.

9. A camera device comprising a lens, a processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that, The lens is configured to acquire an image to be detected; and the processor, when executing the computer program, implements the method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9. The computer program, when executed by the processor, implements the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Camera shielding detection method and device, electronic equipment and storage medium

    CN112116551A

  • Image acquisition equipment shielding state detection method and device, equipment and storage medium

    CN112150534A