WO2023124387A1 - Photographing apparatus obstruction detection method and apparatus, electronic device, storage medium, and computer program product - Google Patents

Photographing apparatus obstruction detection method and apparatus, electronic device, storage medium, and computer program product Download PDF

Info

Publication number
WO2023124387A1
WO2023124387A1 PCT/CN2022/124951 CN2022124951W WO2023124387A1 WO 2023124387 A1 WO2023124387 A1 WO 2023124387A1 CN 2022124951 W CN2022124951 W CN 2022124951W WO 2023124387 A1 WO2023124387 A1 WO 2023124387A1
Authority
WO
WIPO (PCT)
Prior art keywords
image frame
current image
camera
preset
area
Prior art date
Application number
PCT/CN2022/124951
Other languages
French (fr)
Chinese (zh)
Inventor
李阳阳
许亮
毛宁元
Original Assignee
上海商汤智能科技有限公司
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 上海商汤智能科技有限公司 filed Critical 上海商汤智能科技有限公司
Publication of WO2023124387A1 publication Critical patent/WO2023124387A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N17/00Diagnosis, testing or measuring for television systems or their details

Definitions

  • the embodiment of the present disclosure is based on the Chinese patent application with the application number 202111668682.X, the application date is December 31, 2021, and the application name is "Camera Blocking Detection Method, Device, Electronic Equipment, and Storage Medium", and requires the Chinese Priority of the patent application, the entire content of the Chinese patent application is hereby incorporated by reference into this disclosure.
  • Embodiments of the present disclosure relate to the technical field of image processing, and in particular, to a camera device occlusion detection method, device, electronic equipment, storage medium, and computer program product.
  • image processing relies on the camera to capture high-quality images. If the camera is blocked, it is difficult to obtain images containing effective information, which in turn increases the difficulty of image-based scene analysis and behavioral decision-making.
  • the camera device in the car cabin can be used to restrict the driver's driving behavior, thereby reducing the probability of traffic accidents, thereby helping to improve driving safety.
  • the camera will be blocked, and if the camera is blocked, the driver's behavior cannot be accurately detected. Therefore, it is necessary to detect whether the camera is blocked and how to improve the accuracy of camera block detection , appears to be particularly important.
  • Embodiments of the present disclosure at least provide a method, device, electronic device, storage medium, and computer program product for occlusion detection of an imaging device, which can not only implement occlusion detection for an imaging device, but also improve detection accuracy.
  • An embodiment of the present disclosure provides an occlusion detection method for a camera device, including:
  • An embodiment of the present disclosure also provides an occlusion detection device for an imaging device, including:
  • the first acquisition module is configured to acquire the video data of the scene area through the camera device;
  • a detection module configured to perform face detection on the current image frame in the video data, and determine the pixel average value of the current image frame if no face is detected;
  • a processing module configured to perform inversion processing on the pixel values of the pixels in the current image frame when the average value of the pixels in the current image frame is lower than a preset reference threshold, to obtain an image after inversion processing ;
  • the judging module is configured to determine whether the camera is blocked based on the inverted image.
  • An embodiment of the present disclosure also provides an electronic device, including: a processor, a memory, and a bus, the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the The memories communicate through a bus, and when the machine-readable instructions are executed by the processor, the camera device occlusion detection method described in any one of the foregoing possible implementation manners is executed.
  • An embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is run by a processor, the camera device described in any one of the above-mentioned possible implementation manners is executed. Detection method.
  • An embodiment of the present disclosure also provides a computer program product, including a computer-readable storage medium storing program codes, and when instructions included in the program codes are executed by a processor of a computer device, the steps of the above method are implemented.
  • face detection is performed on the current image frame in the video data, and if no face is detected, the pixel average value of the current image frame is determined, and when the pixel average value of the current image frame is low
  • the pixel value of the pixel in the current image frame is reversed, and then based on the reversed image, it is determined whether the camera is blocked. In this way, no face can be detected
  • further judgment is made on the current image frame, and in the case of low image brightness, the pixel points in the image are reversed, so that the pixel value can be mapped to an easier-to-observe pixel value range, which improves the image quality.
  • the judgment accuracy of the occlusion state of the device is performed on the current image frame in the video data, and if no face is detected, the pixel average value of the current image frame is determined, and when the pixel average value of the current image frame is low
  • the pixel value of the pixel in the current image frame is reversed, and then based on the reversed image, it is determined whether the
  • FIG. 1 shows a schematic flowchart of a first method for occlusion detection of a camera device provided by an embodiment of the present disclosure
  • FIG. 2 shows a schematic flowchart of a method for determining the average value of pixels of a current image frame provided by an embodiment of the present disclosure
  • FIG. 3 shows a schematic flowchart of a method for inverting pixel values of pixels in a current image frame provided by an embodiment of the present disclosure
  • FIG. 4 shows a schematic flowchart of a second method for occlusion detection of a camera provided by an embodiment of the present disclosure
  • FIG. 5 shows a schematic flowchart of a third method for occlusion detection of a camera device provided by an embodiment of the present disclosure
  • FIG. 6 shows a schematic flowchart of a fourth method for occlusion detection of a camera device provided by an embodiment of the present disclosure
  • FIG. 7 shows a schematic flowchart of a method for outputting prompt information based on an image judgment result provided by an embodiment of the present disclosure
  • FIG. 8 shows a schematic structural diagram of an occlusion detection device for a camera device provided by an embodiment of the present disclosure
  • FIG. 9 shows a schematic structural diagram of another camera device occlusion detection device provided by an embodiment of the present disclosure.
  • Fig. 10 shows a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
  • image processing relies on the camera to capture high-quality images. If the camera is blocked, it is difficult to obtain images containing effective information, which in turn increases the difficulty of image-based scene analysis and behavioral decision-making.
  • the camera device in the car cabin can be used to restrict the driver's driving behavior, thereby reducing the probability of traffic accidents, thereby helping to improve driving safety.
  • the camera device may be blocked, and if the camera device is blocked, the driver's behavior cannot be accurately detected.
  • the embodiment of the present disclosure provides a method for occlusion detection of a camera device.
  • the video data of the scene area is obtained by the camera device, and then the face detection is performed on the current image frame in the video data.
  • determine the average value of pixels in the current image frame and in the case that the average value of pixels in the current image frame is lower than the preset reference threshold, reverse the pixel values of the pixels in the current image frame, and then based on Invert the processed image to determine whether the camera is blocked.
  • the current image frame can be further judged when no face is detected, and the pixels in the image can be further judged when the image brightness is low. Points are inverted, so that the pixel value can be mapped to an easier-to-observe pixel value range, which improves the accuracy of judging the occlusion state of the camera device.
  • the execution subject of the method for detecting occlusion of a camera device may be an electronic device or a server or other processing device with certain computing capabilities, and the electronic device may be a mobile device, a handheld device, a computing device, a vehicle device, a wearable equipment etc.
  • the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or it can provide basic cloud computing such as cloud services, cloud databases, cloud computing, cloud storage, big data and artificial intelligence platforms. Cloud server for the service.
  • the camera occlusion detection method may be implemented in a manner in which a processor invokes computer-readable instructions stored in a memory.
  • FIG. 1 it is a schematic flowchart of a first method for occlusion detection of a camera device provided by an embodiment of the present disclosure, and the method includes the following steps S101 to S104:
  • the camera device refers to a device capable of recording video of the current scene area in real time.
  • the scene area includes the driving area, and the camera device can be installed inside the vehicle to obtain video data of the driver in the driving area of the vehicle.
  • the camera device is the necessary hardware of the driver monitoring system (Driver Monitoring System, DMS).
  • the driver monitoring system uses the camera to obtain images, and uses technologies such as visual tracking, target detection, and action recognition to perform real-time intelligent detection and reminders of driver fatigue, driving distraction, and dangerous actions to reduce the probability of traffic accidents .
  • prompts can be given in time when the camera device is blocked so that the camera device can be adjusted to a normal non-blocking state, thereby assisting in improving driving safety.
  • the scene area may also be a panoramic area in the vehicle cabin or other areas in the vehicle cabin including the driving area of the vehicle, which is not limited herein.
  • the vehicle driving area refers to an area where a driver can perform a vehicle driving operation.
  • the vehicle driving operation includes but not limited to a steering wheel control operation, an accelerator pedal control operation, and the like.
  • the camera device When the driver is driving the vehicle in the vehicle driving area, the camera device will collect video of the driver's driving behavior and physiological state in the cabin in real time.
  • the number of camera devices may be set according to actual needs. In some embodiments, it can be set according to the shooting angle and shooting range of the camera, or according to factors such as cost. For example, there can be one camera, two or three cameras, etc., which is not limited here.
  • Video data refers to a continuous image sequence, which is essentially composed of a group of continuous images.
  • an image frame (Frame) is the smallest visual unit of video data, and is a static image.
  • a sequence of temporally continuous image frames is synthesized to form a dynamic video. Therefore, in order to facilitate subsequent detection, it is necessary to extract multiple frames of images in the video data.
  • frame extraction refers to frame extraction according to the preset interval frame number, for example, extracting a frame of image every 20 frames; it can also perform frame extraction according to the preset time interval, such as every interval of 10 milliseconds (ms) Fetch the image once.
  • frame extraction refers to frame extraction according to the preset interval frame number, for example, extracting a frame of image every 20 frames; it can also perform frame extraction according to the preset time interval, such as every interval of 10 milliseconds (ms) Fetch the image once.
  • preset number of frame intervals and the time interval can be set according to actual needs, and are not limited here.
  • S102 Perform face detection on a current image frame in the video data, and determine an average value of pixels of the current image frame if no face is detected.
  • the current image frame refers to the image that needs to be detected and recognized currently.
  • the image whose time sequence is before the current image frame is called the previous image frame
  • the image whose time sequence is after the current image frame is called the subsequent image frame.
  • face detection may be performed on the extracted images to determine whether there is a face in the current image frame.
  • a human face is detected in the current image frame, it means that the area captured by the camera device contains a human face, and the camera device is not blocked;
  • the image frame is further judged to distinguish that no human face is detected due to the blocking of the camera device or that there is no human face in the collection area of the camera device, so as to improve the accuracy of judgment.
  • the pixel average value of the current image frame is further determined.
  • the average value of the pixels of the current image frame refers to the average value of the pixels of the pixel points in the current image frame, which is used to judge the overall brightness and darkness of the current image frame.
  • the pixels of the pixels in the current image frame can be The value is negated.
  • the preset reference threshold can be determined according to the scene where the camera device is located. For example, if the background of the driving area is mostly bright, the preset reference threshold at this time can be set to a relatively high value, and if the driving area If the background is mostly dark, the preset reference threshold at this time can be set to a lower value accordingly, so that the accuracy of judgment can be further improved.
  • each pixel has a total of 256 gray levels, that is, the pixel value of each pixel is between 0 and 255, according to the current image
  • the frame average pixel value can determine the brightness and darkness of the current image frame.
  • the preset reference threshold can be set to 80. If it is lower than the preset reference threshold, it proves that the current image frame is overall dark.
  • the inversion process refers to the processing method of mapping the pixel value of the image to a range of pixel values that is easier to analyze by inversion, that is, the inversion process is to subtract the pixel value of the current pixel point from the pixel value 255, The inverted pixel value is obtained.
  • the pixel value of a pixel in the current image frame is 103, and the inverted pixel value is 152.
  • face detection is performed on the current image frame in the video data, and if no face is detected, the pixel average value of the current image frame is determined, and when the pixel average value of the current image frame is low
  • the pixel value of the pixel in the current image frame is reversed, and then based on the reversed image, it is determined whether the camera is blocked. In this way, no face can be detected
  • further judgment is made on the current image frame, and in the case of low image brightness, the pixel points in the image are reversed, so that the pixel value can be mapped to the pixel value range that is easier to analyze, which improves the image quality.
  • the judgment accuracy of the occlusion state of the device is performed on the current image frame in the video data, and if no face is detected, the pixel average value of the current image frame is determined, and when the pixel average value of the current image frame is low
  • the pixel value of the pixel in the current image frame is reversed, and then based on the reversed image, it is determined whether the camera
  • FIG. 2 is a schematic flowchart of a method for determining the average value of pixels of a current image frame provided by an embodiment of the present disclosure, including the following S1021 and S1022:
  • noise reduction processing is performed on the current image frame.
  • noise is an important cause of image interference, and a frame of image may have various noises in practical applications, and these noises may be generated during transmission or quantization and other processing. Therefore, the process of reducing noise in the image is very important, and the determination accuracy of the pixel average value of the current image frame can be improved through noise reduction processing.
  • the Gaussian smoothing algorithm is used for noise reduction processing, and the Gaussian smoothing is applied to the blurred image to uniformly smooth the transition of the entire image, remove details, reduce imaging snowflake noise, and make the current image frame clearer, which is beneficial to Improve the accuracy of determination of pixel average value.
  • the noise reduction processing may also use a median filtering algorithm or an average filtering algorithm to perform the noise reduction processing, which is not limited here.
  • FIG. 3 is a schematic flowchart of a method for inverting the pixel value of a pixel in the current image frame provided by the embodiment of the present disclosure, including the following S1031 and S1032:
  • the average pixel value of the current image frame is lower than the preset reference threshold, it does not mean that the pixel value of each pixel in the current image frame is very low, and for pixels with higher pixel values in the current image frame , then there is no need to perform inversion processing. Therefore, before the inversion processing, it is necessary to further determine the target pixel points that need to be inversion processing.
  • a pixel point in the current image frame whose pixel value is greater than the first preset pixel value and smaller than the second preset pixel value is used as the target pixel point.
  • the first preset pixel value can be set to 90
  • the second preset pixel value can be set to 150. If the pixel value of the pixel point is greater than the first preset pixel value and smaller than the second preset pixel value, it proves that the pixel The point is darker, and the pixel value of the pixel point needs to be reversed.
  • the first preset pixel value and the second preset pixel value are determined by the imaging parameters of the camera device, and the imaging parameters of the camera device determine the quality of the imaging effect of the camera device, that is, if the camera device If the imaging effect is better than other camera devices, the first preset pixel value and the second preset pixel value can be set to higher pixel values, so that the blocking state of the camera device can be judged more accurately.
  • a third preset pixel value is also set. If the pixel value of the pixel point is smaller than the first preset pixel value, it proves that the pixel point is a black pixel point; if the pixel value of the pixel point is greater than the first preset pixel value If the pixel value is less than the second preset pixel value, it proves that the pixel point is darker; if the pixel value of the pixel point is greater than the second preset pixel value and smaller than the third preset pixel value, it proves that the pixel point is of normal brightness; If the pixel value of the pixel point is greater than the third preset pixel value, it is proved that the pixel point is a white pixel point.
  • determining the target pixel from the pixels in the current image frame and performing inverse processing on the pixel value of the target pixel, In this way, based on the first preset pixel value and the second preset pixel value, a relatively dark pixel point in the current image frame can be determined, and the pixel value of the pixel point can be reversed, thereby improving the judgment accuracy of the occlusion state of the camera device .
  • FIG. 4 it is a schematic flow chart of the second camera device occlusion detection method provided by the embodiment of the present disclosure, including the following S201 to S210:
  • the scene area may be, for example, a vehicle driving area. This step is similar to step S101 in FIG. 1 .
  • This step is similar to step S102 in FIG. 1 .
  • This step is similar to step S102 in FIG. 1 .
  • step S206 needs to be performed to invert the pixels of the current image frame to improve the judgment accuracy; if the current If the average pixel value of the image frame is not lower than the preset reference threshold, it means that the brightness of the current image frame is normal. At this time, step S205 is performed to determine the maximum connected area of the current image frame.
  • the maximum connected domain refers to the image area composed of all pixel values with the same pixel value or within a certain error and adjacent to each other.
  • the preset area threshold may be set to an area of 60% of the entire image, and if the largest connected domain exceeds the preset area threshold, it is determined that the camera is blocked. It should be noted that the maximum connected domain is a closed area.
  • step S208 may be directly executed.
  • This step is similar to step S103 in FIG. 1 .
  • This step is similar to step S205.
  • step S209 determines that the camera is blocked; if the area of the largest connected domain is less than or equal to the preset area threshold, then perform step S210, Make sure the camera is not blocked.
  • the preset area threshold can be determined by the area size of the entire image frame, that is, if the image has a larger area, the preset area threshold can be set to a larger threshold, so that it can be more accurate to determine the blocking state of the camera.
  • FIG. 5 it is a schematic flowchart of a third method for occlusion detection of a camera device provided by an embodiment of the present disclosure. This method is different from the method in FIG. 4 in that it also includes the following S211 to S213 after step S208:
  • the area of the largest connected domain of the image after inversion processing is greater than the preset area threshold, it is necessary to further determine at least one frame of image in at least one of before and after the current image frame in the video data
  • the maximum connected domain in the image after inversion processing is taken to reduce the misjudgment caused by the sudden change, wherein the sudden change refers to suddenly blocking the camera device, or suddenly not blocking the camera device.
  • S212 Determine the average of the area of the largest connected domain in the image after the inversion processing of the current image frame, and at least one frame of image before and after the current image frame. value.
  • At least one frame of image in at least one of before and after the current image frame in the video data after determining the maximum connected domain in the image after its inversion processing, it is necessary to further determine the current image frame after inversion processing In the image, and at least one frame of image before and after the current image frame is taken as an average value of the area of the largest connected domain in the image after inverse processing.
  • the average refers to the sum of all data in a set of data divided by the number of this set of data, which is used to reflect the average level of a set of data.
  • the camera After determining the average value of the area of the largest connected domain in the image after the inverse processing of the current image frame and at least one frame of image before and after the current image frame, if the If the average value is greater than the preset area threshold, it is determined that the camera is blocked. In this way, the sudden change can be ruled out by determining the average value of the area of the largest connected domain, so that the occlusion state of the camera is not affected by the sudden change, and the judgment can be improved. The accuracy of the occlusion state of the camera.
  • FIG. 6 it is a schematic flowchart of a fourth method for occlusion detection of an imaging device provided by an embodiment of the present disclosure.
  • the difference between this method and the method in FIG. 1 is that after step S104, the following S105 is also included:
  • the prompt information includes but not limited to voice prompt information, sound (such as alarm sound) prompt information, graphic prompt information, and the like.
  • FIG. 7 is a schematic flow chart of a method for outputting prompt information based on an image-based judgment result provided by an embodiment of the present disclosure.
  • the method includes the following S1051 and S1052:
  • S1051. Determine the continuous shielding time of the camera according to the detection result of the camera in each frame of image in the video data.
  • the continuous occlusion time of the camera is determined, and if the continuous occlusion time reaches a preset time, a first prompt message is output, thus, in When the camera continues to be blocked, the first prompt information is output to reduce the occurrence of frequent output of prompt information.
  • the current image frame determines that the camera is blocked, it is also necessary to determine whether the judgment result of the subsequent frame image is also blocked. It just flashes, and at this time, the first prompt information is not output; if the judgment result of the frame image after at least one frame is also that the camera is blocked, that is, it is judged that the camera is blocked for multiple consecutive frames of images, it means that the camera is blocked at this time.
  • Continuous occlusion is intentional occlusion, not false occlusion, and when the continuous occlusion time reaches a preset time (for example, 5 seconds), first prompt information is output for prompting.
  • taking five frames of images as an example if the first four frames of images are all blocked, and by accumulating the blocking time, it is found that the blocking time is 4s, and the preset time is 3s, then it is determined that the camera lasts is blocked, at this time, output the first prompt information that the camera is blocked.
  • taking five frames of images as an example if the first two frames of images are blocked and the third frame of images is not blocked, by accumulating the blocking time of the first two frames, it is found that the blocking time is 2s, and the preset time is 3s, it means that the occlusion is a temporary occlusion, and at this time, the first prompt message will not be output.
  • the state information of the vehicle may be further acquired, and the current image frame may be determined according to the state information of the vehicle Whether the vehicle is in a driving state at the corresponding moment. If it is determined that the vehicle is in a driving state, since no human face is detected from the current image frame at this time and the camera is not blocked, it can be considered that the driver of the vehicle has left the driving area or the driver turned his head towards the rear of the car. At this time, the second prompt information for the driver leaving the post may be generated. In order to accurately detect and prompt the driver to leave the driving area or turn his head towards the rear while the vehicle is running. In some embodiments, if the vehicle is in a non-driving state, such as when the vehicle is parked, the driver may leave the driving area, and if it is determined that the camera is not blocked, it can No alarm or prompt is issued.
  • the writing order of each step does not mean a strict execution order and constitutes any limitation on the implementation process.
  • the specific execution order of each step should be based on its function and possible
  • the inner logic is OK.
  • the embodiment of the present disclosure also provides a camera device occlusion detection device corresponding to the camera device occlusion detection method, because the principle of solving the problem of the device in the embodiment of the present disclosure is the same as the above-mentioned camera device occlusion detection method in the embodiment of the present disclosure Similarly, the implementation of the device can refer to the implementation of the method.
  • the device 500 includes:
  • the first acquiring module 501 is configured to acquire the video data of the scene area through the camera device;
  • the detection module 502 is configured to perform face detection on the current image frame, and determine the pixel average value of the current image frame when no face is detected;
  • the processing module 503 is configured to perform inversion processing on the pixel values of the pixels in the current image frame when the average value of the pixels in the current image frame is lower than a preset reference threshold, to obtain the inversion processing image;
  • the judging module 504 is configured to determine whether the camera is blocked based on the inverted image.
  • processing module 503 is further configured to:
  • Negative processing is performed on the pixel value of the target pixel point.
  • the first preset pixel value and the second preset pixel value are determined by imaging parameters of the camera device.
  • the judging module 504 is further configured to:
  • the occlusion detection result of the current image frame is that the camera is occluded.
  • the judging module 504 is further configured to:
  • the area of the largest connected domain is greater than the preset area threshold, determine at least one frame of image in the video data before and after at least one of the current image frame in the image after inversion processing The largest connected domain of ;
  • the occlusion detection result of the current image frame is that the camera is occluded.
  • the device further includes:
  • the first output module 505 is configured to output first prompt information when it is determined that the camera is blocked.
  • the first output module 505 is further configured to:
  • the camera detection results of each frame of image in the video data determine the continuous shielding time of the camera; when the shielding continuous shielding time reaches a preset time, output the first prompt information.
  • the detection module 502 is further configured to:
  • the scene area includes a vehicle driving area
  • the device further includes:
  • the second acquisition module is configured to acquire the status information of the vehicle when it is determined that the camera device is not blocked;
  • the second output module is configured to generate second prompt information when it is determined according to the state information of the vehicle that the vehicle is in a driving state at the moment corresponding to the current image frame.
  • an embodiment of the present disclosure also provides an electronic device.
  • FIG. 10 it is a schematic structural diagram of an electronic device 700 provided by an embodiment of the present disclosure, including a processor 701 , a memory 702 and a bus 703 .
  • the memory 702 is used to store execution instructions, including a memory 7021 and an external memory 7022; the memory 7021 here is also called an internal memory, and is used to temporarily store calculation data in the processor 701 and exchange data with an external memory 7022 such as a hard disk.
  • the processor 701 exchanges data with the external memory 7022 through the memory 7021 .
  • the memory 702 is used to store application program codes for executing the solutions of the present disclosure, and the execution is controlled by the processor 701 . That is, when the electronic device 700 is running, the processor 701 communicates with the memory 702 through the bus 703, so that the processor 701 executes the application program code stored in the memory 702, and then executes the methods disclosed in any of the foregoing embodiments.
  • memory 702 can be, but not limited to, random access memory (Random Access Memory, RAM), read-only memory (Read Only Memory, ROM), programmable read-only memory (Programmable Read-Only Memory, PROM), can Erasable Programmable Read-Only Memory (EPROM), Electric Erasable Programmable Read-Only Memory (EEPROM), etc.
  • RAM Random Access Memory
  • ROM read-only memory
  • PROM programmable read-only memory
  • EPROM Erasable Programmable Read-Only Memory
  • EEPROM Electric Erasable Programmable Read-Only Memory
  • the processor 701 may be an integrated circuit chip with signal processing capabilities.
  • the above-mentioned processor can be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; it can also be a digital signal processor (Digital Signal Processing, DSP), dedicated integrated Circuit (Application-Specific Integrated Circuit, ASIC), Field Programmable Gate Array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • DSP Digital Signal Processing
  • ASIC Application-Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
  • the structure illustrated in the embodiment of the present disclosure does not constitute a specific limitation on the electronic device 700 .
  • the electronic device 700 may include more or fewer components than shown in the illustration, or combine certain components, or separate certain components, or arrange different components.
  • the illustrated components can be realized in hardware, software or a combination of software and hardware.
  • An embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is run by a processor, the steps of the camera-device occlusion detection method described in the foregoing method embodiments are executed.
  • the storage medium may be a volatile or non-volatile computer-readable storage medium.
  • the computer program product of the access verification method provided by the embodiments of the present disclosure includes a computer-readable storage medium storing program codes, and the instructions included in the program codes can be used to execute the steps of the camera device occlusion detection method in the above method embodiments , refer to the above method embodiment.
  • the above-mentioned computer program product may be implemented by means of hardware, software or a combination thereof.
  • the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK) and the like.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium executable by a processor.
  • the technical solution of the present disclosure is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present disclosure.
  • the aforementioned storage medium includes: various media capable of storing program codes such as U disk, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk.
  • the products applying the disclosed technical solution have clearly notified the personal information processing rules and obtained the individual's independent consent before processing personal information.
  • the disclosed technical solution involves sensitive personal information the products applying the disclosed technical solution have obtained individual consent before processing sensitive personal information, and at the same time meet the requirement of "express consent". For example, at a personal information collection device such as a camera, a clear and prominent sign is set up to inform that it has entered the scope of personal information collection, and personal information will be collected.
  • the personal information processing rules may include Information processor, purpose of personal information processing, processing method, type of personal information processed and other information.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Theoretical Computer Science (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Human Computer Interaction (AREA)
  • Biomedical Technology (AREA)
  • Signal Processing (AREA)
  • Image Analysis (AREA)
  • Studio Devices (AREA)

Abstract

Embodiments of the present disclosure provide a photographing apparatus obstruction detection method and apparatus, an electronic device, a storage medium, and a computer program product. The method comprises: acquiring video data of a scene area by means of a photographing apparatus; performing human face detection on a current image frame in the video data, and when no human face is detected, determining an average pixel value of the current image frame; when the average pixel value of the current image frame is less than a preset reference threshold, inverting pixel values of pixels in the current image frame, to obtain an inverted image; and on the basis of the inverted image, determining whether the photographing apparatus is obstructed. Embodiments of the present disclosure can improve the obstruction detection accuracy of a photographing apparatus.

Description

摄像装置遮挡检测方法、装置、电子设备、存储介质及计算机程序产品Method, device, electronic device, storage medium, and computer program product for occlusion detection of camera device
相关申请的交叉引用Cross References to Related Applications
本公开实施例基于申请号为202111668682.X、申请日为2021年12月31日、申请名称为“摄像装置遮挡检测方法、装置、电子设备及存储介质”的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此以引入方式并入本公开。The embodiment of the present disclosure is based on the Chinese patent application with the application number 202111668682.X, the application date is December 31, 2021, and the application name is "Camera Blocking Detection Method, Device, Electronic Equipment, and Storage Medium", and requires the Chinese Priority of the patent application, the entire content of the Chinese patent application is hereby incorporated by reference into this disclosure.
技术领域technical field
本公开实施例涉及图像处理技术领域,尤其涉及一种摄像装置遮挡检测方法、装置、电子设备、存储介质及计算机程序产品。Embodiments of the present disclosure relate to the technical field of image processing, and in particular, to a camera device occlusion detection method, device, electronic equipment, storage medium, and computer program product.
背景技术Background technique
随着图像处理的技术发展,基于图像进行场景分析、行为决策已经应用至越来越多的场景中。大多数场景中,图像处理依赖于摄像装置采集高质量的图像,如果摄像装置被遮挡,则难以获得包含有效信息的图像,进而增加了基于图像的场景分析和行为决策难度。With the development of image processing technology, scene analysis and behavior decision-making based on images have been applied to more and more scenes. In most scenarios, image processing relies on the camera to capture high-quality images. If the camera is blocked, it is difficult to obtain images containing effective information, which in turn increases the difficulty of image-based scene analysis and behavioral decision-making.
以车舱内驾驶员行为检测场景为例,车舱内的摄像装置可以用于对驾驶员的驾驶行为进行约束,进而减少交通事故发生的几率,从而辅助提升行车安全。然而,在实际使用的过程中,摄像装置会存在被遮挡的情况,而若摄像装置被遮挡,则无法准确检测驾驶员行为,因此,检测摄像装置是否被遮挡以及如何提升摄像装置遮挡检测的精度,显得尤为重要。Taking the driver behavior detection scene in the car cabin as an example, the camera device in the car cabin can be used to restrict the driver's driving behavior, thereby reducing the probability of traffic accidents, thereby helping to improve driving safety. However, in the process of actual use, the camera will be blocked, and if the camera is blocked, the driver's behavior cannot be accurately detected. Therefore, it is necessary to detect whether the camera is blocked and how to improve the accuracy of camera block detection , appears to be particularly important.
发明内容Contents of the invention
本公开实施例至少提供一种摄像装置遮挡检测方法、装置、电子设备、存储介质及计算机程序产品,不仅能够实现对摄像装置的遮挡检测,而且能够提高检测的精度。Embodiments of the present disclosure at least provide a method, device, electronic device, storage medium, and computer program product for occlusion detection of an imaging device, which can not only implement occlusion detection for an imaging device, but also improve detection accuracy.
本公开实施例提供了一种摄像装置遮挡检测方法,包括:An embodiment of the present disclosure provides an occlusion detection method for a camera device, including:
通过摄像装置获取场景区域的视频数据;Obtain video data of the scene area through the camera device;
对所述视频数据中的当前图像帧进行人脸检测,并在未检测到人脸的情况下,确定所述当前图像帧的像素平均值;Perform face detection on the current image frame in the video data, and determine the pixel average value of the current image frame if no face is detected;
在所述当前图像帧的像素平均值低于预设参考阈值的情况下,对所述当前图像帧中的像素点的像素值进行取反处理,得到取反处理后的图像;In the case that the pixel average value of the current image frame is lower than the preset reference threshold, performing inversion processing on the pixel values of the pixels in the current image frame to obtain an image after inversion processing;
基于所述取反处理后的图像,确定所述摄像装置是否被遮挡。Based on the inverted image, it is determined whether the camera is blocked.
本公开实施例还提供一种摄像装置遮挡检测装置,包括:An embodiment of the present disclosure also provides an occlusion detection device for an imaging device, including:
第一获取模块,配置为通过摄像装置获取场景区域的视频数据;The first acquisition module is configured to acquire the video data of the scene area through the camera device;
检测模块,配置为对所述视频数据中的当前图像帧进行人脸检测,并在未检测到人脸的情况下,确定所述当前图像帧的像素平均值;A detection module configured to perform face detection on the current image frame in the video data, and determine the pixel average value of the current image frame if no face is detected;
处理模块,配置为在所述当前图像帧的像素平均值低于预设参考阈值的情况下,对所述当前图像帧中的像素点的像素值进行取反处理,得到取反处理后的图像;A processing module configured to perform inversion processing on the pixel values of the pixels in the current image frame when the average value of the pixels in the current image frame is lower than a preset reference threshold, to obtain an image after inversion processing ;
判断模块,配置为基于所述取反处理后的图像,确定所述摄像装置是否被遮挡。The judging module is configured to determine whether the camera is blocked based on the inverted image.
本公开实施例还提供一种电子设备,包括:处理器、存储器和总线,所述存储器存储有所述处理器可执行的机器可读指令,当电子设备运行时,所述处理器与所述存储器之间通过总线通信,所述机器可读指令被所述处理器执行时执行上述任一种可能的实施方式中所述的摄像装置遮挡检测方法。An embodiment of the present disclosure also provides an electronic device, including: a processor, a memory, and a bus, the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the The memories communicate through a bus, and when the machine-readable instructions are executed by the processor, the camera device occlusion detection method described in any one of the foregoing possible implementation manners is executed.
本公开实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有 计算机程序,该计算机程序被处理器运行时执行上述任一种可能的实施方式中所述的摄像装置遮挡检测方法。An embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is run by a processor, the camera device described in any one of the above-mentioned possible implementation manners is executed. Detection method.
本公开实施例还提供了一种计算机程序产品,包括存储了程序代码的计算机可读存储介质,所述程序代码包括的指令被计算机设备的处理器运行时,实现上述方法的步骤。An embodiment of the present disclosure also provides a computer program product, including a computer-readable storage medium storing program codes, and when instructions included in the program codes are executed by a processor of a computer device, the steps of the above method are implemented.
本公开实施例中,对所述视频数据中的当前图像帧进行人脸检测,在未检测到人脸的情况下,确定当前图像帧的像素平均值,并在当前图像帧的像素平均值低于预设参考阈值的情况下,对当前图像帧中的像素点的像素值进行取反处理,然后基于取反处理后的图像,确定摄像装置是否被遮挡,如此,可以在未检测到人脸的情况下,对当前图像帧做进一步判断,并在图像亮度较低的情况下,对图像中的像素点进行取反处理,使得像素值可以映射到更容易观察的像素值范围,提升了摄像装置遮挡状态的判断精度。In the embodiment of the present disclosure, face detection is performed on the current image frame in the video data, and if no face is detected, the pixel average value of the current image frame is determined, and when the pixel average value of the current image frame is low In the case of a preset reference threshold, the pixel value of the pixel in the current image frame is reversed, and then based on the reversed image, it is determined whether the camera is blocked. In this way, no face can be detected In the case of the current image frame, further judgment is made on the current image frame, and in the case of low image brightness, the pixel points in the image are reversed, so that the pixel value can be mapped to an easier-to-observe pixel value range, which improves the image quality. The judgment accuracy of the occlusion state of the device.
应当理解的是,以上的一般描述和后文的细节描述是示例性和解释性的,而非限制本公开。It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory in nature and are not restrictive of the disclosure.
附图说明Description of drawings
为了更清楚地说明本公开实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,此处的附图被并入说明书中并构成本说明书中的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。应当理解,以下附图仅示出了本公开的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to illustrate the technical solutions of the embodiments of the present disclosure more clearly, the following will briefly introduce the accompanying drawings used in the embodiments. The accompanying drawings here are incorporated into the specification and constitute a part of the specification. The drawings show the embodiments consistent with the present disclosure, and are used together with the description to explain the technical solutions of the present disclosure. It should be understood that the following drawings only show some embodiments of the present disclosure, and therefore should not be regarded as limiting the scope. For those skilled in the art, they can also make From these drawings other related drawings are obtained.
图1示出了本公开实施例所提供的第一种摄像装置遮挡检测方法的流程示意图;FIG. 1 shows a schematic flowchart of a first method for occlusion detection of a camera device provided by an embodiment of the present disclosure;
图2示出了本公开实施例所提供的一种确定当前图像帧的像素平均值的方法流程示意图;FIG. 2 shows a schematic flowchart of a method for determining the average value of pixels of a current image frame provided by an embodiment of the present disclosure;
图3示出了本公开实施例所提供的一种对当前图像帧中的像素点的像素值进行取反处理的方法流程示意图;FIG. 3 shows a schematic flowchart of a method for inverting pixel values of pixels in a current image frame provided by an embodiment of the present disclosure;
图4示出了本公开实施例所提供的第二种摄像装置遮挡检测方法的流程示意图;FIG. 4 shows a schematic flowchart of a second method for occlusion detection of a camera provided by an embodiment of the present disclosure;
图5示出了本公开实施例所提供的第三种摄像装置遮挡检测方法的流程示意图;FIG. 5 shows a schematic flowchart of a third method for occlusion detection of a camera device provided by an embodiment of the present disclosure;
图6示出了本公开实施例所提供的第四种摄像装置遮挡检测方法的流程示意图;FIG. 6 shows a schematic flowchart of a fourth method for occlusion detection of a camera device provided by an embodiment of the present disclosure;
图7示出了本公开实施例所提供的一种基于图像的判断结果输出提示信息的方法流程示意图;FIG. 7 shows a schematic flowchart of a method for outputting prompt information based on an image judgment result provided by an embodiment of the present disclosure;
图8示出了本公开实施例所提供的一种摄像装置遮挡检测装置的结构示意图;FIG. 8 shows a schematic structural diagram of an occlusion detection device for a camera device provided by an embodiment of the present disclosure;
图9示出了本公开实施例所提供的另一种摄像装置遮挡检测装置的结构示意图;FIG. 9 shows a schematic structural diagram of another camera device occlusion detection device provided by an embodiment of the present disclosure;
图10示出了本公开实施例所提供的一种电子设备的结构示意图。Fig. 10 shows a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
具体实施方式Detailed ways
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本公开一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本公开实施例的组件可以以各种不同的配置来布置和设计。因此,以下对在附图中提供的本公开的实施例的描述并非旨在限制要求保护的本公开的范围,而是表示本公开的选定实施例。基于本公开的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本公开保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are The present disclosure discloses some embodiments, but not all embodiments. The components of the disclosed embodiments generally described and illustrated in the figures herein may be arranged and designed in a variety of different configurations. Accordingly, the following description of the embodiments of the present disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but represents selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative effort shall fall within the protection scope of the present disclosure.
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。It should be noted that like numerals and letters denote similar items in the following figures, therefore, once an item is defined in one figure, it does not require further definition and explanation in subsequent figures.
本文中术语“和/或”,是描述一种关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。The term "and/or" in this article describes an association relationship, which means that there can be three kinds of relationships, for example, A and/or B, which can mean: A exists alone, A and B exist simultaneously, and B exists independently. Condition. In addition, the term "at least one" herein means any one of a variety or any combination of at least two of the more, for example, including at least one of A, B, and C, which may mean including from A, Any one or more elements selected from the set formed by B and C.
随着图像处理的技术发展,基于图像进行场景分析、行为决策已经应用至越来越多的场景中。大多数场景中,图像处理依赖于摄像装置采集高质量的图像,如果摄像装置被遮挡,则难以获得包含有效信息的图像,进而增加了基于图像的场景分析和行为决策难度。With the development of image processing technology, scene analysis and behavior decision-making based on images have been applied to more and more scenes. In most scenarios, image processing relies on the camera to capture high-quality images. If the camera is blocked, it is difficult to obtain images containing effective information, which in turn increases the difficulty of image-based scene analysis and behavioral decision-making.
以车舱内驾驶员行为检测场景为例,车舱内的摄像装置可以用于对驾驶员的驾驶行为进行约束,进而减少交通事故发生的几率,从而辅助提升行车安全。然而,在实际使用的过程中,摄像装置会存在被遮挡的情况,而若摄像装置被遮挡,则无法准确检测驾驶员行为。Taking the driver behavior detection scene in the car cabin as an example, the camera device in the car cabin can be used to restrict the driver's driving behavior, thereby reducing the probability of traffic accidents, thereby helping to improve driving safety. However, in the process of actual use, the camera device may be blocked, and if the camera device is blocked, the driver's behavior cannot be accurately detected.
经研究发现,现有技术中虽然存在能够对摄像装置是否被遮挡进行检测的方法,比如通过人脸识别的方法来确定摄像装置是否被遮挡,但该方法在图像整体亮度较低时,容易出现误判或者漏判的情况。After research, it is found that although there are methods in the prior art that can detect whether the camera is blocked, such as using face recognition to determine whether the camera is blocked, this method is prone to problems when the overall brightness of the image is low. Misjudgments or omissions.
针对上述问题,本公开实施例提供了一种摄像装置遮挡检测方法,通过摄像装置获取场景区域的视频数据,然后对所述视频数据中的当前图像帧进行人脸检测,在未检测到人脸的情况下,确定当前图像帧的像素平均值,并在当前图像帧的像素平均值低于预设参考阈值的情况下,对当前图像帧中的像素点的像素值进行取反处理,然后基于取反处理后的图像,确定摄像装置是否被遮挡,如此,可以在未检测到人脸的情况下,对当前图像帧做进一步判断,并在图像亮度较低的情况下,对图像中的像素点进行取反处理,使得像素值可以映射到更容易观察的像素值范围,提升了摄像装置遮挡状态的判断精度。In view of the above problems, the embodiment of the present disclosure provides a method for occlusion detection of a camera device. The video data of the scene area is obtained by the camera device, and then the face detection is performed on the current image frame in the video data. In the case of , determine the average value of pixels in the current image frame, and in the case that the average value of pixels in the current image frame is lower than the preset reference threshold, reverse the pixel values of the pixels in the current image frame, and then based on Invert the processed image to determine whether the camera is blocked. In this way, the current image frame can be further judged when no face is detected, and the pixels in the image can be further judged when the image brightness is low. Points are inverted, so that the pixel value can be mapped to an easier-to-observe pixel value range, which improves the accuracy of judging the occlusion state of the camera device.
本公开实施例所提供的摄像装置遮挡检测方法的执行主体可以为具有一定计算能力的电子设备或服务器或其他处理设备,该电子设备可以为移动设备、手持设备、计算设备、车载设备、可穿戴设备等。服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云存储、大数据和人工智能平台等基础云计算服务的云服务器。在一些可能的实现方式中,该摄像装置遮挡检测方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。The execution subject of the method for detecting occlusion of a camera device provided by the embodiments of the present disclosure may be an electronic device or a server or other processing device with certain computing capabilities, and the electronic device may be a mobile device, a handheld device, a computing device, a vehicle device, a wearable equipment etc. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or it can provide basic cloud computing such as cloud services, cloud databases, cloud computing, cloud storage, big data and artificial intelligence platforms. Cloud server for the service. In some possible implementation manners, the camera occlusion detection method may be implemented in a manner in which a processor invokes computer-readable instructions stored in a memory.
下面对本公开实施例提供的摄像装置遮挡检测方法加以说明。The occlusion detection method of the camera device provided by the embodiment of the present disclosure will be described below.
参见图1所示,为本公开实施例提供的第一种摄像装置遮挡检测方法的流程示意图,所述方法包括以下S101至S104:Referring to FIG. 1 , it is a schematic flowchart of a first method for occlusion detection of a camera device provided by an embodiment of the present disclosure, and the method includes the following steps S101 to S104:
S101,通过摄像装置获取场景区域的视频数据。S101. Acquire video data of a scene area through a camera device.
示例性地,摄像装置是指能够实时对当下场景区域进行视频录制的装置。以车舱场景为例,场景区域包括驾驶区域,摄像装置可以安装在车辆内部,用于获取驾驶员在车辆驾驶区域内的视频数据。Exemplarily, the camera device refers to a device capable of recording video of the current scene area in real time. Taking the car cabin scene as an example, the scene area includes the driving area, and the camera device can be installed inside the vehicle to obtain video data of the driver in the driving area of the vehicle.
其中,该摄像装置是驾驶员监控系统(Driver Monitoring System,DMS)的必要硬件。驾驶员监控系统利用摄像头获取图像,通过视觉跟踪、目标检测、动作识别等技术,对驾驶员发生疲劳驾驶、驾驶分心、危险动作等情况进行实时智能检测与提醒,以降低交通事故发生的几率。通过对摄像装置的遮挡状态进行检测,可以在摄像装置被遮挡的情况下及时进行提示以便使摄像装置调整至正常的非遮挡状态,从而辅助提升行车安全。Among them, the camera device is the necessary hardware of the driver monitoring system (Driver Monitoring System, DMS). The driver monitoring system uses the camera to obtain images, and uses technologies such as visual tracking, target detection, and action recognition to perform real-time intelligent detection and reminders of driver fatigue, driving distraction, and dangerous actions to reduce the probability of traffic accidents . By detecting the blocking state of the camera device, prompts can be given in time when the camera device is blocked so that the camera device can be adjusted to a normal non-blocking state, thereby assisting in improving driving safety.
可以理解,其他实施方式中,场景区域还可以是车舱内的全景区域或者车舱内包含所述车辆驾驶区域的其他区域,在此不做限定。It can be understood that in other implementation manners, the scene area may also be a panoramic area in the vehicle cabin or other areas in the vehicle cabin including the driving area of the vehicle, which is not limited herein.
车辆驾驶区域是指驾驶员能够进行车辆驾驶操作的区域。其中,车辆驾驶操作包括但不限于方向盘控制操作、油门踏板控制操作等。当驾驶员在车辆驾驶区域驾驶车辆的过程中,摄像装置会实时对车舱内驾驶员的驾驶行为以及生理状态进行视频采集。The vehicle driving area refers to an area where a driver can perform a vehicle driving operation. Wherein, the vehicle driving operation includes but not limited to a steering wheel control operation, an accelerator pedal control operation, and the like. When the driver is driving the vehicle in the vehicle driving area, the camera device will collect video of the driver's driving behavior and physiological state in the cabin in real time.
需要说明的是,摄像装置的数量可以根据实际需求进行设置。在一些实施例中,可以根据摄像装置的拍摄视角、拍摄范围,或者根据成本等因素进行设置,比如,摄像装置可以是一个,还可以是两个或者三个等,在此不做限定。It should be noted that the number of camera devices may be set according to actual needs. In some embodiments, it can be set according to the shooting angle and shooting range of the camera, or according to factors such as cost. For example, there can be one camera, two or three cameras, etc., which is not limited here.
视频数据是指连续的图像序列,其实质是由一组连续的图像构成的,其中,图像帧(Frame)是组成视频数据的最小视觉单位,是一幅静态的图像。将时间上连续的图像帧序列合成到一起便形成动态视频。因此,为了方便后续的检测,需要提取所述视频数据中的多帧图像。Video data refers to a continuous image sequence, which is essentially composed of a group of continuous images. Among them, an image frame (Frame) is the smallest visual unit of video data, and is a static image. A sequence of temporally continuous image frames is synthesized to form a dynamic video. Therefore, in order to facilitate subsequent detection, it is necessary to extract multiple frames of images in the video data.
示例性地,由于视频数据中每秒钟通常包括多帧图像(比如每秒钟包括24帧图像),因此,在提取所述实时视频数据中的图像的过程中,可以进行抽帧提取,其中,抽帧提取是指按照预设的间隔帧数进行抽帧提取,比如,每间隔20帧提取一帧图像;还可以按照预设的时间间隔进行抽帧提取,比如每间隔10毫秒(ms)提取一次图像。Exemplarily, since video data usually includes multiple frames of images per second (for example, 24 frames of images per second), therefore, during the process of extracting images in the real-time video data, frame extraction can be performed, wherein , frame extraction refers to frame extraction according to the preset interval frame number, for example, extracting a frame of image every 20 frames; it can also perform frame extraction according to the preset time interval, such as every interval of 10 milliseconds (ms) Fetch the image once.
需要说明的是,预设的间隔帧数以及时间间隔,可以根据实际需求而设定,在此不做限定。It should be noted that the preset number of frame intervals and the time interval can be set according to actual needs, and are not limited here.
S102,对所述视频数据中的当前图像帧进行人脸检测,并在未检测到人脸的情况下,确定所述当前图像帧的像素平均值。S102. Perform face detection on a current image frame in the video data, and determine an average value of pixels of the current image frame if no face is detected.
其中,当前图像帧是指当前需要进行检测识别处理的图像,视频数据中时序位于当前图像帧之前的图像称为前序图像帧,时序位于当前图像帧之后的图像称为后序图像帧。Among them, the current image frame refers to the image that needs to be detected and recognized currently. In the video data, the image whose time sequence is before the current image frame is called the previous image frame, and the image whose time sequence is after the current image frame is called the subsequent image frame.
示例性地,在前述提取到多帧图像之后,可以对所提取的图像进行人脸检测,以确定当前图像帧中是否存在人脸。在一些实施例中,若当前图像帧中检测到人脸,则说明摄像装置所拍摄的区域中包含人脸,摄像装置未被遮挡;若当前图像帧中未检测到人脸,则需要对当前图像帧做进一步判断以分辨由于摄像装置被遮挡而导致未检测到人脸或摄像装置的采集区域内不存在人脸,以提高判断的精度。Exemplarily, after the aforementioned multiple frames of images are extracted, face detection may be performed on the extracted images to determine whether there is a face in the current image frame. In some embodiments, if a human face is detected in the current image frame, it means that the area captured by the camera device contains a human face, and the camera device is not blocked; The image frame is further judged to distinguish that no human face is detected due to the blocking of the camera device or that there is no human face in the collection area of the camera device, so as to improve the accuracy of judgment.
本实施方式中,若当前图像帧未检测到人脸,则进一步确定当前图像帧的像素平均值。其中,当前图像帧的像素平均值是指当前图像帧中像素点的像素的平均值,用于判断当前图像帧的整体亮暗程度。In this embodiment, if no human face is detected in the current image frame, the pixel average value of the current image frame is further determined. Wherein, the average value of the pixels of the current image frame refers to the average value of the pixels of the pixel points in the current image frame, which is used to judge the overall brightness and darkness of the current image frame.
S103,在所述当前图像帧的像素平均值低于预设参考阈值的情况下,对所述当前图像帧中的像素点的像素值进行取反处理,得到取反处理后的图像。S103. In the case that the average value of pixels in the current image frame is lower than a preset reference threshold, perform inversion processing on the pixel values of the pixels in the current image frame to obtain an inversion-processed image.
在确定当前图像帧的像素平均值后,若当前图像帧的像素平均值低于预设参考阈值,则说明当前图像帧较暗,为了提升判断精度,可以对当前图像帧中的像素点的像素值进行取反处理。After determining the average value of the pixels of the current image frame, if the average value of the pixels of the current image frame is lower than the preset reference threshold, it means that the current image frame is darker. In order to improve the judgment accuracy, the pixels of the pixels in the current image frame can be The value is negated.
可以理解,预设参考阈值可以根据摄像装置所处的场景而确定,比如,驾驶区域的背景多为亮色,则此时的预设参考阈值可以相应的设置为较高的值,而若驾驶区域的背景多为暗色,则此时的预设参考阈值可以相应的设置为较低的值,如此,可以进一步提升判断的精度。It can be understood that the preset reference threshold can be determined according to the scene where the camera device is located. For example, if the background of the driving area is mostly bright, the preset reference threshold at this time can be set to a relatively high value, and if the driving area If the background is mostly dark, the preset reference threshold at this time can be set to a lower value accordingly, so that the accuracy of judgment can be further improved.
其中,当前图像帧中会有很多个像素点(比如320*320),而每个像素点共有256个灰度等级,也即每个像素点的像素值在0至255之间,根据当前图像帧平均像素值可以判断当前图像帧的亮暗程度,在一些实施方式中,预设参考阈值可以设为80,若 低于该预设参考阈值,则证明当前图像帧的整体较暗。Among them, there will be many pixels in the current image frame (such as 320*320), and each pixel has a total of 256 gray levels, that is, the pixel value of each pixel is between 0 and 255, according to the current image The frame average pixel value can determine the brightness and darkness of the current image frame. In some embodiments, the preset reference threshold can be set to 80. If it is lower than the preset reference threshold, it proves that the current image frame is overall dark.
在一些实施例中,取反处理是指通过反转将图像的像素值映射到更易分析的像素值范围的处理方式,也即取反处理是用像素值255减去当前像素点的像素值,得到取反后的像素值,比如,当前图像帧中的像素点的像素值为103,取反处理后的像素值为152。In some embodiments, the inversion process refers to the processing method of mapping the pixel value of the image to a range of pixel values that is easier to analyze by inversion, that is, the inversion process is to subtract the pixel value of the current pixel point from the pixel value 255, The inverted pixel value is obtained. For example, the pixel value of a pixel in the current image frame is 103, and the inverted pixel value is 152.
S104,基于所述取反处理后的图像,确定所述摄像装置是否被遮挡。S104. Based on the inverted image, determine whether the camera is blocked.
在对当前图像帧中的像素点的像素值进行取反处理后,基于取反处理后的图像,确定摄像装置是否被遮挡。After inverting the pixel values of the pixels in the current image frame, it is determined whether the camera is blocked based on the inverted image.
本公开实施例中,对所述视频数据中的当前图像帧进行人脸检测,在未检测到人脸的情况下,确定当前图像帧的像素平均值,并在当前图像帧的像素平均值低于预设参考阈值的情况下,对当前图像帧中的像素点的像素值进行取反处理,然后基于取反处理后的图像,确定摄像装置是否被遮挡,如此,可以在未检测到人脸的情况下,对当前图像帧做进一步判断,并在图像亮度较低的情况下,对图像中的像素点进行取反处理,使得像素值可以映射到更容易分析的像素值范围,提升了摄像装置遮挡状态的判断精度。In the embodiment of the present disclosure, face detection is performed on the current image frame in the video data, and if no face is detected, the pixel average value of the current image frame is determined, and when the pixel average value of the current image frame is low In the case of a preset reference threshold, the pixel value of the pixel in the current image frame is reversed, and then based on the reversed image, it is determined whether the camera is blocked. In this way, no face can be detected In the case of the current image frame, further judgment is made on the current image frame, and in the case of low image brightness, the pixel points in the image are reversed, so that the pixel value can be mapped to the pixel value range that is easier to analyze, which improves the image quality. The judgment accuracy of the occlusion state of the device.
针对上述S102,参见图2所示,为本公开实施例所提供的一种确定当前图像帧的像素平均值的方法流程示意图,包括以下S1021和S1022:For the above S102, see FIG. 2 , which is a schematic flowchart of a method for determining the average value of pixels of a current image frame provided by an embodiment of the present disclosure, including the following S1021 and S1022:
S1021,在未检测到人脸的情况下,对所述当前图像帧进行降噪处理。S1021. If no human face is detected, perform noise reduction processing on the current image frame.
S1022,确定所述降噪处理后的当前图像帧的像素平均值。S1022. Determine an average value of pixels of the current image frame after the noise reduction processing.
在确定未检测到人脸后,对当前图像帧进行降噪处理。其中,噪声是图像干扰的重要原因,一帧图像在实际应用中可能存在各种各样的噪声,这些噪声可能在传输中产生,也可能在量化等处理中产生。因此,降低图像中噪声的过程十分重要,通过降噪处理可以提升当前图像帧的像素平均值的确定精度。After it is determined that no human face is detected, noise reduction processing is performed on the current image frame. Among them, noise is an important cause of image interference, and a frame of image may have various noises in practical applications, and these noises may be generated during transmission or quantization and other processing. Therefore, the process of reducing noise in the image is very important, and the determination accuracy of the pixel average value of the current image frame can be improved through noise reduction processing.
本公开实施例,采用高斯平滑算法进行降噪处理,该高斯平滑应用于模糊图像中,用于将整个图像过渡均匀平滑,去除细节,降低成像雪花噪声,使得当前图像帧更加清晰,进而有利于提升像素平均值的确定精度。在其他实施例中,降噪处理还可以采用中值滤波算法或者均值滤波算法进行降噪处理,此处不做限定。In the embodiment of the present disclosure, the Gaussian smoothing algorithm is used for noise reduction processing, and the Gaussian smoothing is applied to the blurred image to uniformly smooth the transition of the entire image, remove details, reduce imaging snowflake noise, and make the current image frame clearer, which is beneficial to Improve the accuracy of determination of pixel average value. In other embodiments, the noise reduction processing may also use a median filtering algorithm or an average filtering algorithm to perform the noise reduction processing, which is not limited here.
针对上述S103,参见图3所示,为本公开实施例所提供的一种对当前图像帧中的像素点的像素值进行取反处理的方法流程示意图,包括以下S1031和S1032:For the above S103, see FIG. 3 , which is a schematic flowchart of a method for inverting the pixel value of a pixel in the current image frame provided by the embodiment of the present disclosure, including the following S1031 and S1032:
S1031,从所述当前图像帧中的像素点中确定目标像素点,其中,所述目标像素点的像素值大于第一预设像素值,且小于第二预设像素值。S1031. Determine a target pixel point from pixels in the current image frame, where a pixel value of the target pixel point is greater than a first preset pixel value and smaller than a second preset pixel value.
可以理解,虽然当前图像帧的平均像素值低于预设参考阈值,但不代表当前图像帧中的每个像素点的像素值都很低,而对于当前图像帧中像素值较高的像素点,则无需进行取反处理,因此,在取反处理之前,要进一步确定需要进行取反处理的目标像素点。本实施方式中,将当前图像帧中像素值大于第一预设像素值,且小于第二预设像素值的像素点作为目标像素点。比如,第一预设像素值可以设置为90,第二预设像素值可以设置为150,若像素点的像素值大于第一预设像素值且小于第二预设像素值,则证明该像素点较暗,需要对该像素点进行像素值取反处理。It can be understood that although the average pixel value of the current image frame is lower than the preset reference threshold, it does not mean that the pixel value of each pixel in the current image frame is very low, and for pixels with higher pixel values in the current image frame , then there is no need to perform inversion processing. Therefore, before the inversion processing, it is necessary to further determine the target pixel points that need to be inversion processing. In this embodiment, a pixel point in the current image frame whose pixel value is greater than the first preset pixel value and smaller than the second preset pixel value is used as the target pixel point. For example, the first preset pixel value can be set to 90, and the second preset pixel value can be set to 150. If the pixel value of the pixel point is greater than the first preset pixel value and smaller than the second preset pixel value, it proves that the pixel The point is darker, and the pixel value of the pixel point needs to be reversed.
需要说明的是,第一预设像素值以及第二预设像素值由摄像装置的成像参数确定,而摄像装置的成像参数决定了摄像装置的成像效果的好坏,也即,若摄像装置的成像效果优于其他摄像装置,则第一预设像素值以及第二预设像素值可以设置成较高的像素值,如此,可以更加精准的判断摄像装置的遮挡状态。It should be noted that the first preset pixel value and the second preset pixel value are determined by the imaging parameters of the camera device, and the imaging parameters of the camera device determine the quality of the imaging effect of the camera device, that is, if the camera device If the imaging effect is better than other camera devices, the first preset pixel value and the second preset pixel value can be set to higher pixel values, so that the blocking state of the camera device can be judged more accurately.
本公开实施例,还设置了第三预设像素值,若像素点的像素值小于第一预设像素值,则证明该像素点为黑色像素点;若像素点的像素值大于第一预设像素值且小于第 二预设像素值,则证明该像素点较暗;若像素点的像素值大于第二预设像素值且小于第三预设像素值,则证明该像素点为正常亮度;若像素点的像素值大于第三预设像素值,则证明该像素点为白色像素点。In the embodiment of the present disclosure, a third preset pixel value is also set. If the pixel value of the pixel point is smaller than the first preset pixel value, it proves that the pixel point is a black pixel point; if the pixel value of the pixel point is greater than the first preset pixel value If the pixel value is less than the second preset pixel value, it proves that the pixel point is darker; if the pixel value of the pixel point is greater than the second preset pixel value and smaller than the third preset pixel value, it proves that the pixel point is of normal brightness; If the pixel value of the pixel point is greater than the third preset pixel value, it is proved that the pixel point is a white pixel point.
S1032,对所述目标像素点的像素值进行取反处理。S1032. Perform inversion processing on the pixel value of the target pixel point.
示例性地,在确定所述当前图像帧的像素平均值低于预设参考阈值后,从当前图像帧中的像素点中确定目标像素点,并对目标像素点的像素值进行取反处理,如此,可以基于第一预设像素值以及第二预设像素值,确定当前图像帧中比较暗的像素点,并对该像素点的像素值进行取反,从而提高摄像装置遮挡状态的判断精度。Exemplarily, after determining that the average value of the pixels of the current image frame is lower than the preset reference threshold, determining the target pixel from the pixels in the current image frame, and performing inverse processing on the pixel value of the target pixel, In this way, based on the first preset pixel value and the second preset pixel value, a relatively dark pixel point in the current image frame can be determined, and the pixel value of the pixel point can be reversed, thereby improving the judgment accuracy of the occlusion state of the camera device .
参见图4所示,为本公开实施例所提供的第二种摄像装置遮挡检测方法的流程示意图,包括以下S201至S210:Referring to FIG. 4 , it is a schematic flow chart of the second camera device occlusion detection method provided by the embodiment of the present disclosure, including the following S201 to S210:
S201,通过摄像装置获取场景区域的视频数据。S201. Acquire video data of a scene area through a camera device.
其中,场景区域可以例如是车辆驾驶区域。该步骤与图1中的步骤S101类似。Wherein, the scene area may be, for example, a vehicle driving area. This step is similar to step S101 in FIG. 1 .
S202,对所述视频数据中的当前图像帧进行人脸检测,并判断当前图像帧中是否存在人脸;若是,则执行步骤S210;若否,则执行步骤S203。S202. Perform face detection on the current image frame in the video data, and determine whether there is a human face in the current image frame; if yes, execute step S210; if not, execute step S203.
该步骤与图1中的步骤S102类似。This step is similar to step S102 in FIG. 1 .
S203,确定所述当前图像帧的像素平均值。S203. Determine the pixel average value of the current image frame.
该步骤与图1中的步骤S102类似。This step is similar to step S102 in FIG. 1 .
S204,判断所述当前图像帧的像素平均值是否低于预设参考阈值;若是,则执行步骤S206;若否,则执行步骤S205。S204. Determine whether the average value of pixels of the current image frame is lower than a preset reference threshold; if yes, perform step S206; if not, perform step S205.
示例性地,若当前图像帧的像素平均值低于预设参考阈值,说明当前图像帧较暗,需要执行步骤S206,对当前图像帧的像素点进行取反处理,以提高判断精度;若当前图像帧的像素平均值不低于预设参考阈值,说明当前图像帧的亮度正常,此时执行步骤S205确定当前图像帧的最大联通域。For example, if the average value of the pixels of the current image frame is lower than the preset reference threshold, it means that the current image frame is relatively dark, and step S206 needs to be performed to invert the pixels of the current image frame to improve the judgment accuracy; if the current If the average pixel value of the image frame is not lower than the preset reference threshold, it means that the brightness of the current image frame is normal. At this time, step S205 is performed to determine the maximum connected area of the current image frame.
S205,确定所述当前图像帧的最大连通域。S205. Determine the maximum connected domain of the current image frame.
其中,最大连通域是指具有相同像素值或者在一定误差之内的所有像素值且位置相邻的像素点组成的图像区域。比如,预设面积阈值可以设为整张图像的60%的区域的面积,若最大连通域超出该预设面积阈值,则确定摄像装置被遮挡。需要说明的是,最大连通域是一个闭合的区域。Among them, the maximum connected domain refers to the image area composed of all pixel values with the same pixel value or within a certain error and adjacent to each other. For example, the preset area threshold may be set to an area of 60% of the entire image, and if the largest connected domain exceeds the preset area threshold, it is determined that the camera is blocked. It should be noted that the maximum connected domain is a closed area.
本实施方式中,在确定当前图像帧的最大连通域后,可直接执行步骤S208。In this embodiment, after the maximum connected domain of the current image frame is determined, step S208 may be directly executed.
S206,对所述当前图像帧中的像素点的像素值进行取反处理,得到取反处理后的图像。S206. Perform inversion processing on the pixel values of the pixel points in the current image frame to obtain an inversion-processed image.
该步骤与图1中的步骤S103类似。This step is similar to step S103 in FIG. 1 .
S207,确定所述取反处理后的图像中的最大连通域。S207. Determine the maximum connected domain in the image after the inversion process.
该步骤与步骤S205类似。This step is similar to step S205.
S208,判断所述最大连通域的面积是否大于预设面积阈值;若是,则执行步骤S209;若否,则执行步骤S210。S208, judging whether the area of the largest connected domain is greater than a preset area threshold; if yes, execute step S209; if not, execute step S210.
示例性地,若所述最大连通域的面积大于预设面积阈值,则执行S209步骤,确定摄像装置被遮挡;若所述最大连通域的面积小于或等于预设面积阈值,则执行S210步骤,确定摄像装置未被遮挡。Exemplarily, if the area of the largest connected domain is greater than the preset area threshold, then perform step S209 to determine that the camera is blocked; if the area of the largest connected domain is less than or equal to the preset area threshold, then perform step S210, Make sure the camera is not blocked.
需要说明的是,预设面积阈值可以通过整张图像帧的面积大小来确定,也即,若该图像的面积较大,则预设面积阈值可以设置成较大的阈值,如此,可以更加精准的判断摄像装置的遮挡状态。It should be noted that the preset area threshold can be determined by the area size of the entire image frame, that is, if the image has a larger area, the preset area threshold can be set to a larger threshold, so that it can be more accurate to determine the blocking state of the camera.
S209,确定所述当前图像帧的遮挡检测结果为所述摄像装置被遮挡。S209. Determine that the occlusion detection result of the current image frame is that the camera is occluded.
S210,确定所述当前图像帧的遮挡检测结果为所述摄像装置未被遮挡。S210. Determine that the occlusion detection result of the current image frame is that the camera is not occluded.
参见图5所示,为本公开实施例所提供的第三种摄像装置遮挡检测方法的流程示意图,该方法与图4中的方法不同的是,在步骤S208之后还包括以下S211至S213:Referring to FIG. 5 , it is a schematic flowchart of a third method for occlusion detection of a camera device provided by an embodiment of the present disclosure. This method is different from the method in FIG. 4 in that it also includes the following S211 to S213 after step S208:
S211,确定所述视频数据中所述当前图像帧之前和之后中至少之一的至少一帧图像取反处理后的图像中的最大连通域。S211. Determine a maximum connected domain in an image of at least one frame of image before and after at least one of the current image frame in the video data after inversion processing.
可以理解的是,在确定取反处理后的图像的最大连通域的面积大于预设面积阈值后,需要进一步确定视频数据中所述当前图像帧之前和之后中的至少之一的至少一帧图像取反处理后的图像中的最大连通域,降低因突变情况而造成误判的情况,其中,突变情况是指突然遮挡摄像装置,或者突然不遮挡摄像装置。It can be understood that after it is determined that the area of the largest connected domain of the image after inversion processing is greater than the preset area threshold, it is necessary to further determine at least one frame of image in at least one of before and after the current image frame in the video data The maximum connected domain in the image after inversion processing is taken to reduce the misjudgment caused by the sudden change, wherein the sudden change refers to suddenly blocking the camera device, or suddenly not blocking the camera device.
S212,确定所述当前图像帧取反处理后的图像中,以及所述当前图像帧之前和之后中的至少之一的至少一帧图像取反处理后的图像中的最大连通域的面积的平均值。S212. Determine the average of the area of the largest connected domain in the image after the inversion processing of the current image frame, and at least one frame of image before and after the current image frame. value.
对于视频数据中所述当前图像帧之前和之后中的至少之一的至少一帧图像,在确定其取反处理后的图像中的最大连通域后,需要进一步确定当前图像帧取反处理后的图像中,以及当前图像帧之前和之后中的至少之一的至少一帧图像取反处理后的图像中的最大连通域的面积的平均值。For at least one frame of image in at least one of before and after the current image frame in the video data, after determining the maximum connected domain in the image after its inversion processing, it is necessary to further determine the current image frame after inversion processing In the image, and at least one frame of image before and after the current image frame is taken as an average value of the area of the largest connected domain in the image after inverse processing.
其中,平均数是指在一组数据中所有数据之和再除以这组数据的个数,用于反映一组数据的平均水平。Among them, the average refers to the sum of all data in a set of data divided by the number of this set of data, which is used to reflect the average level of a set of data.
S213,判断所述平均值是否大于所述预设面积阈值;若是,则执行步骤S209;若否,则执行步骤S210。S213, judging whether the average value is greater than the preset area threshold; if yes, execute step S209; if not, execute step S210.
在确定当前图像帧取反处理后的图像中,以及当前图像帧之前和之后中的至少之一的至少一帧图像取反处理后的图像中的最大连通域的面积的平均值后,若该平均值大于预设面积阈值,则确定摄像装置被遮挡,如此,可以通过确定最大连通域的面积的平均值来排除突变情况,使得摄像装置的遮挡状态不受突变情况的影响,进而可以提高判断摄像装置的遮挡状态的准确度。After determining the average value of the area of the largest connected domain in the image after the inverse processing of the current image frame and at least one frame of image before and after the current image frame, if the If the average value is greater than the preset area threshold, it is determined that the camera is blocked. In this way, the sudden change can be ruled out by determining the average value of the area of the largest connected domain, so that the occlusion state of the camera is not affected by the sudden change, and the judgment can be improved. The accuracy of the occlusion state of the camera.
S209,确定所述当前图像帧的遮挡检测结果为所述摄像装置被遮挡。S209. Determine that the occlusion detection result of the current image frame is that the camera is occluded.
S210,确定所述当前图像帧的遮挡检测结果为所述摄像装置未被遮挡。S210. Determine that the occlusion detection result of the current image frame is that the camera is not occluded.
参见图6所示,为本公开实施例所提供的第四种摄像装置遮挡检测方法的流程示意图,该方法与图1中的方法不同的是,在步骤S104之后还包括以下S105:Referring to FIG. 6 , it is a schematic flowchart of a fourth method for occlusion detection of an imaging device provided by an embodiment of the present disclosure. The difference between this method and the method in FIG. 1 is that after step S104, the following S105 is also included:
S105,在确定所述摄像装置被遮挡的情况下,输出第一提示信息。S105. Output first prompt information if it is determined that the camera is blocked.
示例性地,若确定所述摄像装置被遮挡,则输出摄像装置被遮挡的第一提示信息,如此,可以提示驾驶员摄像装置被遮挡,使得驾驶员更加清楚地了解摄像装置的遮挡状态,并对遮挡的摄像装置进行处理,进而注意自己的驾驶行为并调整,从而在提升驾驶的安全性的同时提升了驾驶员的用车体验。Exemplarily, if it is determined that the camera is blocked, then output the first prompt information that the camera is blocked, so that the driver can be prompted that the camera is blocked, so that the driver can more clearly understand the blocking state of the camera, and Process the blocked camera device, and then pay attention to your own driving behavior and adjust it, so as to improve driving safety and improve the driver's car experience.
其中,提示信息包括但不限于语音提示信息、声音(比如警报声)提示信息、图文提示信息等。Wherein, the prompt information includes but not limited to voice prompt information, sound (such as alarm sound) prompt information, graphic prompt information, and the like.
针对上述S105,参见图7所示,为本公开实施例所提供的一种基于图像的判断结果输出提示信息的方法流程示意图,该方法包括以下S1051和S1052:For the above S105, see FIG. 7 , which is a schematic flow chart of a method for outputting prompt information based on an image-based judgment result provided by an embodiment of the present disclosure. The method includes the following S1051 and S1052:
S1051,根据所述视频数据中各帧图像的摄像装置检测结果,确定所述摄像装置的持续遮挡时间。S1051. Determine the continuous shielding time of the camera according to the detection result of the camera in each frame of image in the video data.
S1052,在所述持续遮挡时间达到预设时间的情况下,输出所述第一提示信息。S1052. Output the first prompt information when the continuous shielding time reaches a preset time.
示例性地,根据所述视频数据中各帧图像的摄像装置检测结果,确定所述摄像装置的持续遮挡时间,若所述持续遮挡时间达到预设时间,则输出第一提示信息,如此,在摄像装置持续遮挡的情况下,输出第一提示信息,减少频繁的输出提示信息的情况的发生。Exemplarily, according to the camera detection results of each frame of image in the video data, the continuous occlusion time of the camera is determined, and if the continuous occlusion time reaches a preset time, a first prompt message is output, thus, in When the camera continues to be blocked, the first prompt information is output to reduce the occurrence of frequent output of prompt information.
本实施方式中,在当前图像帧确定摄像装置遮挡的情况下,还要确定后帧图像的 判断结果是否也为遮挡,若至少一帧后帧图像判断摄像装置未被遮挡,则说明,当前遮挡只是闪现,此时,则不输出第一提示信息;若至少一帧后帧图像的判断结果也为摄像装置被遮挡,也即连续多帧图像都判断摄像装置被遮挡,说明此时摄像装置被持续遮挡,是有意遮挡,并不是误遮挡,且在所述持续遮挡时间达到预设时间(比如5秒钟)的情况下,输出第一提示信息以进行提示。In this embodiment, when the current image frame determines that the camera is blocked, it is also necessary to determine whether the judgment result of the subsequent frame image is also blocked. It just flashes, and at this time, the first prompt information is not output; if the judgment result of the frame image after at least one frame is also that the camera is blocked, that is, it is judged that the camera is blocked for multiple consecutive frames of images, it means that the camera is blocked at this time. Continuous occlusion is intentional occlusion, not false occlusion, and when the continuous occlusion time reaches a preset time (for example, 5 seconds), first prompt information is output for prompting.
在一些可能的实施方式中,以五帧图像为例,若前四帧图像都被遮挡,且通过对遮挡时间进行累计,发现遮挡时间为4s,而预设时间为3s,则确定摄像装置持续被遮挡,此时,输出摄像装置被遮挡的第一提示信息。In some possible implementations, taking five frames of images as an example, if the first four frames of images are all blocked, and by accumulating the blocking time, it is found that the blocking time is 4s, and the preset time is 3s, then it is determined that the camera lasts is blocked, at this time, output the first prompt information that the camera is blocked.
在另一些可能的实施方式中,以五帧图像为例,若前两帧图像都被遮挡,而从第三帧图像开始未被遮挡,通过对前两帧遮挡时间进行累计,发现遮挡时间为2s,而预设时间为3s,则说明遮挡是暂时遮挡,此时,则不输出第一提示信息。In some other possible implementations, taking five frames of images as an example, if the first two frames of images are blocked and the third frame of images is not blocked, by accumulating the blocking time of the first two frames, it is found that the blocking time is 2s, and the preset time is 3s, it means that the occlusion is a temporary occlusion, and at this time, the first prompt message will not be output.
在一些可能的实施方式中,当场景区域包括车辆驾驶区域时,在根据上述方法检测到摄像装置未被遮挡的情况下,可以进一步获取车辆的状态信息,并根据车辆的状态信息确定当前图像帧对应的时刻车辆是否处于行驶状态。如果确定车辆处于行驶状态,由于此时未从当前图像帧中检测到人脸,且摄像装置未被遮挡,可以认为车辆的驾驶员离开了驾驶区域或者发生了驾驶员扭头朝向车后的情况,这时,可以生成驾驶员离岗的第二提示信息。以便在车辆行驶中精准地检测并提示驾驶员离开驾驶区域或扭头朝向后排的情况。在一些实施例中,如果车辆处于非行驶状态,例如车辆驻停的情况下,驾驶员可能离开驾驶区域,这时如果确定摄像装置未被遮挡,在车辆驾驶区域不存在人脸的情况下可以不发出报警或提示。In some possible implementations, when the scene area includes the driving area of the vehicle, in the case that the camera is detected to be unobstructed according to the above method, the state information of the vehicle may be further acquired, and the current image frame may be determined according to the state information of the vehicle Whether the vehicle is in a driving state at the corresponding moment. If it is determined that the vehicle is in a driving state, since no human face is detected from the current image frame at this time and the camera is not blocked, it can be considered that the driver of the vehicle has left the driving area or the driver turned his head towards the rear of the car. At this time, the second prompt information for the driver leaving the post may be generated. In order to accurately detect and prompt the driver to leave the driving area or turn his head towards the rear while the vehicle is running. In some embodiments, if the vehicle is in a non-driving state, such as when the vehicle is parked, the driver may leave the driving area, and if it is determined that the camera is not blocked, it can No alarm or prompt is issued.
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。Those skilled in the art can understand that in the above method of specific implementation, the writing order of each step does not mean a strict execution order and constitutes any limitation on the implementation process. The specific execution order of each step should be based on its function and possible The inner logic is OK.
基于同一发明构思,本公开实施例中还提供了与摄像装置遮挡检测方法对应的摄像装置遮挡检测装置,由于本公开实施例中的装置解决问题的原理与本公开实施例上述摄像装置遮挡检测方法相似,因此装置的实施可以参见方法的实施。Based on the same inventive concept, the embodiment of the present disclosure also provides a camera device occlusion detection device corresponding to the camera device occlusion detection method, because the principle of solving the problem of the device in the embodiment of the present disclosure is the same as the above-mentioned camera device occlusion detection method in the embodiment of the present disclosure Similarly, the implementation of the device can refer to the implementation of the method.
参照图8所示,为本公开实施例提供的一种摄像装置遮挡检测装置的结构示意图,所述装置500包括:Referring to FIG. 8 , which is a schematic structural diagram of an occlusion detection device for a camera device provided by an embodiment of the present disclosure, the device 500 includes:
第一获取模块501,配置为通过摄像装置获取场景区域的视频数据;The first acquiring module 501 is configured to acquire the video data of the scene area through the camera device;
检测模块502,配置为对当前图像帧进行人脸检测,并在未检测到人脸的情况下,确定所述当前图像帧的像素平均值;The detection module 502 is configured to perform face detection on the current image frame, and determine the pixel average value of the current image frame when no face is detected;
处理模块503,配置为在所述当前图像帧的像素平均值低于预设参考阈值的情况下,对所述当前图像帧中的像素点的像素值进行取反处理,得到取反处理后的图像;The processing module 503 is configured to perform inversion processing on the pixel values of the pixels in the current image frame when the average value of the pixels in the current image frame is lower than a preset reference threshold, to obtain the inversion processing image;
判断模块504,配置为基于所述取反处理后的图像,确定所述摄像装置是否被遮挡。The judging module 504 is configured to determine whether the camera is blocked based on the inverted image.
在一种可能的实施方式中,所述处理模块503还配置为:In a possible implementation manner, the processing module 503 is further configured to:
从所述当前图像帧中的像素点中确定目标像素点,其中,所述目标像素点的像素值大于第一预设像素值,且小于第二预设像素值;determining a target pixel point from pixels in the current image frame, wherein the pixel value of the target pixel point is greater than a first preset pixel value and smaller than a second preset pixel value;
对所述目标像素点的像素值进行取反处理。Negative processing is performed on the pixel value of the target pixel point.
在一种可能的实施方式中,所述第一预设像素值以及所述第二预设像素值由所述摄像装置的成像参数确定。In a possible implementation manner, the first preset pixel value and the second preset pixel value are determined by imaging parameters of the camera device.
在一种可能的实施方式中,所述判断模块504还配置为:In a possible implementation manner, the judging module 504 is further configured to:
确定所述取反处理后的图像中的最大连通域;Determining the largest connected domain in the image after the inversion process;
在所述最大连通域的面积大于预设面积阈值的情况下,确定所述当前图像帧的遮 挡检测结果为所述摄像装置被遮挡。In the case that the area of the largest connected domain is greater than a preset area threshold, it is determined that the occlusion detection result of the current image frame is that the camera is occluded.
在一种可能的实施方式中,所述判断模块504还配置为:In a possible implementation manner, the judging module 504 is further configured to:
在所述最大连通域的面积大于所述预设面积阈值的情况下,确定所述视频数据中所述当前图像帧之前和之后中的至少之一的至少一帧图像取反处理后的图像中的最大连通域;In the case where the area of the largest connected domain is greater than the preset area threshold, determine at least one frame of image in the video data before and after at least one of the current image frame in the image after inversion processing The largest connected domain of ;
确定所述当前图像帧取反处理后的图像中,以及所述当前图像帧之前和之后中的至少之一的至少一帧图像取反处理后的图像中的最大连通域的面积的平均值;Determining the average value of the area of the largest connected domain in the image after the inverse processing of the current image frame, and at least one frame of image before and after the current image frame after inversion processing;
在所述平均值大于所述预设面积阈值的情况下,确定所述当前图像帧的遮挡检测结果为所述摄像装置被遮挡。In a case where the average value is greater than the preset area threshold, it is determined that the occlusion detection result of the current image frame is that the camera is occluded.
参照图9所示,在一种可能的实施方式中,所述装置还包括:Referring to Figure 9, in a possible implementation manner, the device further includes:
第一输出模块505,配置为在确定所述摄像装置被遮挡的情况下,输出第一提示信息。The first output module 505 is configured to output first prompt information when it is determined that the camera is blocked.
在一种可能的实施方式中,所述第一输出模块505还配置为:In a possible implementation manner, the first output module 505 is further configured to:
根据所述视频数据中各帧图像的摄像装置检测结果,确定所述摄像装置的持续遮挡时间;在所述遮挡持续遮挡时间达到预设时间的情况下,输出所述第一提示信息。According to the camera detection results of each frame of image in the video data, determine the continuous shielding time of the camera; when the shielding continuous shielding time reaches a preset time, output the first prompt information.
在一种可能的实施方式中,所述检测模块502还配置为:In a possible implementation manner, the detection module 502 is further configured to:
在未检测到人脸的情况下,对所述当前图像帧进行降噪处理;When no face is detected, perform noise reduction processing on the current image frame;
确定所述降噪处理后的当前图像帧的像素平均值。Determine the pixel average value of the current image frame after the noise reduction processing.
在一种可能的实施方式中,所述场景区域包括车辆驾驶区域,所述装置还包括:In a possible implementation manner, the scene area includes a vehicle driving area, and the device further includes:
第二获取模块,配置为在确定所述摄像装置未被遮挡的情况下,获取车辆的状态信息;The second acquisition module is configured to acquire the status information of the vehicle when it is determined that the camera device is not blocked;
第二输出模块,配置为在根据所述车辆的状态信息确定所述当前图像帧对应的时刻所述车辆处于行驶状态的情况下,生成第二提示信息。The second output module is configured to generate second prompt information when it is determined according to the state information of the vehicle that the vehicle is in a driving state at the moment corresponding to the current image frame.
关于装置中的各模块的处理流程、以及各模块之间的交互流程的描述可以参照上述方法实施例中的相关说明,这里不再详述。For the description of the processing flow of each module in the device and the interaction flow between the modules, reference may be made to the relevant description in the above method embodiment, and details will not be described here.
基于同一技术构思,本公开实施例还提供了一种电子设备。参照图10所示,为本公开实施例提供的一种电子设备700的结构示意图,包括处理器701、存储器702和总线703。其中,存储器702用于存储执行指令,包括内存7021和外部存储器7022;这里的内存7021也称内存储器,用于暂时存放处理器701中的运算数据,以及与硬盘等外部存储器7022交换的数据,处理器701通过内存7021与外部存储器7022进行数据交换。Based on the same technical idea, an embodiment of the present disclosure also provides an electronic device. Referring to FIG. 10 , it is a schematic structural diagram of an electronic device 700 provided by an embodiment of the present disclosure, including a processor 701 , a memory 702 and a bus 703 . Among them, the memory 702 is used to store execution instructions, including a memory 7021 and an external memory 7022; the memory 7021 here is also called an internal memory, and is used to temporarily store calculation data in the processor 701 and exchange data with an external memory 7022 such as a hard disk. The processor 701 exchanges data with the external memory 7022 through the memory 7021 .
本公开实施例中,存储器702用于存储执行本公开方案的应用程序代码,并由处理器701来控制执行。也即,当电子设备700运行时,处理器701与存储器702之间通过总线703通信,使得处理器701执行存储器702中存储的应用程序代码,进而执行前述任一实施例中所揭示的方法。In the embodiment of the present disclosure, the memory 702 is used to store application program codes for executing the solutions of the present disclosure, and the execution is controlled by the processor 701 . That is, when the electronic device 700 is running, the processor 701 communicates with the memory 702 through the bus 703, so that the processor 701 executes the application program code stored in the memory 702, and then executes the methods disclosed in any of the foregoing embodiments.
其中,存储器702可以是,但不限于,随机存取存储器(Random Access Memory,RAM),只读存储器(Read Only Memory,ROM),可编程只读存储器(Programmable Read-Only Memory,PROM),可擦除只读存储器(Erasable Programmable Read-Only Memory,EPROM),电可擦除只读存储器(Electric Erasable Programmable Read-Only Memory,EEPROM)等。Wherein, memory 702 can be, but not limited to, random access memory (Random Access Memory, RAM), read-only memory (Read Only Memory, ROM), programmable read-only memory (Programmable Read-Only Memory, PROM), can Erasable Programmable Read-Only Memory (EPROM), Electric Erasable Programmable Read-Only Memory (EEPROM), etc.
处理器701可能是一种集成电路芯片,具有信号的处理能力。上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,CPU)、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(Digital Signal Processing,DSP)、专用集成电路(Application-Specific Integrated Circuit,ASIC)、现场可编程门阵 列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本公开实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 701 may be an integrated circuit chip with signal processing capabilities. The above-mentioned processor can be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; it can also be a digital signal processor (Digital Signal Processing, DSP), dedicated integrated Circuit (Application-Specific Integrated Circuit, ASIC), Field Programmable Gate Array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. Various methods, steps and logic block diagrams disclosed in the embodiments of the present disclosure may be implemented or executed. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
可以理解的是,本公开实施例示意的结构并不构成对电子设备700的具体限定。在本公开另一些实施例中,电子设备700可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that, the structure illustrated in the embodiment of the present disclosure does not constitute a specific limitation on the electronic device 700 . In other embodiments of the present disclosure, the electronic device 700 may include more or fewer components than shown in the illustration, or combine certain components, or separate certain components, or arrange different components. The illustrated components can be realized in hardware, software or a combination of software and hardware.
本公开实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述方法实施例中所述的摄像装置遮挡检测方法的步骤。其中,该存储介质可以是易失性或非易失的计算机可读取存储介质。An embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is run by a processor, the steps of the camera-device occlusion detection method described in the foregoing method embodiments are executed. . Wherein, the storage medium may be a volatile or non-volatile computer-readable storage medium.
本公开实施例所提供的通行核验方法的计算机程序产品,包括存储了程序代码的计算机可读存储介质,所述程序代码包括的指令可用于执行上述方法实施例中的摄像装置遮挡检测方法的步骤,可参见上述方法实施例。The computer program product of the access verification method provided by the embodiments of the present disclosure includes a computer-readable storage medium storing program codes, and the instructions included in the program codes can be used to execute the steps of the camera device occlusion detection method in the above method embodiments , refer to the above method embodiment.
其中,上述计算机程序产品可以通过硬件、软件或其结合的方式实现。在一个可选实施例中,所述计算机程序产品体现为计算机存储介质,在另一个可选实施例中,计算机程序产品体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。Wherein, the above-mentioned computer program product may be implemented by means of hardware, software or a combination thereof. In an optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK) and the like.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统和装置的工作过程,可以参考前述方法实施例中的对应过程。在本公开所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,又例如,多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些通信接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。Those skilled in the art can clearly understand that for the convenience and brevity of description, for the working process of the above-described system and device, reference may be made to the corresponding process in the foregoing method embodiments. In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods may be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本公开各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个处理器可执行的非易失的计算机可读取存储介质中。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium executable by a processor. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present disclosure. The aforementioned storage medium includes: various media capable of storing program codes such as U disk, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk.
若本公开技术方案涉及个人信息,应用本公开技术方案的产品在处理个人信息前,已明确告知个人信息处理规则,并取得个人自主同意。若本公开技术方案涉及敏感个人信息,应用本公开技术方案的产品在处理敏感个人信息前,已取得个人单独同意,并且同时满足“明示同意”的要求。例如,在摄像头等个人信息采集装置处,设 置明确显著的标识告知已进入个人信息采集范围,将会对个人信息进行采集,若个人自愿进入采集范围即视为同意对其个人信息进行采集;或者在个人信息处理的装置上,利用明显的标识/信息告知个人信息处理规则的情况下,通过弹窗信息或请个人自行上传其个人信息等方式获得个人授权;其中,个人信息处理规则可包括个人信息处理者、个人信息处理目的、处理方式、处理的个人信息种类等信息。If the disclosed technical solution involves personal information, the products applying the disclosed technical solution have clearly notified the personal information processing rules and obtained the individual's independent consent before processing personal information. If the disclosed technical solution involves sensitive personal information, the products applying the disclosed technical solution have obtained individual consent before processing sensitive personal information, and at the same time meet the requirement of "express consent". For example, at a personal information collection device such as a camera, a clear and prominent sign is set up to inform that it has entered the scope of personal information collection, and personal information will be collected. If an individual voluntarily enters the collection scope, it is deemed to agree to the collection of his personal information; or On the personal information processing device, when the personal information processing rules are informed with obvious signs/information, personal authorization is obtained through pop-up information or by asking individuals to upload their personal information; among them, the personal information processing rules may include Information processor, purpose of personal information processing, processing method, type of personal information processed and other information.
最后应说明的是:以上所述实施例,为本公开的实施方式,用以说明本公开的技术方案,而非对其限制,本公开的保护范围并不局限于此,尽管参照前述实施例对本公开进行了详细的说明,本领域的普通技术人员应当理解:任何熟悉本技术领域的技术人员在本公开揭露的技术范围内,其依然可以对前述实施例所记载的技术方案进行修改或可轻易想到变化,或者对其中部分技术特征进行等同替换;而这些修改、变化或者替换,并不使相应技术方案的本质脱离本公开实施例技术方案的精神和范围,都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应所述以权利要求的保护范围为准。Finally, it should be noted that: the above-described embodiments are implementations of the present disclosure, and are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto, although referring to the foregoing embodiments The present disclosure has been described in detail, and those of ordinary skill in the art should understand that: within the technical scope of the present disclosure, any person familiar with the art can still modify the technical solutions described in the foregoing embodiments or can Changes are easily thought of, or equivalent replacements are made to some of the technical features; and these modifications, changes 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 disclosure, and should be covered by the protection of the present disclosure. within range. Therefore, the protection scope of the present disclosure should be defined by the protection scope of the claims.

Claims (21)

  1. 一种摄像装置遮挡检测方法,包括:A camera occlusion detection method, comprising:
    通过摄像装置获取场景区域的视频数据;Obtain video data of the scene area through the camera device;
    对所述视频数据中的当前图像帧进行人脸检测,并在未检测到人脸的情况下,确定所述当前图像帧的像素平均值;Perform face detection on the current image frame in the video data, and determine the pixel average value of the current image frame if no face is detected;
    在所述当前图像帧的像素平均值低于预设参考阈值的情况下,对所述当前图像帧中的像素点的像素值进行取反处理,得到取反处理后的图像;In the case that the pixel average value of the current image frame is lower than the preset reference threshold, performing inversion processing on the pixel values of the pixels in the current image frame to obtain an image after inversion processing;
    基于所述取反处理后的图像,确定所述摄像装置是否被遮挡。Based on the inverted image, it is determined whether the camera is blocked.
  2. 根据权利要求1所述的方法,其中,所述对所述当前图像帧中的像素点的像素值进行取反处理,包括:The method according to claim 1, wherein said inverting the pixel values of the pixels in the current image frame comprises:
    从所述当前图像帧中的像素点中确定目标像素点,其中,所述目标像素点的像素值大于第一预设像素值,且小于第二预设像素值;determining a target pixel point from pixels in the current image frame, wherein the pixel value of the target pixel point is greater than a first preset pixel value and smaller than a second preset pixel value;
    对所述目标像素点的像素值进行取反处理。Negative processing is performed on the pixel value of the target pixel point.
  3. 根据权利要求2所述的方法,其中,所述第一预设像素值以及所述第二预设像素值由所述摄像装置的成像参数确定。The method according to claim 2, wherein the first preset pixel value and the second preset pixel value are determined by imaging parameters of the camera device.
  4. 根据权利要求1至3任一项所述的方法,其中,所述基于所述取反处理后的图像,确定所述摄像装置是否被遮挡,包括:The method according to any one of claims 1 to 3, wherein the determining whether the camera is blocked based on the inversely processed image comprises:
    确定所述取反处理后的图像中的最大连通域;Determining the largest connected domain in the image after the inversion process;
    在所述最大连通域的面积大于预设面积阈值的情况下,确定所述当前图像帧的遮挡检测结果为所述摄像装置被遮挡。In a case where the area of the largest connected domain is greater than a preset area threshold, it is determined that the camera is blocked as a result of the occlusion detection of the current image frame.
  5. 根据权利要求4所述的方法,其中,所述在所述最大连通域的面积大于预设面积阈值的情况下,确定所述当前图像帧的遮挡检测结果为所述摄像装置被遮挡,包括:The method according to claim 4, wherein in the case where the area of the largest connected domain is greater than a preset area threshold, determining that the occlusion detection result of the current image frame is that the camera is occluded comprises:
    在所述最大连通域的面积大于所述预设面积阈值的情况下,确定所述视频数据中所述当前图像帧之前和之后中的至少之一的至少一帧图像取反处理后的图像中的最大连通域;In the case where the area of the largest connected domain is greater than the preset area threshold, determine at least one frame of image in the video data before and after at least one of the current image frame in the image after inversion processing The largest connected domain of ;
    确定所述当前图像帧取反处理后的图像中,以及所述当前图像帧之前和之后中的至少之一的至少一帧图像取反处理后的图像中的最大连通域的面积的平均值;Determining the average value of the area of the largest connected domain in the image after the inverse processing of the current image frame, and at least one frame of image before and after the current image frame after inversion processing;
    在所述平均值大于所述预设面积阈值的情况下,确定所述当前图像帧的遮挡检测结果为所述摄像装置被遮挡。In a case where the average value is greater than the preset area threshold, it is determined that the occlusion detection result of the current image frame is that the camera is occluded.
  6. 根据权利要求1至5任一项所述的方法,其中,所述方法还包括:The method according to any one of claims 1 to 5, wherein the method further comprises:
    在确定所述摄像装置被遮挡的情况下,输出第一提示信息。If it is determined that the camera is blocked, first prompt information is output.
  7. 根据权利要求6所述的方法,其中,所述在确定所述摄像装置被遮挡的情况下,输出第一提示信息,包括:The method according to claim 6, wherein, when it is determined that the camera is blocked, outputting first prompt information includes:
    根据所述视频数据中各帧图像的摄像装置检测结果,确定所述摄像装置的持续遮挡时间;According to the camera detection results of each frame image in the video data, determine the continuous occlusion time of the camera;
    在所述持续遮挡时间达到预设时间的情况下,输出所述第一提示信息。When the continuous shielding time reaches a preset time, the first prompt information is output.
  8. 根据权利要求1至7任一项所述的方法,其中,所述在未检测到人脸的情况下,确定所述当前图像帧的像素平均值,包括:The method according to any one of claims 1 to 7, wherein said determining the pixel average value of said current image frame in the case of no human face is detected comprises:
    在未检测到人脸的情况下,对所述当前图像帧进行降噪处理;When no face is detected, perform noise reduction processing on the current image frame;
    确定所述降噪处理后的当前图像帧的像素平均值。Determine the pixel average value of the current image frame after the noise reduction processing.
  9. 根据权利要求1至8任一项所述的方法,其中,所述场景区域包括车辆驾驶区域,所述方法还包括:The method according to any one of claims 1 to 8, wherein the scene area includes a vehicle driving area, and the method further comprises:
    在确定所述摄像装置未被遮挡的情况下,获取车辆的状态信息;When it is determined that the camera device is not blocked, obtain the state information of the vehicle;
    在根据所述车辆的状态信息确定所述当前图像帧对应的时刻所述车辆处于行驶状态的情况下,生成第二提示信息。When it is determined according to the state information of the vehicle that the vehicle is in a driving state at the time corresponding to the current image frame, second prompt information is generated.
  10. 一种摄像装置遮挡检测装置,包括:A camera blocking detection device, comprising:
    第一获取模块,配置为通过摄像装置获取场景区域的视频数据;The first acquisition module is configured to acquire the video data of the scene area through the camera device;
    检测模块,配置为对所述视频数据中的当前图像帧进行人脸检测,并在未检测到人脸的情况下,确定所述当前图像帧的像素平均值;A detection module configured to perform face detection on the current image frame in the video data, and determine the pixel average value of the current image frame if no face is detected;
    处理模块,配置为在所述当前图像帧的像素平均值低于预设参考阈值的情况下,对所述当前图像帧中的像素点的像素值进行取反处理,得到取反处理后的图像;A processing module configured to perform inversion processing on the pixel values of the pixels in the current image frame when the average value of the pixels in the current image frame is lower than a preset reference threshold, to obtain an image after inversion processing ;
    判断模块,配置为基于所述取反处理后的图像,确定所述摄像装置是否被遮挡。The judging module is configured to determine whether the camera is blocked based on the inverted image.
  11. 根据权利要求10所述的装置,其中,所述处理模块还配置为:从所述当前图像帧中的像素点中确定目标像素点,其中,所述目标像素点的像素值大于第一预设像素值,且小于第二预设像素值;对所述目标像素点的像素值进行取反处理。The device according to claim 10, wherein the processing module is further configured to: determine a target pixel point from the pixels in the current image frame, wherein the pixel value of the target pixel point is greater than a first preset The pixel value is smaller than a second preset pixel value; performing inversion processing on the pixel value of the target pixel point.
  12. 根据权利要求11所述的装置,其中,所述第一预设像素值以及所述第二预设像素值由所述摄像装置的成像参数确定。The device according to claim 11, wherein the first preset pixel value and the second preset pixel value are determined by imaging parameters of the camera device.
  13. 根据权利要求10至12任一项所述的装置,其中,所述判断模块还配置为:确定所述取反处理后的图像中的最大连通域;在所述最大连通域的面积大于预设面积阈值的情况下,确定所述当前图像帧的遮挡检测结果为所述摄像装置被遮挡。The device according to any one of claims 10 to 12, wherein the judging module is further configured to: determine the maximum connected domain in the image after inversion processing; the area of the maximum connected domain is greater than a preset In the case of an area threshold, it is determined that the occlusion detection result of the current image frame is that the camera is occluded.
  14. 根据权利要求13所述的装置,其中,所述判断模块还配置为:在所述最大连通域的面积大于所述预设面积阈值的情况下,确定所述视频数据中所述当前图像帧之前和之后中的至少之一的至少一帧图像取反处理后的图像中的最大连通域;确定所述当前图像帧取反处理后的图像中,以及所述当前图像帧之前和之后中的至少之一的至少一帧图像取反处理后的图像中的最大连通域的面积的平均值;在所述平均值大于所述预设面积阈值的情况下,确定所述当前图像帧的遮挡检测结果为所述摄像装置被遮挡。The device according to claim 13, wherein the judging module is further configured to: when the area of the largest connected domain is greater than the preset area threshold, determine the current image frame in the video data The largest connected domain in the image after at least one frame image of at least one of and after is reversed; determine the image after the current image frame is reversed, and at least one of before and after the current image frame One of at least one frame of image takes the average value of the area of the largest connected domain in the image after inversion processing; in the case where the average value is greater than the preset area threshold, determine the occlusion detection result of the current image frame For the camera is blocked.
  15. 根据权利要求10至14任一项所述的装置,其中,所述装置还包括:The device according to any one of claims 10 to 14, wherein the device further comprises:
    第一输出模块,配置为在确定所述摄像装置被遮挡的情况下,输出第一提示信息。The first output module is configured to output first prompt information when it is determined that the camera is blocked.
  16. 根据权利要求15所述的装置,其中,所述第一输出模块还配置为:根据所述视频数据中各帧图像的摄像装置检测结果,确定所述摄像装置的持续遮挡时间;在所述遮挡持续遮挡时间达到预设时间的情况下,输出所述第一提示信息。The device according to claim 15, wherein the first output module is further configured to: determine the continuous occlusion time of the camera device according to the detection results of the camera device in each frame of image in the video data; When the continuous occlusion time reaches a preset time, the first prompt information is output.
  17. 根据权利要求10至16任一项所述的装置,其中,所述检测模块还配置为:在未检测到人脸的情况下,对所述当前图像帧进行降噪处理;确定所述降噪处理后的当前图像帧的像素平均值。The device according to any one of claims 10 to 16, wherein the detection module is further configured to: perform noise reduction processing on the current image frame when no face is detected; determine the noise reduction Pixel average of the current image frame after processing.
  18. 根据权利要求10至17任一项所述的装置,其中,所述场景区域包括车辆驾驶区域,所述装置还包括:第二获取模块,配置为在确定所述摄像装置未被遮挡的情况下,获取车辆的状态信息;第二输出模块,配置为在根据所述车辆的状态信息确定所述当前图像帧对应的时刻所述车辆处于行驶状态的情况下,生成第二提示信息。The device according to any one of claims 10 to 17, wherein the scene area includes a vehicle driving area, and the device further includes: a second acquisition module configured to determine that the camera is not blocked , acquiring state information of the vehicle; a second output module configured to generate second prompt information when it is determined according to the state information of the vehicle that the vehicle is in a driving state at a time corresponding to the current image frame.
  19. 一种电子设备,包括:处理器、存储器和总线,所述存储器存储有所述处理器可执行的机器可读指令,当电子设备运行时,所述处理器与所述存储器之间通过总线通信,所述机器可读指令被所述处理器执行时执行如权利要求1至9任意一项所述的摄像装置遮挡检测方法。An electronic device, comprising: a processor, a memory, and a bus, the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory through the bus , when the machine-readable instructions are executed by the processor, the camera device occlusion detection method according to any one of claims 1 to 9 is executed.
  20. 一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行如权利要求1至9任意一项所述的摄像装置遮挡检测方法。A computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is run by a processor, the camera-device occlusion detection method according to any one of claims 1 to 9 is executed.
  21. 一种计算机程序产品,包括存储了程序代码的计算机可读存储介质,所述程序代码包括的指令被计算机设备的处理器运行时,实现权利要求1至9中任一项所述方法中的步骤。A computer program product, comprising a computer-readable storage medium storing program code, when the instructions included in the program code are executed by the processor of the computer device, the steps in the method described in any one of claims 1 to 9 are realized .
PCT/CN2022/124951 2021-12-31 2022-10-12 Photographing apparatus obstruction detection method and apparatus, electronic device, storage medium, and computer program product WO2023124387A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111668682.XA CN114332721A (en) 2021-12-31 2021-12-31 Camera device shielding detection method and device, electronic equipment and storage medium
CN202111668682.X 2021-12-31

Publications (1)

Publication Number Publication Date
WO2023124387A1 true WO2023124387A1 (en) 2023-07-06

Family

ID=81021373

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/124951 WO2023124387A1 (en) 2021-12-31 2022-10-12 Photographing apparatus obstruction detection method and apparatus, electronic device, storage medium, and computer program product

Country Status (2)

Country Link
CN (1) CN114332721A (en)
WO (1) WO2023124387A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117424988A (en) * 2023-12-15 2024-01-19 浙江大学台州研究院 Image processing system and processing method for intelligently managing welding machine

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114332721A (en) * 2021-12-31 2022-04-12 上海商汤临港智能科技有限公司 Camera device shielding detection method and device, electronic equipment and storage medium
CN116071724B (en) * 2023-03-03 2023-08-04 安徽蔚来智驾科技有限公司 Vehicle-mounted camera shielding scene recognition method, electronic equipment, storage medium and vehicle
CN115861624B (en) * 2023-03-03 2023-05-30 天津所托瑞安汽车科技有限公司 Method, device, equipment and storage medium for detecting occlusion of camera

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106599783A (en) * 2016-11-09 2017-04-26 浙江宇视科技有限公司 Video occlusion detection method and device
US20170150063A1 (en) * 2013-05-22 2017-05-25 Sony Corporation Signal processor and signal processing method, solid-state imaging apparatus, and electronic device
CN110557628A (en) * 2018-06-04 2019-12-10 杭州海康威视数字技术股份有限公司 Method and device for detecting shielding of camera and electronic equipment
CN111862228A (en) * 2020-06-04 2020-10-30 福瑞泰克智能系统有限公司 Occlusion detection method, system, computer device and readable storage medium
CN112927178A (en) * 2019-11-21 2021-06-08 中移物联网有限公司 Occlusion detection method, occlusion detection device, electronic device, and storage medium
CN114332721A (en) * 2021-12-31 2022-04-12 上海商汤临港智能科技有限公司 Camera device shielding detection method and device, electronic equipment and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5841903A (en) * 1992-01-17 1998-11-24 Yamaha Corporation Method and device for extracting a connected component of image data
CN106412626B (en) * 2016-10-31 2019-06-18 武汉斗鱼网络科技有限公司 A kind of processing method and processing device of live video
CN110059634B (en) * 2019-04-19 2023-04-18 山东博昂信息科技有限公司 Large-scene face snapshot method
CN110913209B (en) * 2019-12-05 2021-06-04 杭州飞步科技有限公司 Camera shielding detection method and device, electronic equipment and monitoring system
CN113705332A (en) * 2021-07-14 2021-11-26 深圳市有为信息技术发展有限公司 Method and device for detecting shielding of camera of vehicle-mounted terminal, vehicle-mounted terminal and vehicle

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170150063A1 (en) * 2013-05-22 2017-05-25 Sony Corporation Signal processor and signal processing method, solid-state imaging apparatus, and electronic device
CN106599783A (en) * 2016-11-09 2017-04-26 浙江宇视科技有限公司 Video occlusion detection method and device
CN110557628A (en) * 2018-06-04 2019-12-10 杭州海康威视数字技术股份有限公司 Method and device for detecting shielding of camera and electronic equipment
CN112927178A (en) * 2019-11-21 2021-06-08 中移物联网有限公司 Occlusion detection method, occlusion detection device, electronic device, and storage medium
CN111862228A (en) * 2020-06-04 2020-10-30 福瑞泰克智能系统有限公司 Occlusion detection method, system, computer device and readable storage medium
CN114332721A (en) * 2021-12-31 2022-04-12 上海商汤临港智能科技有限公司 Camera device shielding detection method and device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117424988A (en) * 2023-12-15 2024-01-19 浙江大学台州研究院 Image processing system and processing method for intelligently managing welding machine
CN117424988B (en) * 2023-12-15 2024-03-15 浙江大学台州研究院 Image processing system and processing method for intelligently managing welding machine

Also Published As

Publication number Publication date
CN114332721A (en) 2022-04-12

Similar Documents

Publication Publication Date Title
WO2023124387A1 (en) Photographing apparatus obstruction detection method and apparatus, electronic device, storage medium, and computer program product
CN109584507B (en) Driving behavior monitoring method, device, system, vehicle and storage medium
CN112132156B (en) Image saliency target detection method and system based on multi-depth feature fusion
US10212397B2 (en) Abandoned object detection apparatus and method and system
US9111169B2 (en) Method and system of identifying one or more features represented in a plurality of sensor acquired data sets
EP2662827B1 (en) Video analysis
CN107172354B (en) Video processing method and device, electronic equipment and storage medium
CN107563299B (en) Pedestrian detection method using RecNN to fuse context information
WO2020000382A1 (en) Motion-based object detection method, object detection apparatus and electronic device
CN110913209B (en) Camera shielding detection method and device, electronic equipment and monitoring system
CN111882578A (en) Foreground image acquisition method, foreground image acquisition device and electronic equipment
CN113869137A (en) Event detection method and device, terminal equipment and storage medium
CN113808135B (en) Image brightness abnormality detection method, electronic device, and storage medium
KR20210065177A (en) Image acquisition device occlusion detection method, device, device and storage medium
WO2023124385A1 (en) Photographic apparatus shielding detection method and apparatus, and electronic device, storage medium and computer program product
CN113542868A (en) Video key frame selection method and device, electronic equipment and storage medium
WO2012081969A1 (en) A system and method to detect intrusion event
KR20060121503A (en) Apparatus and method for tracking salient human face in robot surveillance
US10916016B2 (en) Image processing apparatus and method and monitoring system
Taha et al. Moving shadow removal for multi-objects tracking in outdoor environments
CN110443244B (en) Graphics processing method and related device
CN111950502B (en) Obstacle object-based detection method and device and computer equipment
TWI807561B (en) Embedded deep learning multi-scale object detection model using real-time distant region locating device and method thereof
WO2024113364A1 (en) Method, apparatus and computer-readable storage medium for determining roi of a scene
JP6891984B1 (en) Object detection device, object detection method, program and recording medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22913651

Country of ref document: EP

Kind code of ref document: A1