WO2024125192A1 - 安全告警方法、终端及计算机可读存储介质 - Google Patents

安全告警方法、终端及计算机可读存储介质 Download PDF

Info

Publication number
WO2024125192A1
WO2024125192A1 PCT/CN2023/131712 CN2023131712W WO2024125192A1 WO 2024125192 A1 WO2024125192 A1 WO 2024125192A1 CN 2023131712 W CN2023131712 W CN 2023131712W WO 2024125192 A1 WO2024125192 A1 WO 2024125192A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
area
region
interest
target area
Prior art date
Application number
PCT/CN2023/131712
Other languages
English (en)
French (fr)
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 WO2024125192A1 publication Critical patent/WO2024125192A1/zh

Links

Classifications

    • 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/103Static body considered as a whole, e.g. static pedestrian or occupant recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/25Determination of region of interest [ROI] or a volume of interest [VOI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/7715Feature extraction, e.g. by transforming the feature space, e.g. multi-dimensional scaling [MDS]; Mappings, e.g. subspace methods
    • 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

Definitions

  • the present application relates to the field of image recognition technology, and in particular to a security alarm method, a terminal and a computer-readable storage medium.
  • Portrait recognition also known as human shape recognition, is mainly used to identify whether the collected image contains a portrait.
  • Portrait recognition is widely used in many application scenarios. For example, in the application scenario of anti-drowning expulsion alarm, in outdoor scenes such as reservoirs, ponds, and rivers, although there are signs prohibiting swimming, there are still cases of people drowning while swimming. With the continuous improvement of social security awareness and the continuous development of science and technology, by setting up surveillance cameras at a certain height near the water, it is possible to monitor in real time whether there is any illegal swimming.
  • the traditional method for preventing drowning and driving away alarms in outdoor scenes is: first, draw a polygon surrounding the water area on the live video broadcast screen of the mobile phone APP camera, and the number of vertices of the polygon generally does not exceed 10.
  • the preventing drowning and driving away alarm is triggered. Due to the need to draw a polygon surrounding the water area, when the dangerous water area is curved, the drawn polygon cannot fit the outer edge of the water area well.
  • the triggering of the preventing drowning alarm is determined by the human figure entering the polygon, when the polygon cannot fit the edge of the water area well, the preventing drowning alarm is prone to false triggering. Therefore, in some application scenarios such as preventing drowning and driving away alarms, there are warnings. The problem of false alarms.
  • the present application provides a security alarm method, a terminal and a computer-readable storage medium.
  • the present application provides a security alarm method, comprising: acquiring an image and extracting a region of interest contained in the image; performing image semantic segmentation on the region of interest based on an image recognition model of image semantic segmentation to obtain a target region contained in the region of interest; and issuing a security alarm when it is determined that the region of interest contains a human portrait and that the human portrait is close to the target area.
  • the present application also provides a terminal, comprising a processor, a memory, a computer program stored in the memory and executable by the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein when the computer program is executed by the processor, the steps of any security alarm method provided in the specification of the present invention are implemented.
  • the present application also provides a storage medium for computer-readable storage, characterized in that the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any security alarm method provided in the specification of the present invention.
  • FIG1 is a schematic diagram of a process flow of a security alarm method provided in an embodiment of the present application.
  • FIG2 is a schematic diagram of a first sub-process of the security alarm method provided in an embodiment of the present application.
  • FIG3 is a schematic diagram of a second sub-process of the security alarm method provided in an embodiment of the present application.
  • FIG4 is a schematic diagram of a third sub-process of the security alarm method provided in an embodiment of the present application.
  • FIG5 is a schematic diagram of a fourth sub-process of the security alarm method provided in an embodiment of the present application.
  • FIG6 is a schematic block diagram of the structure of a terminal provided in an embodiment of the present application.
  • the embodiment of the present application provides a safety alarm method, terminal and storage medium.
  • the safety alarm method can be applied to terminals, including electronic devices such as security monitoring equipment, video recording equipment, embedded devices, smart phones, smart watches, tablet computers, laptops, desktop computers, personal digital assistants and wearable devices, and can be used in application scenarios such as drowning prevention and expulsion alarm. Safety alert in the scene.
  • the core idea of the safety alarm method provided by the embodiment of the present application is: taking the anti-drowning and expulsion alarm as an example, by setting up security monitoring equipment next to ponds, rivers, etc., collect images of the corresponding area, segment the images based on image semantic segmentation technology, identify water areas and human figures of arbitrary shapes, and issue a safety alarm when it is judged that the human figure is close to the water area.
  • the image semantic segmentation technology is used to segment the collected images to automatically identify water areas and human figures of arbitrary shapes, there is no need to manually set the outer edge line of the dangerous water area, and it can adapt to complex water areas of any shape, thereby effectively improving the accuracy of the anti-drowning alarm.
  • the above method can also play a corresponding role in other areas where there are dangers and safety alarms are needed, such as construction, cliffs, roadsides, etc.
  • FIG. 1 is a schematic diagram of a flow chart of a security alarm method provided in an embodiment of the present application.
  • the method includes but is not limited to the following steps S11-S13:
  • taking the anti-drowning expulsion alarm as an example by setting up security monitoring equipment next to ponds, rivers, reservoirs, beaches, etc., images of the above-mentioned edge areas and other corresponding areas are collected.
  • security monitoring equipment can also be set up at appropriate locations to collect images of the edge areas and other corresponding areas.
  • Region of interest in English, is called Region of Interest, or ROI for short, which describes the key area of the image that is of interest in image analysis.
  • the region of interest includes the edge of the water area, the area where the human figure is close to the water area, and the area containing the human figure in the captured image.
  • the captured image can be compared with the reference image as a benchmark. A comparison is performed to determine whether there is any change in the collected image. If there is any change in the collected image, the changed local image in the collected image is obtained as the region of interest.
  • the situation where no one is approaching the water area can be used as a reference image.
  • the reference image can be a pre-collected prepared image, or it can be an image collected at a certain moment before the collected image in the current environment.
  • the collected image is then compared with the reference image. If the collected image is inconsistent with the reference image, the changed local image in the collected image is used as the region of interest, so as to further determine whether the collected image contains a human portrait and whether the human portrait is close to the water area based on the region of interest. If the collected image is consistent with the reference image, it indicates that there is no person close to the water area, and the collected image does not contain the region of interest.
  • S12 Perform image semantic segmentation on the region of interest based on an image recognition model of image semantic segmentation to obtain a target region included in the region of interest.
  • an image recognition model based on image semantic segmentation is pre-constructed.
  • the image recognition model can be based on image semantic segmentation networks such as UNet, SegNet, DeepLab v1, DeepLab v2, AutoDeepLab, etc., wherein the loss function of the image recognition model can be a weighted cross entropy loss function.
  • Image semantic segmentation in English, is a technique and process for dividing an image into several specific regions with unique properties and proposing targets of interest. Then, sample images are collected to train the image recognition model. Taking drowning prevention and expulsion alarm as an example, a security monitoring camera can be installed at a location to monitor dangerous waters.
  • sample images can be annotated using image data annotation software. For example, image pixels belonging to waters are annotated as "0”, image pixels belonging to portraits are annotated as "1”, and other image pixels are recorded as backgrounds and annotated as "2".
  • image data annotation software For example, image pixels belonging to waters are annotated as "0”, image pixels belonging to portraits are annotated as "1”, and other image pixels are recorded as backgrounds and annotated as "2".
  • the sample images are then divided into a training data set and a verification data set.
  • the training data set is used to train the image recognition model, and the verification data set is used to verify the trained image recognition model.
  • the image recognition model is trained until the image recognition model meets the recognition requirements, thereby obtaining an image recognition model based on image semantic segmentation.
  • the image recognition model can be deployed on security monitoring equipment such as smart cameras.
  • security monitoring equipment such as smart cameras.
  • the image recognition model based on image semantic segmentation performs image semantic segmentation on the region of interest to obtain the target area contained in the region of interest and its outer edge line.
  • the outer edge line can be any shape.
  • the target area can be dangerous waters in anti-drowning expulsion alarm scenarios such as ponds, rivers, reservoirs, and seaside, or dangerous areas in other application scenarios such as mountain roads, cliffs, and construction sites.
  • an image recognition model based on image semantic segmentation performs image semantic segmentation on a region of interest, and determines whether the region of interest contains a portrait, if it is determined that the region of interest contains a portrait, it is further determined whether the portrait is close to a target area, and if it is determined that the portrait is close to the target area, a security alarm is issued; otherwise, if it is determined that the region of interest does not contain a portrait, or if the region of interest contains a portrait but it is determined that the portrait is not close to the target area, there is no need to issue a security alarm.
  • an image is captured and an area of interest contained in the image is extracted, thereby dynamically cropping the image around the moving area of the captured image, and then based on an image recognition model of image semantic segmentation, image semantic segmentation is performed on the area of interest to obtain a target area contained in the area of interest.
  • image semantic segmentation is performed on the area of interest to obtain a target area contained in the area of interest.
  • the embodiments of the present application do not require manual setting of the outer edge line of the dangerous area and can adapt to complex areas of any shape, thereby effectively improving the accuracy of safety alarms such as anti-drowning alarms.
  • FIG. 2 is a schematic diagram of the first sub-process of the security warning method provided in the embodiment of the present application.
  • the acquisition of an image and the extraction of an area of interest contained in the image include:
  • S23 Map boundary coordinates corresponding to the maximum value and the minimum value to the second image, and use an area enclosed by the mapping of the boundary coordinates on the second image as a region of interest.
  • the first image and the second image are collected in chronological order, and the difference area between the first image and the second image is obtained according to an image matching algorithm such as the mean absolute difference algorithm (MAD), the absolute error sum algorithm (SAD), the error square sum algorithm (SSD), the mean error square sum algorithm (MSD), the normalized product correlation algorithm (NCC), the sequential similarity detection algorithm (SSDA), and the Hadamard transform algorithm (SATD).
  • the difference area describes the area where changes occur between the first image and the second image, and is the image area that is different between the first image and the second image.
  • the image matching algorithm can be a grayscale-based image matching algorithm, and then the maximum value and the minimum value of the coordinate index of the difference area in the vertical direction are obtained, and the maximum value and the minimum value of the coordinate index of the difference area in the horizontal direction are obtained, so as to obtain four endpoints of the difference area, and then the four boundary coordinates corresponding to the maximum value and the minimum value are mapped to the second image, and the area surrounded by the mapping of the four boundary coordinates on the second image is used as the region of interest.
  • Figure 3 is a schematic diagram of a second sub-process of the security warning method provided in an embodiment of the present application.
  • obtaining the difference area between the first image and the second image includes:
  • S32 binarize the sum of the absolute differences to obtain a binarized image, and obtain a difference region according to the binarized image.
  • the difference area between the first image and the second image is extracted based on the Sum of Absolute Differences (SAD) algorithm, by obtaining the sum of the absolute differences between the first image and the second image, that is, the SAD result, and binarizing the sum of the absolute differences to obtain a binarized image, and obtaining the difference area based on the binarized image.
  • SAD Sum of Absolute Differences
  • the anti-drowning expulsion alarm as an example, in the anti-drowning expulsion alarm scenes such as ponds, rivers, reservoirs, and seaside, security monitoring equipment such as smart cameras are pre-installed to perform real-time anti-drowning monitoring, and the image at time T0 is collected in real time based on the security monitoring equipment, and the image is obtained as the first image, which can be recorded as ImgS0, and the size of the first image can be described as SourceImgH ⁇ SourceImgW, SourceImgH is the height of the first image, SourceImgW is the width of the first image, and the first image can be 1080P, SourceImgH is 1080, and SourceImgW is 1920. Then, an image corresponding to time T1 is collected and acquired as the second image, which can be recorded as ImgS1.
  • the interval between T1 and T0 can be between 50ms and 200ms, and here the interval can be 50ms.
  • the first image and the second image are matched by the Sum of Absolute Differences (SAD) algorithm, where SAD is the abbreviation of "Sum of Absolute Differences", which can also be called the sum of absolute differences, so as to obtain the SAD results of images ImgS0 and ImgS1, and the result is recorded as ImgSad.
  • SAD Sum of Absolute Differences
  • the formula for obtaining the SAD result is as follows:
  • M is the size of the summation window of the absolute value of the image difference.
  • the value of M can generally be set to 4, 8, 16, 32, etc., corresponding to the width and height of ImgSad being reduced to 1/4, 1/8, 1/16, 1/32 of the width and height of ImgS0 or ImgS1.
  • (h, w) are the position indexes of ImgSad in the vertical and horizontal directions, respectively, and (i, j) are the coordinate indexes in the vertical and horizontal directions within the summation window.
  • ImgSad is binarized and the result is recorded as ImgT:
  • TH is the binarization threshold, which can be 100 here and has a value range of [0,255]. It is the color value of the pixel in the RGB mode. The larger the TH value, the more sensitive the description is to the pixel changes at the corresponding positions between the first image and the second image. The smaller the TH value, the less sensitive the description is to the pixel changes at the corresponding positions between the first image and the second image.
  • a binary image is obtained.
  • the pixel values of the binary image ImgT are traversed to obtain the maximum and minimum values of the vertical and horizontal coordinate indexes of ImgT(h,w)>0, which are recorded as HRoiMax, HRoiMin, WRoiMax, and WRoiMin respectively.
  • the area determined by the four values is the Roi area, that is, the difference area.
  • the difference area is obtained according to the binary image.
  • the change between the first image and the second image is judged according to the SAD result, and the difference area between the first image and the second image is obtained when there is a change between the first image and the second image.
  • the maximum value and the minimum value of the coordinate index of the difference area in the vertical direction are obtained, and the maximum value and the minimum value of the coordinate index of the difference area in the horizontal direction are obtained, so as to obtain the four endpoints of the difference area, and then the four boundary coordinates corresponding to the maximum value and the minimum value are mapped to the second image, and the area surrounded by the mapping of the four boundary coordinates on the second image is taken as the region of interest, so as to obtain the region of interest.
  • a first image and a second image are captured, and a difference area between the first image and the second image is obtained, thereby dynamically cropping an image surrounding a moving area of the second image, and then the maximum and minimum values of the coordinate indexes corresponding to the difference area in the vertical and horizontal directions are obtained, respectively, and the boundary coordinates corresponding to the maximum and minimum values are mapped to the second image, and the area enclosed by the mapping of the boundary coordinates on the second image is used as the region of interest.
  • This can accurately measure the changes between the first image and the second image, thereby obtaining an accurate region of interest based on the changes, so as to improve the accuracy of safety warnings based on the region of interest.
  • taking the area enclosed by the mapping of the boundary coordinates on the second image as the region of interest includes:
  • the first target area is enlarged, and the enlarged area is used as the region of interest.
  • the area enclosed by the mapping of the boundary coordinates on the second image is For the first target area, when it is determined that the first target area is less than or equal to the preset area threshold, the first target area is enlarged.
  • the first target area can be enlarged in the vertical direction, the horizontal direction, and in the vertical direction and the horizontal direction at the same time, and the enlarged area is used as the area of interest.
  • the first target area is smaller than or equal to a preset area threshold, the first target area is enlarged, including at least one of the following:
  • the maximum value and the minimum value of the coordinate index of the first target area in the horizontal direction are updated.
  • the maximum value and the minimum value of the coordinate index of the first target area in the vertical direction are updated, thereby enlarging the first target area in the vertical direction;
  • the maximum value and the minimum value of the coordinate index of the first target area in the horizontal direction are updated, thereby enlarging the first target area in the horizontal direction.
  • the area enclosed by the mapping of the boundary coordinates on the second image is used as the first target area, and then when it is determined that the first target area is less than or equal to the preset area threshold, the first target area is enlarged in the vertical direction or the horizontal direction, and the enlarged area is used as the region of interest. Therefore, when the human figure is small and the image is not clear enough due to the close proximity of the human figure to the dangerous area such as the dangerous water area far away from the camera, the entire image is not directly input into the image segmentation network, but the image around the moving area is dynamically cropped and enlarged, and then input into the image segmentation network based on image semantic segmentation.
  • the image recognition model is used for image segmentation, thereby realizing dynamic cropping of the image. This can significantly improve the accuracy of safety warnings in scenes where the portrait is far away from the camera without increasing the amount of calculation.
  • taking the area enclosed by the mapping of the boundary coordinates on the second image as the region of interest includes:
  • the second target area is taken as the region of interest.
  • the area enclosed by the mapping of the boundary coordinates on the second image is expanded, that is, extended outward, to obtain the second target area, and the second target area is used as the region of interest, which can prevent the area enclosed by the mapping of the boundary coordinates on the second image from being too small, resulting in inaccurate recognition of the region of interest by the subsequent image recognition model based on image semantic segmentation, and resulting in reduced accuracy of safety warnings.
  • HRoiMax, HRoiMin, WRoiMax, and WRoiMin are updated:
  • the four endpoints of the Roi area are determined, and the Roi area is migrated as a whole according to the four endpoints to expand the area, and a new area, namely the second target area, is determined as the area of interest.
  • the second target area is obtained by expanding the area enclosed by the mapping of the boundary coordinates on the second image, and the second target area is used as the area of interest, so as to avoid the area of interest being too small and affecting the accuracy of the safety alarm.
  • FIG4 is a schematic diagram of a third sub-process of the security warning method provided in an embodiment of the present application.
  • the area enclosed by the mapping of the boundary coordinates on the second image is expanded to obtain a second target area, including:
  • the region enclosed by the mapping of the boundary coordinates on the second image is The expanded area is obtained by expanding the expanded area, and the boundary endpoints corresponding to the expanded area and the second image are compared to obtain the overlapping area between the expanded area and the second image, and the overlapping area is used as the second target area.
  • CropImg(h,w) ImgS1(h+HRoiMin,w+WRoiMin), formula (23);
  • the area enclosed by the mapping of the boundary coordinates on the second image is expanded to obtain the expanded area, and the expanded area is compared with the boundary endpoints corresponding to the second image to obtain the overlapping area between the expanded area and the second image.
  • the overlapping area is used as the second target area, which can prevent the boundary value of the area of interest from exceeding the index, thereby improving the accuracy of the safety alarm.
  • FIG5 is a schematic diagram of the fourth sub-process of the security warning method provided in the embodiment of the present application.
  • determining that the human portrait is close to the target area includes:
  • the center point of the portrait is obtained, and a circle is drawn with the center point as the center and a preset step length as the radius, and the drawn circle is used for traversal to obtain the minimum value corresponding to the intersection of the radius and the target area, and then the minimum value is compared with the preset distance threshold.
  • the minimum value is greater than the preset distance threshold, it is determined that the portrait is not close to the target area, and when the minimum value is less than or equal to the preset distance threshold, it is determined that the portrait is close to the target area.
  • a safety alarm is required.
  • a speaker configured on the security monitoring device is used to play voice reminders such as safety and expulsion, and the relevant personnel can be notified through the background of an alarm message that a portrait is close to a dangerous area.
  • the center point of the portrait is obtained, and traversal is performed with the center point as the center of the circle and a preset step size as the radius to obtain the minimum value corresponding to the intersection of the radius and the target area.
  • the minimum value is less than or equal to the preset distance threshold, it is determined that the portrait is close to the target area. It is possible to timely and accurately determine whether the portrait is close to the target area, thereby improving the accuracy and effect of the safety alarm.
  • Figure 6 is a schematic block diagram of the structure of a terminal provided in an embodiment of the present application.
  • the terminal device 300 includes a processor 301 and a memory 302, and the processor 301 and the memory 302 are connected via a bus 303, such as an I2C (Inter-integrated Circuit) bus.
  • I2C Inter-integrated Circuit
  • the processor 301 is used to provide computing and control capabilities to support the operation of the entire terminal.
  • the processor 301 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices.
  • the general purpose processor may be a microprocessor or any conventional processor.
  • the memory 302 can be a Flash chip, a read-only memory (ROM) disk, an optical disk, a U disk or a mobile hard disk, etc.
  • ROM read-only memory
  • FIG. 6 is merely a block diagram of a partial structure related to the embodiment of the present application, and does not constitute a limitation on the terminal to which the embodiment of the present application is applied.
  • the specific server may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
  • the processor is used to run a computer program stored in the memory, and implement any one of the security alarm methods provided in the embodiments of the present application when executing the computer program.
  • An embodiment of the present application also provides a storage medium for computer-readable storage, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any security alarm method provided in the description of the embodiment of the present application.
  • the storage medium may be an internal storage unit of the terminal described in the foregoing embodiment, such as a memory of the terminal.
  • the storage medium may also be an external storage device of the terminal, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the terminal.
  • SMC smart media card
  • SD secure digital
  • Such software can be distributed on a computer-readable medium, which can include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium).
  • a computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data).
  • Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer.
  • communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Evolutionary Computation (AREA)
  • Databases & Information Systems (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Alarm Systems (AREA)

Abstract

本申请提供了一种安全告警方法、终端及计算机可读存储介质,属于图像识别技术领域。其中,所述方法包括:采集图像,并提取图像包含的感兴趣区域(S11);基于图像语义分割的图像识别模型,对感兴趣区域进行图像语义分割,得到感兴趣区域包含的目标区域(S12),在确定感兴趣区域包含人像,且确定人像靠近目标区域的情况下,发出安全告警(S13)。

Description

安全告警方法、终端及计算机可读存储介质
交叉引用
本申请要求在2022年12月16日提交中国专利局、申请号为202211625131X、名称为“安全告警方法、终端及计算机可读存储介质”的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
技术领域
本申请涉及图像识别技术领域,尤其涉及一种安全告警方法、终端及计算机可读存储介质。
背景技术
人像识别,又可以称为人形识别,主要为识别采集的图像是否包含人像。人像识别在诸多应用场景中有较为广泛的应用。例如,在防溺水驱离告警的应用场景中,在水库、池塘、河边等户外场景中,虽然有禁止游泳的告示,但是仍然存在有人下水游泳发生溺水身亡的情况。伴随着社会安全意识的不断提高和科学技术的不断发展,通过在水边一定高度架设监控摄像头,可实时监控是否有违禁下水的情况出现。
针对户外场景防溺水驱离告警,传统的处理方法为:首先在手机APP摄像头视频直播画面上绘制环绕水域的多边形,且多边形的顶点数目一般不超过10个,当检测到人形进入绘制的多边形里面时,则触发防溺水驱离告警。由于需要绘制环绕水域的多边形,当危险水域存在弯曲时,绘制的多边形不能很好的贴合水域的外边缘线,而又由于是通过人形进入多边形来判断是否触发防溺水告警,所以当多边形不能很好贴合水域边缘线时,容易出现防溺水告警误触发的情况。因此,在一些防溺水驱离告警等应用场景中,存在告 警误报的问题。
发明内容
本申请提供了一种安全告警方法、终端及计算机可读存储介质。
第一方面,本申请提供一种安全告警方法,包括:采集图像,并提取所述图像包含的感兴趣区域;基于图像语义分割的图像识别模型,对所述感兴趣区域进行图像语义分割,得到所述感兴趣区域包含的目标区域;在确定所述感兴趣区域包含人像,且确定所述人像靠近所述目标区域的情况下,发出安全告警。
第二方面,本申请还提供一种终端,所述终端包括处理器、存储器、存储在所述存储器上并可被所述处理器执行的计算机程序以及用于实现所述处理器和所述存储器之间的连接通信的数据总线,其中所述计算机程序被所述处理器执行时,实现如本发明说明书提供的任一项安全告警方法的步骤。
第三方面,本申请还提供一种存储介质,用于计算机可读存储,其特征在于,所述存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现如本发明说明书提供的任一项安全告警的方法的步骤。
附图说明
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的安全告警方法的流程示意图;
图2为本申请实施例提供的安全告警方法的第一个子流程示意图;
图3为本申请实施例提供的安全告警方法的第二个子流程示意图;
图4为本申请实施例提供的安全告警方法的第三个子流程示意图;
图5为本申请实施例提供的安全告警方法的第四个子流程示意图;
图6为本申请实施例提供的一种终端的结构示意框图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
附图中所示的流程图仅是示例说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解、组合或部分合并,因此实际执行的顺序有可能根据实际情况改变。
应当理解,在此本申请说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本申请。如在本申请说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。
本申请实施例提供了一种安全告警方法、终端及存储介质。其中,所述安全告警方法可以应用于终端,所述终端包括安防监控设备、摄录设备、嵌入式设备、智能手机、智能手表、平板电脑、笔记本电脑、台式机电脑、个人数字助理和穿戴式设备等电子设备,可以实现在防溺水驱离告警等应用场 景中进行安全告警。
面对在防溺水驱离告警等应用场景中存在告警误报的问题,本申请实施例提供的安全告警方法,其核心思想为:以防溺水驱离告警为例,通过架设在池塘、河边等地旁边的安防监控设备,采集相应区域的图像,基于图像语义分割技术对图像进行分割,识别出任意形状的水域与人形,并在判断人形靠近水域的情况下,进行安全告警。由于采用了图像语义分割技术对采集的图像进行分割,来自动识别出任意形状的水域与人形,不需要人为设置危险水域的外边缘线,能够适应任何形状的复杂水域,从而能够有效提高防溺水告警的准确性,上述方法在建筑施工、悬崖、路边等其它存在危险而需要进行安全告警的区域也能够起到相应的效果。
下面结合附图,对本申请的一些实施例作详细说明。在不冲突的情况下,下述的实施例及实施例中的特征可以相互组合。
请参阅图1,图1为本申请实施例提供的安全告警方法的流程示意图,该方法包括但不限于以下步骤S11-S13:
S11、采集图像,并提取所述图像包含的感兴趣区域。
在示例性的实施方式中,以防溺水驱离告警为例,通过架设在池塘、河边、水库、海边等地旁边的安防监控设备,采集上述各个边缘区域等相应区域的图像,在山路、悬崖、施工工地等其它应用场景中,也可以在合适的位置架设安防监控设备,来采集边缘区域等相应区域的图像。
感兴趣区域,英文为Region of interest,简称为Roi区域,描述图像分析中所关注的图像的重点区域。示例性的,以防溺水驱离告警为例,感兴趣区域包含水域的边缘、人形与水域相靠近的区域、采集的图像中包含人像的区域。提取图像包含的感兴趣区域,可以将采集的图像与作为基准的对照图像 进行比对,来判断采集的图像是否存在变化,在采集的图像存在变化的情况下,获取采集的图像中产生变化的局部图像作为感兴趣区域。示例性的,以防溺水驱离告警为例,可以将水域无人靠近的情形作为基准的对照图像,对照图像可以为预先采集的准备好的图像,对照图像也可以为在采集的图像之前某一时刻采集的当时环境下的图像,然后将采集的图像与对照图像进行比对,在采集的图像与对照图像不一致的情况下,将采集的图像中发生变化的局部图像作为感兴趣区域,从而进一步根据感兴趣区域判断采集的图像中是否包含人像且人像是否靠近水域,在采集的图像与对照图像一致的情况下,表明不存在人员靠近水域的情况,采集的图像不包含感兴趣区域。
S12、基于图像语义分割的图像识别模型,对所述感兴趣区域进行图像语义分割,得到所述感兴趣区域包含的目标区域。
在示例性的实施方式中,预先构建基于图像语义分割的图像识别模型,图像识别模型可以为基于UNet、SegNet、DeepLab v1、DeepLab v2、AutoDeepLab等图像语义分割网络,其中,图像识别模型的损失函数可以为带权重的交叉熵损失函数,图像语义分割,英文为Image semantic segmentation,把图像分成若干个特定的、具有独特性质的区域并提出感兴趣目标的技术和过程。然后采集样本图像来训练图像识别模型,以防溺水驱离告警为例,可以将安防监控摄像头安装到监控危险水域的位置,相关人员模拟靠近危险水域、进入危险水域等需要进行安全告警的情形,并采用安防监控摄像头采集在上述情形下的图像作为样本图像,并可以更换不同的危险水域,采用类似的方法继续采集样本图像,直至采集到足够数量的样本图像,并可以采用图像数据标注软件对样本图像进行标注,例如,将属于水域的图像像素标注为“0”,将属于人像的图像像素标注为“1”,其它的图像像素记为背景,标注为“2”, 然后将样本图像分为训练数据集与验证数据集,并采用训练数据集训练图像识别模型,采用验证数据集验证训练的图像识别模型,训练图像识别模型直至图像识别模型满足识别要求,得到基于图像语义分割的图像识别模型。
图像识别模型训练完成后,可以将图像识别模型部署于智能摄像头等安防监控设备,提取采集的图像包含的感兴趣区域后,基于图像语义分割的图像识别模型,对感兴趣区域进行图像语义分割,得到感兴趣区域包含的目标区域及其外边缘线,且外边缘线可以为任意形状,目标区域可以为池塘、河边、水库、海边等防溺水驱离告警场景中的危险水域,或者山路、悬崖、施工工地等其它应用场景中的危险区域。
S13、在确定所述感兴趣区域包含人像,且确定所述人像靠近所述目标区域的情况下,发出安全告警。
在示例性的实施方式中,在基于图像语义分割的图像识别模型,对感兴趣区域进行图像语义分割的时候,并且判断感兴趣区域是否包含人像,在确定感兴趣区域包含人像,进一步判断人像是否靠近目标区域,在确定人像靠近目标区域的情况下,发出安全告警,否则,在确定感兴趣区域未包含人像的情况下,或者感兴趣区域包含人像但判断人像未靠近目标区域的情况下,不需要发出安全告警。
本申请实施例,通过采集图像,并提取图像包含的感兴趣区域,从而动态裁剪采集图像的移动区域周边图像,然后基于图像语义分割的图像识别模型,对感兴趣区域进行图像语义分割,得到感兴趣区域包含的目标区域,在确定感兴趣区域包含人像,且确定人像靠近目标区域的情况下,发出安全告警,从而实现采用图像语义分割技术对采集的图像进行分割,来自动识别出任意形状的危险区域及其外边缘线,并能自动识别出人像及其外边缘轮廓, 相对于传统技术,在防溺水驱离告警等应用场景中,本申请实施例不需要人为设置危险区域的外边缘线,能够适应任何形状的复杂区域,从而能够有效提高防溺水告警等安全告警的准确性。
在一实施例中,请参阅图2,图2为本申请实施例提供的安全告警方法的第一个子流程示意图。如图2所示,在该实施例中,所述采集图像,并提取所述图像包含的感兴趣区域,包括:
S21、采集第一图像与第二图像,并获取所述第一图像与所述第二图像之间的差异区域;
S22、获取所述差异区域在竖直方向与水平方向分别对应的坐标索引的最大值与最小值;
S23、将所述最大值与所述最小值所对应的边界坐标映射到所述第二图像,并将所述边界坐标在所述第二图像上的映射围成的区域作为感兴趣区域。
在示例性的实施方式中,按照时间先后顺序,先后采集第一图像与第二图像,并根据平均绝对差算法(MAD)、绝对误差和算法(SAD)、误差平方和算法(SSD)、平均误差平方和算法(MSD)、归一化积相关算法(NCC)、序贯相似性检测算法(SSDA)、Hadamard变换算法(SATD)等图像匹配算法,获取第一图像与第二图像之间的差异区域,差异区域描述第一图像与第二图像之间发生变化的区域,为第一图像与第二图像之间不相同的图像区域,其中,图像匹配算法可以为基于灰度的图像匹配算法,然后获取差异区域在竖直方向的坐标索引的最大值与最小值,并获取差异区域在水平方向的坐标索引的最大值与最小值,从而获取差异区域的四个端点,再将最大值与最小值所对应的四个边界坐标映射到第二图像,并将四个边界坐标在第二图像上的映射围成的区域作为感兴趣区域。
进一步地,请参阅图3,图3为本申请实施例提供的安全告警方法的第二个子流程示意图。如图3所示,在该实施例中,获取所述第一图像与所述第二图像之间的差异区域,包括:
S31、求取所述第一图像与所述第二图像的绝对差异之和;
S32、对所述绝对差异之和进行二值化处理,得到二值化图像,并根据所述二值化图像,获取差异区域。
在示例性的实施方式中,提取第一图像与第二图像之间的差异区域,为基于绝对误差和算法(SAD),通过求取第一图像与第二图像的绝对差异之和,即SAD结果,并对绝对差异之和进行二值化处理,得到二值化图像,并根据二值化图像,获取差异区域。示例性地,以防溺水驱离告警为例,在池塘、河边、水库、海边等防溺水驱离告警场景中,预先安装智能摄像头等安防监控设备,进行防溺水实时监控,并基于安防监控设备实时采集T0时刻的图像,并获取该图像,作为第一图像,可以记为ImgS0,第一图像大小可以描述为SourceImgH×SourceImgW,SourceImgH为第一图像的高度,SourceImgW为第一图像的宽度,第一图像可以为1080P,SourceImgH为1080,SourceImgW为1920。然后采集并获取T1时刻所对应的图像,作为第二图像,可以记为ImgS1,T1与T0间隔可以为50ms~200ms之间,此处间隔可以为50ms。
以绝对误差和算法(SAD)来进行第一图像与第二图像的匹配,其中,SAD为“Sum of Absolute Differences”的缩写,又可以称为绝对差异之和,从而求取图像ImgS0与ImgS1的SAD结果,结果记为ImgSad,求取公式如下:
其中,M为图像差值绝对值的求和窗口大小,M值一般可以设置为4、8、16、32等值,对应ImgSad宽高缩小为ImgS0或ImgS1宽高的1/4、1/8、1/16、1/32,式中,(h,w)分别为ImgSad竖直方向和水平方向的位置索引,(i,j)为求和窗口内竖直方向和水平方向的坐标索引。
然后对ImgSad进行二值化处理,结果记为ImgT:
TH为二值化阈值,此处取值可以为100,取值范围为[0,255],为像素的RGB模式下的颜色值,TH值越大,描述对第一图像与第二图像之间对应位置上的像素变化越灵敏,TH值越小,描述对第一图像与第二图像之间对应位置上的像素变化越不灵敏。
将差异区域二值化后,得到二值化图像,遍历二值化图像ImgT的各像素值,求取ImgT(h,w)>0的竖直方向和水平方向坐标索引的最大值和最小值,分别记为HRoiMax、HRoiMin、WRoiMax、WRoiMin,四个值确定的区域为Roi区域,即差异区域,从而根据二值化图像,获取差异区域,Roi区域的端点如下:
HRoiMax=max(h),h∈{ImgT(h,w)>0},公式(3);
HRoiMin=min(h),h∈{ImgT(h,w)>0},公式(4);
WRoiMax=max(w),w∈{ImgT(h,w)>0},公式(5);
WRoiMin=min(w),w∈{ImgT(h,w)>0},公式(6);
将Roi区域的边界坐标映射到源图像ImgS1的尺度,即更新HRoiMax、HRoiMin、WRoiMax、WRoiMin如下:
HRoiMax=HRoiMax×M,公式(7);
HRoiMin=HRoiMin×M,公式(8);
WRoiMax=WRoiMax×M,公式(9);
WRoiMin=WRoiMin×M,公式(10);
从而实现根据SAD结果,判断第一图像与第二图像之间的变化情况,在第一图像与第二图像之间存在变化的情况下,获取第一图像与第二图像之间的差异区域。根据确定的差异区域,获取差异区域在竖直方向的坐标索引的最大值与最小值,并获取差异区域在水平方向的坐标索引的最大值与最小值,从而获取差异区域的四个端点,再将最大值与最小值所对应的四个边界坐标映射到第二图像,并将四个边界坐标在第二图像上的映射围成的区域作为感兴趣区域,从而得到感兴趣区域。
本申请实施例,通过采集第一图像与第二图像,并获取第一图像与第二图像之间的差异区域,从而实现动态裁剪第二图像的移动区域周边图像,然后获取差异区域在竖直方向与水平方向分别对应的坐标索引的最大值与最小值,并将最大值与最小值所对应的边界坐标映射到第二图像,并将边界坐标在第二图像上的映射围成的区域作为感兴趣区域,能够准确地衡量第一图像与第二图像之间的变化,从而根据变化得到准确的感兴趣区域,以便根据感兴趣区域提高安全告警的准确性。
在一实施例中,将所述边界坐标在所述第二图像上的映射围成的区域作为感兴趣区域,包括:
将所述边界坐标在所述第二图像上的映射围成的区域作为第一目标区域;
在确定所述第一目标区域小于或者等于预设区域阈值的情况下,将所述第一目标区域进行放大,并将放大后的区域作为感兴趣区域。
在示例性的实施方式中,将边界坐标在第二图像上的映射围成的区域作 为第一目标区域,在确定第一目标区域小于或者等于预设区域阈值的情况下,将第一目标区域进行放大,可以将第一目标区域在竖直方向、水平方向、及同时在竖直方向与水平方向上进行放大,并将放大后的区域作为感兴趣区域。
进一步地,在确定所述第一目标区域小于或者等于预设区域阈值的情况下,将所述第一目标区域进行放大,包括以下的至少一项:
在所述第一目标区域在竖直方向的坐标索引的最大值与最小值之间的距离小于或者等于预设区域高度阈值的情况下,将所述第一目标区域在竖直方向的坐标索引的最大值与最小值进行更新;
在所述第一目标区域在水平方向的坐标索引的最大值与最小值之间的距离小于或者等于预设区域宽度阈值的情况下,将所述第一目标区域在水平方向的坐标索引的最大值与最小值进行更新。
示例性的,在第一目标区域在竖直方向的坐标索引的最大值与最小值之间的距离小于或者等于预设区域高度阈值的情况下,将第一目标区域在竖直方向的坐标索引的最大值与最小值进行更新,从而将第一目标区域在竖直方向上进行放大,在第一目标区域在水平方向的坐标索引的最大值与最小值之间的距离小于或者等于预设区域宽度阈值的情况下,将第一目标区域在水平方向的坐标索引的最大值与最小值进行更新,从而在水平方向上进行放大。
本申请实施例,通过将边界坐标在第二图像上的映射围成的区域作为第一目标区域,然后在确定所述第一目标区域小于或者等于预设区域阈值的情况下,将第一目标区域在竖直方向或者水平方向上进行放大,并将放大后的区域作为感兴趣区域,从而在人像靠近距离摄像头较远的危险水域等危险区域导致图像人形较小、图像不够清晰时,不直接将整幅图像输入图像分割网络,而是动态裁剪移动区域周边图像并进行放大,然后输入基于图像语义分 割的图像识别模型进行图像分割,从而实现图像的动态裁剪,能够在不增加计算量的同时,显著提高人像距离摄像头较远场景下的安全告警准确度。
在一实施例中,将所述边界坐标在所述第二图像上的映射围成的区域作为感兴趣区域,包括:
将所述边界坐标在所述第二图像上的映射围成的区域进行外扩,得到第二目标区域;
将所述第二目标区域作为感兴趣区域。
在示例性的实施方式中,将边界坐标在第二图像上的映射围成的区域进行外扩,即向外延展,得到第二目标区域,并将第二目标区域作为感兴趣区域,能够防止边界坐标在第二图像上的映射围成的区域过小,导致后续基于图像语义分割的图像识别模型对感兴趣区域识别不准确,并导致安全告警准确度降低的问题。示例性的,基于上述第一图像ImgS0与第二图像ImgS1的SAD结果,为防止Roi区域过小,对HRoiMax、HRoiMin、WRoiMax、WRoiMin进行更新:
如果HRoiMax-HRoiMin<RoiH,此处RoiH可以设置为216,其中,RoiH描述区域高度阈值,HRoiMax-HRoiMin<RoiH,描述Roi区域在竖直方向的高度较小,则设置:
HRoiMax=(HRoiMax+HRoiMin)/2+RoiH/2,公式(11);
HRoiMin=(HRoiMax+HRoiMin)/2-RoiH/2,公式(12);
如果WRoiMax-WRoiMin<RoiW,此处RoiW可以设置为384,其中,RoiW描述区域宽度阈值,WRoiMax-WRoiMin<RoiW,描述Roi区域在水平方向上的宽度较小,则设置:
WRoiMax=(WRoiMax+WRoiMin)/2+RoiW/2,公式(13);
WRoiMin=(WRoiMax+HRoiMin)/2-RoiW/2,公式(14);
将HRoiMax、HRoiMin、WRoiMax、WRoiMin四个值划定的图像Roi区域外扩,外扩高度为ExpH,外扩宽度为ExpW,此处设置ExpH为28,ExpW为48:
HRoiMax=HRoiMax+ExpH,公式(15);
HRoiMin=HRoiMin-ExpH,公式(16);
WRoiMax=WRoiMax+ExpW,公式(17);
WHRoiMin=WRoiMin-ExpW,公式(18);
从而在保证中心位置不变的情况下,确定Roi区域的四个端点,并根据四个端点将Roi区域进行整体迁移,进行区域的外扩,确定新的区域,即第二目标区域,并作为感兴趣区域。
本申请实施例,通过将边界坐标在第二图像上的映射围成的区域进行外扩,得到第二目标区域,并将第二目标区域作为感兴趣区域,能够避免感兴趣区域过小,影响安全告警准确度。
在一实施例中,请参阅图4,图4为本申请实施例提供的安全告警方法的第三个子流程示意图。如图4所示,在该实施例中,将所述边界坐标在所述第二图像上的映射围成的区域进行外扩,得到第二目标区域,包括:
S41、将所述边界坐标在所述第二图像上的映射围成的区域进行外扩,得到外扩区域;
S42、将所述外扩区域与所述第二图像相对应的边界端点进行比较,得到所述外扩区域与所述第二图像之间的重叠区域;
S43、将所述重叠区域作为所述第二目标区域。
在示例性的实施方式中,将边界坐标在第二图像上的映射围成的区域进 行外扩,得到外扩区域,将外扩区域与第二图像相对应的边界端点进行比较,得到外扩区域与第二图像之间的重叠区域,并将重叠区域作为第二目标区域。示例性的,基于上述第一图像ImgS0与第二图像ImgS1的示例,对更新后的Roi区域进行下式处理,防止边界值超出索引:
HRoiMax=min(HRoiMax,SourceImgH),公式(19);
WRoiMax=min(WRoiMax,SourceImgW),公式(20);
HRoiMin=max(HRoiMin,0),公式(21);
WRoiMin=max(WRoiMin,0),公式(22);
以Roi区域的边界HRoiMax、HRoiMin、WRoiMax、WRoiMin,裁剪图像ImgS1,获得裁剪后的图像CropImg,即第二目标区域,亦即感兴趣区域。
CropImg(h,w)=ImgS1(h+HRoiMin,w+WRoiMin),公式(23);
其中,0≤h<HRoiMax-HRoiMin,0≤w<WRoiMax-WRoiMin。
本申请实施例,通过将边界坐标在第二图像上的映射围成的区域进行外扩,得到外扩区域,并将外扩区域与第二图像相对应的边界端点进行比较,得到外扩区域与第二图像之间的重叠区域,将重叠区域作为第二目标区域,能够防止感兴趣区域的边界值超出索引,进而提高安全告警准确度。
在一实施例中,请参阅图5,图5为本申请实施例提供的安全告警方法的第四个子流程示意图。如图5所示,在该实施例中,确定所述人像靠近所述目标区域,包括:
S51、获取所述人像的中心点;
S52、以所述中心点为圆心,以预设步长为半径进行遍历,获取所述半径与所述目标区域相交叉所对应的最小值;
S53、在所述最小值小于或者等于预设距离阈值的情况下,判定所述人像 靠近所述目标区域。
在示例性的实施方式中,判断人像是否靠近目标区域时,获取人像的中心点,并以中心点为圆心,以预设步长为半径作圆,且采用作的圆进行遍历,获取半径与目标区域相交叉所对应的最小值,然后将最小值与预设距离阈值进行比较,在最小值大于预设距离阈值的情况下,判定人像未靠近目标区域,并在最小值小于或者等于预设距离阈值的情况下,判定人像靠近目标区域,人像处于存在危险的情况下,需要进行安全告警,例如,采用安防监控设备上配置的喇叭播放提醒安全、驱离等语音,并可以通过后台通知相关人员存在人像靠近危险区域的告警信息。
本申请实施例,通过获取人像的中心点,并以中心点为圆心,以预设步长为半径进行遍历,获取半径与所述目标区域相交叉所对应的最小值,在最小值小于或者等于预设距离阈值的情况下,判定人像靠近所述目标区域,能够及时而准确地判断人像是否靠近了目标区域,进而提高安全告警的准确性与安全告警的效果。
请参阅图6,图6为本申请实施例提供的一种终端的结构示意性框图。如图6所示,终端设备300包括处理器301和存储器302,处理器301和存储器302通过总线303连接,该总线比如为I2C(Inter-integrated Circuit)总线。
具体地,处理器301用于提供计算和控制能力,支撑整个终端的运行。处理器301可以是中央处理单元(Central Processing Unit,CPU),该处理器301还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器 件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
具体地,存储器302可以是Flash芯片、只读存储器(ROM,Read-Only Memory)磁盘、光盘、U盘或移动硬盘等。
本领域技术人员可以理解,图6中示出的结构,仅仅是与本申请实施例方案相关的部分结构的框图,并不构成对本申请实施例方案所应用于其上的终端的限定,具体的服务器可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
其中,所述处理器用于运行存储在存储器中的计算机程序,并在执行所述计算机程序时实现本申请实施例提供的任意一种所述的安全告警方法。
需要说明的是,所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的终端的具体工作过程,可以参考前述安全告警方法实施例中的对应过程,在此不再赘述。
本申请实施例还提供一种存储介质,用于计算机可读存储,所述存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现如本申请实施例说明书提供的任一项安全告警方法的步骤。
其中,所述存储介质可以是前述实施例所述的终端的内部存储单元,例如所述终端的内存。所述存储介质也可以是所述终端的外部存储设备,例如所述终端上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施例中,在以上描述中提及的功能模块/单元之间的划分不一定 对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些物理组件或所有物理组件可以被实施为由处理器,如中央处理器、数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。
应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。以上所述,仅为本申请的具体实施例,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (10)

  1. 一种安全告警方法,包括:
    采集图像,并提取所述图像包含的感兴趣区域;
    基于图像语义分割的图像识别模型,对所述感兴趣区域进行图像语义分割,得到所述感兴趣区域包含的目标区域;
    在确定所述感兴趣区域包含人像,且确定所述人像靠近所述目标区域的情况下,发出安全告警。
  2. 根据权利要求1所述的安全告警方法,其中,所述采集图像,并提取所述图像包含的感兴趣区域,包括:
    采集第一图像与第二图像,并获取所述第一图像与所述第二图像之间的差异区域;
    获取所述差异区域在竖直方向与水平方向分别对应的坐标索引的最大值与最小值;
    将所述最大值与所述最小值所对应的边界坐标映射到所述第二图像,并将所述边界坐标在所述第二图像上的映射围成的区域作为感兴趣区域。
  3. 根据权利要求2所述的安全告警方法,其中,获取所述第一图像与所述第二图像之间的差异区域,包括:
    求取所述第一图像与所述第二图像的绝对差异之和;
    对所述绝对差异之和进行二值化处理,得到二值化图像,并根据所述二值化图像,获取差异区域。
  4. 根据权利要求2或者3所述的安全告警方法,其中,将所述边界坐标在所述第二图像上的映射围成的区域作为感兴趣区域,包括:
    将所述边界坐标在所述第二图像上的映射围成的区域作为第一目标区域;
    在确定所述第一目标区域小于或者等于预设区域阈值的情况下,将所述第一目标区域进行放大,并将放大后的区域作为感兴趣区域。
  5. 根据权利要求4所述的安全告警方法,其中,在确定所述第一目标区域小于或者等于预设区域阈值的情况下,将所述第一目标区域进行放大,包括以下的至少一项:
    在所述第一目标区域在竖直方向的坐标索引的最大值与最小值之间的距离小于或者等于预设区域高度阈值的情况下,将所述第一目标区域在竖直方向的坐标索引的最大值与最小值进行更新;
    在所述第一目标区域在水平方向的坐标索引的最大值与最小值之间的距离小于或者等于预设区域宽度阈值的情况下,将所述第一目标区域在水平方向的坐标索引的最大值与最小值进行更新。
  6. 根据权利要求2或者3所述的安全告警方法,其中,将所述边界坐标在所述第二图像上的映射围成的区域作为感兴趣区域,包括:
    将所述边界坐标在所述第二图像上的映射围成的区域进行外扩,得到第二目标区域;
    将所述第二目标区域作为感兴趣区域。
  7. 根据权利要求6所述的安全告警方法,其中,将所述边界坐标在所述第二图像上的映射围成的区域进行外扩,得到第二目标区域,包括:
    将所述边界坐标在所述第二图像上的映射围成的区域进行外扩,得到外扩区域;
    将所述外扩区域与所述第二图像相对应的边界端点进行比较,得到所述外扩区域与所述第二图像之间的重叠区域;
    将所述重叠区域作为所述第二目标区域。
  8. 根据权利要求1所述的安全告警方法,其中,确定所述人像靠近所述目标区域,包括:
    获取所述人像的中心点;
    以所述中心点为圆心,以预设步长为半径进行遍历,获取所述半径与所述目标区域相交叉所对应的最小值;
    在所述最小值小于或者等于预设距离阈值的情况下,判定所述人像靠近所述目标区域。
  9. 一种终端,所述终端包括处理器、存储器、存储在所述存储器上并可被所述处理器执行的计算机程序,以及用于实现所述处理器和所述存储器之间的连接通信的数据总线,其中所述计算机程序被所述处理器执行时,实现如权利要求1至8中任一项所述的安全告警方法的步骤。
  10. 一种存储介质,用于计算机可读存储,所述存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现权利要求1至8中任一项所述的安全告警的方法的步骤。
PCT/CN2023/131712 2022-12-16 2023-11-15 安全告警方法、终端及计算机可读存储介质 WO2024125192A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211625131.XA CN118247804A (zh) 2022-12-16 2022-12-16 安全告警方法、终端及计算机可读存储介质
CN202211625131.X 2022-12-16

Publications (1)

Publication Number Publication Date
WO2024125192A1 true WO2024125192A1 (zh) 2024-06-20

Family

ID=91484420

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/131712 WO2024125192A1 (zh) 2022-12-16 2023-11-15 安全告警方法、终端及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN118247804A (zh)
WO (1) WO2024125192A1 (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103150550A (zh) * 2013-02-05 2013-06-12 长安大学 一种基于运动轨迹分析的道路行人事件检测方法
US20140355882A1 (en) * 2011-12-16 2014-12-04 Panasonic Intellectual Property Corporation Of America Image region extraction device, image region extraction method, and image region extraction program
CN110009650A (zh) * 2018-12-20 2019-07-12 浙江新再灵科技股份有限公司 一种扶梯扶手边界区域越界检测方法与系统
CN111383244A (zh) * 2020-02-28 2020-07-07 浙江大华技术股份有限公司 一种目标检测跟踪方法
CN112613668A (zh) * 2020-12-26 2021-04-06 西安科锐盛创新科技有限公司 基于人工智能的景区危险区域管控方法
WO2022012425A1 (zh) * 2020-07-16 2022-01-20 长沙智能驾驶研究院有限公司 目标检测方法、装置及电子设备

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140355882A1 (en) * 2011-12-16 2014-12-04 Panasonic Intellectual Property Corporation Of America Image region extraction device, image region extraction method, and image region extraction program
CN103150550A (zh) * 2013-02-05 2013-06-12 长安大学 一种基于运动轨迹分析的道路行人事件检测方法
CN110009650A (zh) * 2018-12-20 2019-07-12 浙江新再灵科技股份有限公司 一种扶梯扶手边界区域越界检测方法与系统
CN111383244A (zh) * 2020-02-28 2020-07-07 浙江大华技术股份有限公司 一种目标检测跟踪方法
WO2022012425A1 (zh) * 2020-07-16 2022-01-20 长沙智能驾驶研究院有限公司 目标检测方法、装置及电子设备
CN112613668A (zh) * 2020-12-26 2021-04-06 西安科锐盛创新科技有限公司 基于人工智能的景区危险区域管控方法

Also Published As

Publication number Publication date
CN118247804A (zh) 2024-06-25

Similar Documents

Publication Publication Date Title
EP3806064B1 (en) Method and apparatus for detecting parking space usage condition, electronic device, and storage medium
US20170032514A1 (en) Abandoned object detection apparatus and method and system
WO2020146980A1 (zh) 车道线识别方法、车道线识别装置以及非易失性存储介质
TW202117595A (zh) 目標檢測方法、電子設備和電腦可讀儲存媒介
WO2018058530A1 (zh) 目标检测方法、装置以及图像处理设备
JP2017103748A (ja) 画像処理方法およびプログラム
US20160180201A1 (en) Image processing
WO2021022698A1 (zh) 尾随检测方法、装置、电子设备及存储介质
CN113012383A (zh) 火灾检测报警方法、相关系统、相关设备及存储介质
CN112733666A (zh) 一种难例图像的搜集、及模型训练方法、设备及存储介质
CN113487639A (zh) 一种图像处理方法、装置、电子设备及存储介质
CN113762220B (zh) 目标识别方法、电子设备、计算机可读存储介质
WO2018058573A1 (zh) 对象检测方法、对象检测装置以及电子设备
CN113298122B (zh) 目标检测方法、装置和电子设备
CN112396060B (zh) 基于身份证分割模型的身份证识别方法及其相关设备
WO2024125192A1 (zh) 安全告警方法、终端及计算机可读存储介质
CN113139477A (zh) 训练井盖检测模型的方法、装置、设备及计算机存储介质
CN112347988A (zh) 口罩识别模型的训练方法、装置、计算机设备和可读存储介质
CN112347989A (zh) 反光衣识别方法、装置、计算机设备和可读存储介质
CN113947795B (zh) 口罩佩戴检测方法、装置、设备及存储介质
WO2022247684A1 (zh) 基站馈线检测方法、系统及相关装置
CN110610178A (zh) 图像识别方法、装置、终端及计算机可读存储介质
CN116168345A (zh) 火灾检测方法及相关设备
WO2018110377A1 (ja) 映像監視装置
JP7180827B2 (ja) 一般物体認識システム

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: 23902392

Country of ref document: EP

Kind code of ref document: A1