A monitoring area configuration method and a security system

CN123016345APending Publication Date: 2026-10-30BEIJING QIREN TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611199970.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-07
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

相关技术中,通常需要用户手动绘制、选择或反复调整监控区域,配置过程较为繁琐,难以快速获得符合实际监控需求的区域配置

Benefits of technology

[0017]本发明的有益效果在于:本发明利用部署于终端设备的语义分割模型对安防设备拍摄的目标图像进行语义分割,能够在终端设备本地识别目标图像中的不同区域。用户选择目标区域类别后,终端设备根据对应类别的像素生成并显示候选感兴趣区域,使用户可以直接从与所选类别对应的候选感兴趣区域中确认目标感兴趣区域,并将目标感兴趣区域的区域信息发送至安防设备。这样,可以减少用户手动绘制和反复调整监控区域的操作,提高监控区域的配置效率,并使配置结果更好地符合用户的实际监控需求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123016345A_ABST
    Figure CN123016345A_ABST
Patent Text Reader

Abstract

The application provides a monitoring area configuration method and a security system, and relates to the field of security monitoring. The method comprises the following steps: acquiring a target image captured by a security device; performing semantic segmentation by using a semantic segmentation model deployed on a terminal device to obtain a class label map in which each pixel has a preset area class; determining a target area class according to user selection, and generating and displaying a candidate region of interest according to the corresponding pixels; determining a target region of interest according to user confirmation; and sending the area information of the target region of interest to the security device as monitoring area configuration information. The application can reduce the operation of manually drawing and repeatedly adjusting the monitoring area, and improve the configuration efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of security monitoring, and in particular to a method for configuring a monitoring area and a security system. Background Technology

[0002] In security monitoring scenarios, it is typically necessary to configure corresponding monitoring areas on the monitoring screen of security equipment according to actual monitoring needs. Related technologies usually require users to manually draw, select, or repeatedly adjust the monitoring areas, making the configuration process cumbersome and difficult to quickly obtain area configurations that meet actual monitoring requirements. Summary of the Invention

[0003] The purpose of this invention is to provide a monitoring area configuration method and a security system to reduce the user's manual drawing and repeated adjustment of the monitoring area, thereby improving the configuration efficiency of the monitoring area.

[0004] To address the aforementioned technical problems, this invention provides a monitoring area configuration method applied to a terminal device, the method comprising: Acquire target images captured by security equipment; The target image is semantically segmented using a semantic segmentation model deployed on the terminal device to obtain a category label map; wherein each pixel in the category label map has a corresponding preset region category; Receive user selection information for the preset area category, and determine the target area category based on the selection information; Based on the pixels in the category label image that belong to the target region category, generate and display candidate regions of interest corresponding to the target region category; Receive confirmation information from the user regarding the candidate regions of interest, and determine the target region of interest from the candidate regions of interest based on the confirmation information; The area information of the target region of interest is sent to the security device as monitoring area configuration information.

[0005] Optionally, the step of performing semantic segmentation on the target image using a semantic segmentation model deployed on the terminal device includes: Obtain the computing power information of the terminal device; The image scaling ratio is determined based on the computing power information, and the target semantic segmentation model is determined from multiple candidate semantic segmentation models deployed on the terminal device. The target image is scaled according to the image scaling ratio to obtain the image to be segmented, and the target semantic segmentation model is used to perform semantic segmentation on the image to be segmented.

[0006] Optionally, generating candidate regions of interest corresponding to the target region category based on pixels in the category label image whose category is the target region category includes: The position of each pixel in the category label image is mapped from the coordinate system of the image to be segmented to the original coordinate system of the target image; The candidate region of interest is generated based on pixels mapped to the original coordinate system and belonging to the target region category.

[0007] Optionally, after generating the candidate region of interest, the method further includes: Based on the region contour of the candidate region of interest, boundary refinement regions are determined on both sides of the region contour; wherein, the greater the reduction of the image to be segmented relative to the target image, the greater the width of the boundary refinement region; Using image information located within the boundary refinement area in the target image, the region contour of the candidate region of interest is refined.

[0008] Optionally, determining the boundary refinement area includes: The initial width of the boundary refinement area is determined based on the image scaling ratio; The corresponding width adjustment parameter is determined according to the target region category, and the initial width is adjusted according to the width adjustment parameter to obtain the target width of the boundary refinement region.

[0009] Optionally, the boundary refinement of the region contour of the candidate region of interest includes: Based on the target region category, at least one boundary refinement method is selected from local fine segmentation, edge alignment with the target image, boundary re-extraction after local super-resolution processing, hole filling, and contour smoothing. Within the boundary refinement area, the image information in the target image is processed according to the selected boundary refinement method, and the region contour of the candidate region of interest is updated based on the processing result.

[0010] Optionally, generating candidate regions of interest corresponding to the target region category based on pixels in the category label image whose category is the target region category includes: Based on the pixels in the category label image that belong to the target region category, generate a category mask corresponding to the target region category; Determine each connected region in the category mask; The candidate regions of interest are generated based on each of the connected regions, and the target region category is determined as the region category of each candidate region of interest.

[0011] Optionally, generating the candidate regions of interest based on each of the connected regions includes: Obtain the corresponding region processing parameters according to the target region category; wherein, the region processing parameters include at least one of region filtering parameters, shape adjustment parameters, and contour processing parameters; Based on the region processing parameters, each connected region is subjected to at least one of the following processing methods: region filtering, shape adjustment, and contour processing, and the candidate region of interest is generated based on the processing results.

[0012] Optionally, acquiring the target image captured by the security device includes: When a user triggers a region recognition operation on the video preview page of the security device, the target image is obtained from the video stream of the security device.

[0013] Optionally, the region information includes region contour data and region category; The step of sending the area information of the target region of interest as monitoring area configuration information to the security device includes: The region outline of the target region of interest is converted into a polygon with a preset number of vertices, and the position data of each vertex in the polygon and the region category corresponding to the target region of interest are sent to the security device.

[0014] Optionally, the region information includes region contour data and region category; The step of sending the area information of the target region of interest as monitoring area configuration information to the security device includes: A semantic mask is generated based on the target region of interest and its corresponding region category. The semantic mask is then divided into blocks and compressed to obtain a compressed block image, which is then sent to the security device.

[0015] The present invention also provides a security system, including security equipment and terminal equipment, wherein the security equipment and the terminal equipment establish a communication connection; The security equipment is used to capture and send target images to the terminal device, and to receive monitoring area configuration information sent by the terminal device; The terminal device is used to execute the above-described monitoring area configuration method.

[0016] This invention provides a monitoring area configuration method applied to a terminal device. The method includes: acquiring a target image captured by a security device; performing semantic segmentation on the target image using a semantic segmentation model deployed on the terminal device to obtain a category label map; wherein each pixel in the category label map has a corresponding preset region category; receiving user selection information for the preset region category and determining a target region category based on the selection information; generating and displaying candidate regions of interest corresponding to the target region category based on pixels in the category label map whose category is the target region category; receiving user confirmation information for the candidate regions of interest and determining a target region of interest from the candidate regions of interest based on the confirmation information; and sending the region information of the target region of interest as monitoring area configuration information to the security device.

[0017] The beneficial effects of this invention are as follows: This invention utilizes a semantic segmentation model deployed on the terminal device to perform semantic segmentation on target images captured by security equipment, enabling the local identification of different regions within the target image on the terminal device. After the user selects a target region category, the terminal device generates and displays candidate regions of interest (ROIs) based on the pixels of the corresponding category. This allows the user to directly confirm the target ROI from the candidate ROIs corresponding to the selected category and sends the region information of the target ROI to the security equipment. This reduces the need for users to manually draw and repeatedly adjust monitoring areas, improves the configuration efficiency of monitoring areas, and ensures that the configuration results better meet the user's actual monitoring needs.

[0018] The present invention also provides a security system that has the above-mentioned beneficial effects. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0020] Figure 1 A structural block diagram of a security system provided in an embodiment of the present invention; Figure 2 A flowchart illustrating a monitoring area configuration method provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the monitoring area configuration structure provided in an embodiment of the present invention; Figure 4 A flowchart illustrating another monitoring area configuration method provided in an embodiment of the present invention; Figure 5This is a structural block diagram of a monitoring area configuration device provided in an embodiment of the present invention; Figure 6 This is a structural block diagram of a terminal device provided in an embodiment of the present invention. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0022] To improve the monitoring effectiveness of security equipment, users can set monitoring zones to specify the key monitoring areas. However, while related technologies can identify target objects (such as pedestrians and vehicles) within the monitoring zone, they typically only represent the identified area as a rectangular region, failing to accurately match the actual outline of the target object. This makes them ineffective for setting up monitoring zones in irregular or large areas such as fences, lawns, and sidewalks. Furthermore, some methods extract and highlight moving areas using frame differencing and background modeling. These methods cannot distinguish semantic categories, such as specifying "car," "lawn," or "wall," and cannot generate stable regions for static scene elements. Therefore, these technologies still rely on users manually drawing each monitoring zone, which can negatively impact the user experience of the security equipment.

[0023] In view of this, regarding the technical problem of how to achieve automatic configuration of monitoring areas, reduce the manual drawing and repeated adjustment of monitoring areas by users, and improve the configuration efficiency of monitoring areas, this embodiment provides a monitoring area configuration method. This method can identify the region category in the target image locally on the terminal device, first generate corresponding candidate regions of interest based on the region category selected by the user, then have the user confirm the specific image region, and send the confirmed region outline and region category to the security device. In this way, this embodiment can automatically identify the outline and region category corresponding to each type of region of interest (i.e., monitoring area), and the user can simply select the region of interest they need, achieving efficient configuration of monitoring areas and reducing user operations.

[0024] It should be noted that the execution subject of this method is the terminal device. This embodiment does not limit the specific type of the terminal device, such as a mobile phone, tablet computer, personal computer, etc.

[0025] In addition, this embodiment can also provide a security system. Please refer to... Figure 1 , Figure 1This is a structural block diagram of a security system provided in an embodiment of the present invention. The system may include a security device 20 and a terminal device 10, and the security device 20 and the terminal device 10 can establish a communication connection through a communication network 30.

[0026] Security device 20 is used to capture and send target images to terminal device 10, and to receive monitoring area configuration information sent by terminal device 10. Terminal device 10 is used to execute the monitoring area configuration method provided in this embodiment. The communication network 30 can be a local area network, the Internet, a wireless local area network, a cellular network, Bluetooth, or other wired or wireless connections. Furthermore, the system can also forward data through routing devices, base stations, or gateway devices.

[0027] In other words, in this embodiment, the target image collected by the security device 20 can be directly sent to the terminal device 10 for monitoring area configuration processing, without having to be uploaded to the cloud server for processing. This effectively eliminates privacy and delay issues caused by uploading to the cloud server, and ensures availability in weak network or offline scenarios.

[0028] This embodiment does not limit the specific type of security device 20. For example, it can be a fixed camera, doorbell camera, pan-tilt camera or other devices with image acquisition capabilities.

[0029] The following describes the monitoring area configuration method provided in this embodiment. Please refer to... Figure 2 , Figure 2 This is a flowchart illustrating a monitoring area configuration method provided in an embodiment of the present invention. The method can be executed by a terminal device and may include: S11. Acquire the target image captured by the security equipment.

[0030] In this embodiment, the terminal device can extract the current frame as the target image from the video stream continuously sent by the security device, or it can obtain a video frame, a playback pause frame, or a pre-saved screenshot specified by the user as the target image.

[0031] For example, when a user clicks the "Recognize" or equivalent button on the video preview page of a security device, the terminal device can capture a frame from the video stream sent by the security device as the target image and begin to perform subsequent recognition steps.

[0032] Based on this, acquiring target images captured by security equipment can include: S111. When a user triggers an area recognition operation on the video preview page of the security device, the target image is obtained from the video stream of the security device.

[0033] In this step, the video preview page can display real-time or playback video from the security device, while the area recognition operation can be triggered by button clicks, menu selections, long presses, or other interactions. In this way, this embodiment can acquire the target image according to user needs and trigger subsequent recognition operations.

[0034] Furthermore, since the identification process takes a period of time, the terminal device can enter an analysis state and display a waiting prompt until the candidate region of interest is generated, so as to provide feedback on the processing progress to the user.

[0035] S12. Use the semantic segmentation model deployed on the terminal device to perform semantic segmentation on the target image to obtain a category label map; wherein, each pixel in the category label map has a corresponding preset region category.

[0036] In this embodiment, semantic segmentation is an image processing procedure that determines the semantic category of each pixel in an image, and can be performed based on a pre-trained semantic segmentation model. Semantic segmentation processing yields a category label map corresponding to the target image. Each pixel in this category label map has a corresponding preset region category; that is, each pixel is assigned a pixel label indicating which preset region category the location belongs to. These preset region categories may include vehicles, fences, lawns, paths, swimming pools, huts, houses, sidewalks, trees, walls, stairs, refrigerators, backgrounds, and other categories. Furthermore, the set of region categories can be added or removed according to the security scenario, and the correspondence between category values, category names, and display attributes can be maintained through a local category mapping table.

[0037] It is worth noting that the semantic segmentation model in this embodiment can be deployed on a terminal device to perform semantic segmentation. However, since the computing power of terminal devices is limited and the computing power of different terminal devices varies, this embodiment can also adjust the type of semantic segmentation model or reduce the size of the target image to suit the computing power of the terminal device, thereby achieving semantic segmentation results with lower resource consumption.

[0038] In one possible scenario, the target image is semantically segmented using a semantic segmentation model deployed on the terminal device to obtain a category label map, which may include: S1211. Obtain the computing power information of the terminal device.

[0039] In this embodiment, the computing power information represents the computing power of the terminal device, which may include at least one of the following: terminal device model, device identifier, processor or system on chip (SoC) model, available memory, whether it has hardware acceleration capabilities such as a neural processing unit (NPU), current operating load, and historical semantic segmentation time.

[0040] In addition to reading static device configurations, this embodiment can also control the terminal device to run preset test tasks and determine the computing power level based on the test task duration. Furthermore, when the historical processing time exceeds the target processing time for the corresponding level, the computing power level can be reduced in subsequent processing to adapt to resource differences of the same model of terminal device under different operating states.

[0041] S1212. Determine the image scaling ratio based on the computing power information, and determine the target semantic segmentation model from multiple candidate semantic segmentation models deployed on the terminal device.

[0042] In this embodiment, the image scaling ratio and target semantic segmentation model can be determined based on computing power information. Different types of candidate semantic segmentation models can have different input sizes, parameter scales, computational loads, or data precision to meet varying computing resource cost requirements.

[0043] Furthermore, before determining the scaling ratio of the target image, it can be determined whether to reduce the resolution of the target image based on the computing power information of the terminal device. If it is necessary to reduce the resolution of the target image, the step of determining the image scaling ratio based on the computing power information is executed; if it is not necessary to reduce the resolution of the target image, the original resolution of the target image is maintained. Then, when maintaining the original resolution, semantic segmentation can be performed directly on the original target image; when it is necessary to reduce the resolution, semantic segmentation can be performed on the scaled target image.

[0044] This embodiment does not limit how to determine whether to reduce the resolution of the target image based on the computing power information of the terminal device. For example, when the computing power information includes hardware type information that can characterize the hardware type, such as device model, device identifier, processor or system-on-a-chip model, it can be determined whether the hardware type information matches the target hardware type information that does not require reducing the resolution of the target image. If they match, it is determined that the resolution of the target image does not need to be reduced; if they do not match, it is determined that the resolution of the target image needs to be reduced.

[0045] Furthermore, when the computing power information includes hardware resource usage information such as processor utilization and memory utilization, which characterize hardware resource usage, it can also be determined whether the hardware resource usage information meets a preset threshold requirement. If it does, it is determined that the target image resolution does not need to be reduced; otherwise, it is determined that the target image resolution needs to be reduced. This preset threshold requirement can be either that the hardware resource usage information is greater than a preset threshold or that it is not greater than a preset threshold, depending on the type of hardware resource usage information. For example, if the hardware resource usage information is hardware resource idle rate (e.g., processor idle rate), then if it is determined that the hardware resource idle rate is greater than the preset threshold, it is determined that the preset threshold requirement is met, and it is determined that the target image resolution does not need to be reduced; if it is determined that the hardware resource idle rate is not greater than the preset threshold, it is determined that the preset threshold requirement is not met, and it is determined that the target image resolution needs to be reduced. Similarly, if the hardware resource usage information is hardware resource utilization rate (e.g., processor utilization rate), then if it is determined that the hardware resource utilization rate is greater than the preset threshold, it is determined that the preset threshold requirement is not met, and it is determined that the target image resolution needs to be reduced; if it is determined that the hardware resource utilization rate is not greater than the preset threshold, it is determined that the preset threshold requirement is met, and it is determined that the target image resolution does not need to be reduced. Different hardware resource types can correspond to different preset thresholds, and the specific value of the preset threshold can be set according to the actual application requirements.

[0046] Furthermore, terminal devices can be pre-set with high, medium, and low computing power levels to match different image scaling ratios and semantic segmentation models.

[0047] For example, the high-performance computing power setting can maintain the original size of the target image and use a standard model, with a processing time of less than approximately 1.5 seconds; the medium-performance computing power setting can reduce the width and height of the target image to half of its original size and use a standard model, with a processing time of less than approximately 2.5 seconds; and the low-performance computing power setting can reduce the width and height of the target image to one-quarter of its original size and use a lightweight model with 8-bit integer quantization, with a processing time of less than approximately 3 seconds. Of course, the above proportions and processing times are merely examples.

[0048] In addition, the scaling ratio and the model can be pre-configured as a combination, or they can be determined separately.

[0049] In addition, users can choose between image quality priority, balanced, or speed priority modes to adjust or override the settings automatically determined based on computing power information.

[0050] S1213. Scale the target image according to the image scaling ratio to obtain the image to be segmented, and use the target semantic segmentation model to perform semantic segmentation on the image to be segmented.

[0051] In this embodiment, the image to be segmented is the actual image input to the target semantic segmentation model. When the image scaling ratio is one, the image to be segmented and the target image have the same size; when the image scaling ratio is less than one, the width and height of the image to be segmented are both smaller than the target image.

[0052] After obtaining the image to be segmented, this embodiment can use a target semantic segmentation model determined by computing power information to output a category label map corresponding to the image to be segmented. This ensures that the terminal device can adapt its processing speed, resource consumption, and region recognition accuracy according to its actual computing power.

[0053] S13. Receive the user's selection information for the preset area category, and determine the target area category based on the selection information.

[0054] In this embodiment, since there are many preset area categories, directly displaying the areas of interest corresponding to all preset area categories may seriously affect the user's viewing and selection confirmation, thereby easily reducing the user's user experience.

[0055] Therefore, in this embodiment, the terminal device can display selectable region categories on the video preview page or the region configuration page. Users can select one region category or multiple region categories simultaneously. The selection information indicates the type of region the user wishes to configure. Furthermore, the terminal device can determine one or more preset region categories selected by the user as the target region category, and can generate or display only candidate regions of interest corresponding to the target region category, avoiding the simultaneous overlay of multiple irrelevant regions that would affect viewing.

[0056] S14. Based on the pixels in the category label image that are classified as the target region category, generate and display candidate regions of interest corresponding to the target region category.

[0057] In this embodiment, based on the pixels in the category label image that belong to the target area category, candidate regions of interest corresponding to the target area category are generated and displayed so that the user can confirm the final monitoring area required.

[0058] In addition to the region outline and region category, each candidate region of interest may also include other attribute information, such as confidence level, display attributes, and processing status. The region outline can be composed of ordered boundary points, and the display attributes can include fill method, fill transparency, and outline style. The terminal device can display the candidate regions of interest on the target image using semi-transparent fill, outline stroking, or a combination of both, allowing the user to simultaneously observe the underlying image and the region range.

[0059] In one possible scenario, candidate regions of interest corresponding to the target region category are displayed, including: S1411. Display candidate regions of interest on the target image using at least one of semi-transparent filling and contour stroking.

[0060] Semi-transparent fills allow users to see both the region identifier and the underlying image simultaneously. Different region categories can use different fill textures, grayscale values, or line styles. In this way, users can distinguish different candidate regions of interest through different semi-transparent fills.

[0061] Furthermore, when the target image has been scaled, the segmentation results can be mapped back to the original coordinate system of the target image, specifically including the following steps.

[0062] S1421. Map the position of each pixel in the category label image from the coordinate system of the image to be segmented to the original coordinate system of the target image.

[0063] In this embodiment, the mapping can be performed based on the proportional relationship between the target image size and the image size to be segmented. For the pixel positions in the category label map, the horizontal and vertical coordinates can be proportionally converted separately. Alternatively, the category label map can be adjusted to the target image size first, and then the region can be extracted from the adjusted label map.

[0064] The pixel positions obtained after mapping use the same coordinate reference as the original image provided by the security equipment for subsequent display and distribution.

[0065] S1422. Generate candidate regions of interest based on pixels mapped to the original coordinate system and whose category is the target region category.

[0066] In this embodiment, candidate regions of interest are generated based on pixels mapped to the original coordinate system and belonging to the target region category, thereby making it easier for users to view candidate regions of interest at their original size in the target image.

[0067] However, image scaling can cause loss of boundary details and coordinate quantization errors. Simply enlarging the low-resolution segmentation result cannot recover the lost boundary information. Therefore, in this embodiment, the candidate region of interest after the initial mapping can be used as the initial region, and further local boundary refinement can be performed in the original target image.

[0068] S15. Receive confirmation information from the user regarding the candidate regions of interest, and determine the target region of interest from the candidate regions of interest based on the confirmation information.

[0069] In this embodiment, after viewing the candidate regions of interest, the user can select the target region of interest that needs to be monitored. Therefore, the terminal device receives the user's confirmation information for the candidate regions of interest and determines the target region of interest from the candidate regions of interest based on the confirmation information, thereby using the target region of interest as the final monitoring area.

[0070] The confirmation message indicates that the user confirms that one or more candidate regions of interest can be used as monitoring areas. Users can confirm one by one, or they can confirm multiple candidate regions of interest under the same target region category in batches.

[0071] Furthermore, in addition to identifying candidate regions of interest, users can also edit these regions. Editing operations can include deletion, outline adjustment, region category modification, and showing or hiding. The editing methods are described below. In one possible scenario, this method may also include: S151. Receive the user's editing operation on the candidate region of interest; the editing operation includes at least one of deletion, outline adjustment, region category modification, display or hiding.

[0072] In this embodiment, deletion is used to remove candidate regions of interest. Contour adjustment can be achieved by dragging contour vertices, adding vertices, deleting vertices, moving the entire region, merging, or splitting it. Region category modification is used to correct category recognition errors, such as changing a region incorrectly labeled as a tree to a lawn. Showing or hiding changes the display state of the candidate regions of interest.

[0073] S152. When the editing operation is deletion, outline adjustment or region category modification, update the corresponding candidate region of interest according to the editing operation. S153. When the editing operation is to show or hide, update the display status of the corresponding candidate region of interest according to the editing operation. S154. When the editing operation is to modify the region category, the modified region category will be determined as the region category of the corresponding candidate region of interest.

[0074] After an editing operation is performed, the edited region outline and region category can be synchronously updated to the region object and display cache. Before user confirmation, the terminal device can simultaneously retain both the automatically generated result and the edited result for undoing or comparison. After user confirmation, the edited result can be used as the target region of interest.

[0075] S16. Send the area information of the target area of ​​interest as the monitoring area configuration information to the security equipment.

[0076] In this embodiment, the region information of the target region of interest is used to clarify the specific information of the region, which may include region contour data and region category. Additionally, the region information may also include other content, such as the detection method and alarm level corresponding to different target regions of interest. The detection method and alarm level can also be flexibly configured by the user; for example, the user can adjust the detection sensitivity of important areas to a higher level and the alarm level of important areas to a higher level, and adjust the detection sensitivity of ordinary areas to a lower level and the alarm level of ordinary areas to a lower level. The monitoring area configuration information is used to clarify the spatial range and area type to be monitored by the security equipment. This monitoring area configuration information at least includes the aforementioned region contour data and region category to ensure that the security equipment focuses on monitoring the designated area. Furthermore, the monitoring area configuration information may also include the aforementioned detection method and alarm level to ensure that the security equipment performs detection and alarm according to the specified detection method and alarm level. The region contour data can be in pixel coordinates, normalized coordinates, or other coordinate formats agreed upon by both parties.

[0077] It should be noted that this embodiment does not limit the format for distributing monitoring area configuration information. For example, to save resources, the monitoring area configuration information can adopt a polygonal outline format; to improve detection accuracy, the monitoring area configuration information can also adopt a compressed block diagram format. The specific forms of these two formats are described below.

[0078] In one possible scenario, sending the area information of the target region of interest as monitoring area configuration information to the security device may include: S161. Convert the region outline of the target region of interest into a polygon with a preset number of vertices, and send the position data of each vertex in the polygon and the region category corresponding to the target region of interest to the security device.

[0079] In this embodiment, the region outline of the target region of interest can be simplified using a polygon with a preset number of vertices to reduce computational resource consumption. The preset number can be eight, or it can be set to other numbers according to the communication protocol. The polygon can be obtained through contour simplification, isometric sampling, vertex selection based on inflection intensity, or fitting. Vertex positions can use pixel coordinates or normalized coordinates. The region category can be encapsulated together with the polygon vertex sequence, enabling the security device to obtain the corresponding region type while parsing the region boundary.

[0080] In another possible scenario, sending the area information of the target region of interest as monitoring area configuration information to the security device may include: S162. Generate a semantic mask based on the target region of interest and its corresponding region category. Perform block and compression processing on the semantic mask to obtain a compressed block map, and send the compressed block map to the security device.

[0081] In this embodiment, a semantic mask can be generated based on the target region of interest and its corresponding region category. The semantic mask is then segmented and compressed to obtain a compressed block image. The semantic mask can accurately mark the outline of the target region of interest and indicate the region type corresponding to the target region of interest.

[0082] Terminal devices can divide semantic masks into multiple image blocks and compress or encode the category data within these blocks to form compressed block images. This format can indicate the pixel range of irregular areas and reduce the amount of regional data that needs to be transmitted. The specific encoding process of the compressed block image can be implemented according to the protocol agreed upon between the terminal device and the security equipment.

[0083] It should be noted that the two formats mentioned above can be selected as needed. In one case, the compressed block image format can be used as the preferred format for distribution, while the polygon outline format is used as an alternative format supported by the protocol.

[0084] Furthermore, terminal devices can send monitoring area configuration information via Message Queuing Telemetry Transport (MQTT) protocol, local area network communication protocol, cellular network communication protocol, Bluetooth communication protocol, or other communication methods.

[0085] Furthermore, after receiving and parsing the configuration information of the monitored area, the security equipment can execute different monitoring strategies for each target area of ​​interest. For example, it can trigger an alarm within the target area, set the target area as an alarm exclusion zone, track objects entering the target area, or display the area outline and area category in the video footage. This monitoring strategy can be flexibly configured by the user.

[0086] Furthermore, for fixed-view security devices such as fixed cameras or doorbell cameras, the monitored area can be directly bound to the image coordinate system. For PTZ cameras, the firmware of the security device can combine the PTZ posture before and after camera rotation with preset coordinate transformation relationships to convert the saved area outline into coordinates suitable for the current or reference viewing angle, ensuring that the original monitored area still corresponds to the corresponding physical area after the camera rotates. The terminal device can also send the current PTZ posture along with the monitored area configuration information for the security device to complete coordinate adaptation. This coordinate adaptation process is an additional processing step in the monitoring area application stage.

[0087] Based on the above embodiments, this invention utilizes a semantic segmentation model deployed on the terminal device to perform semantic segmentation on target images captured by security equipment, enabling the local identification of different regions within the target image on the terminal device. After the user selects a target region category, the terminal device generates and displays candidate regions of interest (ROIs) based on the pixels of the corresponding category. This allows the user to directly confirm the target ROI from the candidate ROIs corresponding to the selected category, and sends the region contour data and region category of the target ROI to the security equipment. This reduces the need for users to manually draw and repeatedly adjust monitoring areas, improves the configuration efficiency of monitoring areas, and ensures that the configuration results better meet the user's actual monitoring needs.

[0088] Based on the above embodiments, due to factors such as the processing accuracy of the semantic segmentation model and image scaling, the contour of the candidate region of interest may deviate from the actual region contour. To further reduce user editing operations, this embodiment can also refine the boundaries of the candidate region of interest to improve the contour fitting effect.

[0089] In one possible scenario, after generating the candidate region of interest, the method further includes: S1431. Based on the region contour of the candidate region of interest, determine the boundary refinement region on both sides of the region contour; wherein, the greater the reduction of the image to be segmented relative to the target image, the wider the boundary refinement region.

[0090] In this embodiment, the boundary refinement area can be formed by extending the original region outline inwards and outwards to create a strip-shaped region. The refinement process only processes the original image information within this strip-shaped region, thereby correcting boundary deviations while reducing computational load.

[0091] It should be noted that this embodiment does not limit the width of the boundary refinement area, which can be set according to actual application requirements. For example, when the image scaling ratio is 1 / k of the original size, one pixel in the image to be segmented corresponds to approximately k×k pixel regions in the original target image; the greater the scaling, the larger the potential boundary quantization error range, so the refinement area should cover this error range and be appropriately enlarged. As an example, refinement can be omitted when maintaining the original size, or the width can be set to 4 pixels; when the scaling ratio is half, a width of approximately 16~24 pixels can be set; when the scaling ratio is one-quarter, a width of 32~40 pixels can be set.

[0092] S1432. Using image information located within the boundary refinement region in the target image, refine the boundary of the candidate region of interest.

[0093] In this embodiment, boundary refinement can reanalyze the color, texture, gradient, and local semantic features within the boundary refinement area, and update the region boundary based on the analysis results. Since the processing range is limited to the vicinity of the candidate region boundary, the terminal device does not need to perform semantic segmentation on the entire original target image again, which can save computing resources and improve the edge segmentation quality.

[0094] The width of the boundary refinement area can be further adjusted based on the target area category, specifically including the following steps.

[0095] S1441. Determine the initial width of the boundary refinement area based on the image scaling ratio.

[0096] In this embodiment, the correspondence between the image scaling ratio and the initial width of the boundary refinement area can be preset. For example, the correspondence can be established through a scaling table, segmentation rules, or continuous variation relationship. When using a continuous variation relationship, the corresponding scaling factor can also be determined according to the image scaling ratio, and the initial width can be determined according to the scaling factor and a preset coefficient, so that the initial width changes with the scaling ratio.

[0097] S1442. Determine the corresponding width adjustment parameters according to the target area category, and adjust the initial width according to the width adjustment parameters to obtain the target width of the boundary refinement area.

[0098] In this embodiment, considering that different region categories have different boundary shapes, the initial width can be adjusted according to different region categories. For example, slender regions such as fences and tree branches are prone to breakage after scaling, so a larger width adjustment parameter can be used; planar regions such as lawns, roads, and swimming pools can use a standard width adjustment parameter; regular block-shaped regions such as vehicles and refrigerators can use a smaller width adjustment parameter; and complex and irregular regions such as tree canopies can have their refinement range appropriately expanded.

[0099] The width adjustment parameter can be an adjustment ratio or an adjustment value. When the parameter is an adjustment ratio, the initial width obtained based on the scaling ratio can be multiplied by the adjustment ratio corresponding to the region category to obtain the target width; when the width adjustment parameter is an adjustment value, the corresponding adjustment value can be added to or subtracted from the initial width.

[0100] Different boundary refinement methods can be selected for different region categories, specifically including the following steps.

[0101] S1451. Based on the target region category, select at least one boundary refinement method from local fine segmentation, edge alignment with the target image, boundary re-extraction after local super-resolution processing, hole filling, and contour smoothing.

[0102] For example, slender structures like fences can be segmented locally with finer detail and the contour simplification intensity reduced to maintain connectivity; planar areas such as lawns, roads, and swimming pools can be filled with holes and have their contours smoothed to reduce internal voids; regular areas like vehicles can have their coarse boundaries aligned with strong edges in the original target image; and complex areas like tree canopies can have their local finer detail segmentation expanded while preserving natural irregular boundaries. The relationship between region categories and refinement methods can be one-to-one, one-to-many, or a combination.

[0103] S1452. Within the boundary refinement area, process the image information in the target image according to the selected boundary refinement method, and update the region contour of the candidate region of interest based on the processing result.

[0104] Thus, this embodiment can dynamically adjust the width and refinement method of the boundary refinement area according to the scaling ratio and the type of candidate region of interest, so as to ensure that the boundary refinement is adapted to the specific scaling situation and the type of candidate region of interest.

[0105] Based on the above embodiments, candidate regions of interest can also be generated using category masks and connected components, specifically including the following steps: S1461. Generate a category mask corresponding to the target region category based on the pixels in the category label image that belong to the target region category.

[0106] In this embodiment, the category mask can be a binary image. When the pixel label equals the target region category, the corresponding mask value is set to a valid value; other pixels are set to invalid values. For multiple target region categories, multiple sets of category masks can be generated separately, or a multi-value mask containing multiple category values ​​can be generated.

[0107] S1462. Determine each connected region in the category mask.

[0108] A connected region is a set of spatially connected, valid pixels in a category mask. Whether pixels are connected can be determined using 4-connectivity or 8-connectivity rules. Separate sets of pixels within the same category form different connected regions, thus avoiding merging two non-adjacent vehicles, two separate lawns, or multiple independent entrances / exits into a single area.

[0109] S1463. Generate candidate regions of interest based on each connected region, and determine the target region category as the region category of each candidate region of interest.

[0110] Each connected region can be assigned a unique region identifier. The region category of a candidate region of interest can be set to the target region category corresponding to the category mask, thereby establishing the association between the region outline and the region category.

[0111] Based on the above embodiments, since the morphology of different types of candidate regions of interest differs, and the recognition error types corresponding to different types of candidate regions of interest are different due to factors such as the processing accuracy of semantic segmentation models and image scaling. Therefore, in order to reduce errors and perform targeted repairs on different types of candidate regions of interest, this embodiment can also perform differentiated repair processing according to region categories.

[0112] In one possible scenario, generating the candidate regions of interest based on each of the connected regions may include: S1471. Obtain the corresponding region processing parameters according to the target region category; wherein, the region processing parameters include at least one of region filtering parameters, shape adjustment parameters, and contour processing parameters.

[0113] Region filtering parameters determine whether connected regions should be preserved and may include a minimum area threshold (MinArea) and a confidence threshold (Threshold_conf). Morphological adjustment parameters indicate the morphological processing methods performed on the binary regions corresponding to the connected regions and the size of the structuring elements used; morphological processing methods may include opening and closing operations, where opening is used to remove isolated noise points and closing is used to fill small holes within the region. Contour processing parameters indicate how to simplify the outer contour of the connected regions and may include a contour simplification threshold. Region processing parameters may also include a merge distance threshold (MergeDist) for merging similar neighboring fragments. Different target region categories may correspond to different parameter values; for example, a smaller minimum area threshold may be used for the tree category, while a larger merge distance threshold may be used for the lawn category.

[0114] It is understandable that different target region categories correspond to different region shapes; therefore, different region processing parameters should be used for different types. This embodiment can set a correspondence between region categories and region processing parameters, thereby obtaining the corresponding region processing parameters based on this correspondence.

[0115] S1472. Based on the region processing parameters, perform at least one of the following processing on each connected region: region filtering, shape adjustment, and contour processing, and generate candidate regions of interest based on the processing results.

[0116] Specifically, the terminal device can eliminate connected regions with small areas based on a minimum area threshold. If the semantic segmentation model outputs a confidence score, it can also eliminate connected regions with low average confidence scores based on a confidence score threshold. For the remaining connected regions after filtering, they can be represented as corresponding binary regions, and opening or closing operations can be performed according to morphological adjustment parameters. Subsequently, the terminal device can extract the outer contour of the processed connected regions and use the Douglas-Peucker algorithm to reduce the number of contour vertices according to a contour simplification threshold. Adjacent fragments within the same target region category that are less than the merging distance threshold and have small areas can be merged; connected regions that do not meet the merging conditions are generated as independent candidate regions of interest.

[0117] Based on the above embodiments, the following is a complete description of the above monitoring area configuration method based on specific schematic diagrams.

[0118] Please refer to Figure 3 , Figure 3 This diagram illustrates the monitoring area configuration structure provided in this embodiment of the invention. The security device sends its captured target image to the terminal device, where the image acquisition module acquires the target image. After the user triggers an area recognition operation, the analysis scheduling module initiates the analysis process and displays the analysis progress via a waiting prompt module. A semantic segmentation module is deployed on the terminal device to perform local semantic segmentation on the target image; a region of interest (ROI) generation module generates candidate ROIs with corresponding region categories based on the semantic segmentation results. A monitoring area management interaction module receives the user's selection of region categories and edits, selects, or confirms candidate ROIs. A ROI display module displays the candidate ROIs corresponding to the user's selected region category on the display interface; a configuration distribution module generates monitoring area configuration information based on the user's confirmation information and sends the region outline data and corresponding region category to the security device for the security device to execute local monitoring strategies such as alarm activation, alarm cancellation, target tracking, or screen display.

[0119] Please refer to Figure 4 , Figure 4 A flowchart illustrating another monitoring area configuration method provided in an embodiment of the present invention. Figure 4 In this process, the terminal device first acquires the target image captured by the security equipment and obtains its computing power information. This computing power information may include processor performance, hardware acceleration capabilities, available memory, current load, and historical image processing time. Based on this computing power information, the terminal device determines the image scaling ratio and selects the target semantic segmentation model from multiple candidate semantic segmentation models to adapt the processing speed, resource consumption, and segmentation accuracy.

[0120] When it is determined that the target image needs to be scaled, the terminal device generates an image to be segmented according to the image scaling ratio; when it is determined that scaling is not required, the original size of the target image is maintained. Subsequently, the target semantic segmentation model deployed on the terminal device is used to perform semantic segmentation on the image to be segmented or the original-sized target image to obtain a category label map. Each pixel in the category label map corresponds to a preset region category.

[0121] When the target image is scaled, the terminal device maps the pixel positions in the category label image from the coordinate system of the image to be segmented to the original coordinate system of the target image. Without scaling, the pixel positions in the category label image can be used directly, or a coordinate mapping with a scale of one can be performed. This ensures that the subsequently generated region contour uses the same coordinate reference as the original image captured by the security equipment.

[0122] The terminal device receives the user's selection information for a preset region category, determines the target region category, and generates a category mask based on the pixels in the category label image that belong to the target region category. The terminal device determines each connected region in the category mask, so that spatially separated regions of the same type form independent candidate regions of interest. For each connected region, corresponding region processing parameters can be obtained according to the target region category, and at least one of region filtering, shape adjustment, and contour processing can be performed to remove false fragment detections, fill region holes, or smooth region contours.

[0123] For candidate regions of interest mapped to the original coordinate system, the terminal device can determine boundary refinement regions on both sides of the region contour. The greater the reduction in size of the image to be segmented relative to the target image, the wider the boundary refinement region can be; this width can also be further adjusted according to the boundary shape corresponding to the target region category. The terminal device selects at least one refinement method based on the target region category: local fine segmentation, edge alignment, re-extraction of boundaries after local super-resolution processing, hole filling, or contour smoothing, and updates the region contour using local image information from the original target image. When the target image is not scaled, boundary refinement may not be performed, or only lightweight contour smoothing may be performed.

[0124] The terminal device displays candidate regions of interest on the target image using at least one of semi-transparent filling and outline tracing. Users can perform editing operations on the candidate regions of interest, such as deletion, outline adjustment, region category modification, showing or hiding, and determine the target region of interest from the candidate regions of interest after confirmation.

[0125] Finally, the terminal device generates monitoring area configuration information based on the region outline data and region category of the target region of interest, and sends it to the security device. The region outline data can be polygon coordinates with a preset number of vertices, or a semantic mask can be generated based on the target region of interest. The compressed block image obtained after block segmentation and compression is then sent to the security device so that the security device can execute the corresponding local monitoring strategy.

[0126] The monitoring area configuration device, terminal equipment, computer-readable storage medium, and computer program product provided in this embodiment are described below. The monitoring area configuration device, terminal equipment, computer-readable storage medium, and computer program product described below can be referred to in correspondence with the monitoring area configuration method described above.

[0127] Please refer to Figure 5 , Figure 5 This is a structural block diagram of a monitoring area configuration device provided in an embodiment of the present invention. The device is deployed in a terminal device and may include: Image acquisition module 501 is used to acquire target images captured by security equipment; The semantic segmentation module 502 is used to perform semantic segmentation on the target image using a semantic segmentation model deployed on the terminal device to obtain a category label map; wherein, each pixel in the category label map has a corresponding preset region category; The category determination module 503 is used to receive the user's selection information for the preset area category, and determine the target area category based on the selection information; The region generation and display module 504 is used to generate and display candidate regions of interest corresponding to the target region category based on the pixels in the category label image that belong to the target region category; The confirmation processing module 505 is used to receive confirmation information from the user regarding the candidate region of interest, and to determine the target region of interest from the candidate region of interest based on the confirmation information. The configuration sending module 506 is used to send the region contour data and region category of the target region of interest as monitoring area configuration information to the security device. The above module corresponds to each processing step of the monitoring area configuration method.

[0128] Optionally, the semantic segmentation module 502 includes: A computing power acquisition unit is used to acquire computing power information of the terminal device; A processing configuration determination unit is used to determine the image scaling ratio based on the computing power information, and to determine the target semantic segmentation model from multiple candidate semantic segmentation models deployed on the terminal device. The segmentation execution unit is used to scale the target image according to the image scaling ratio to obtain an image to be segmented, and to perform semantic segmentation on the image to be segmented using the target semantic segmentation model.

[0129] Optionally, the region generation and display module 504 includes: A coordinate mapping unit is used to map the position of each pixel in the category label image from the coordinate system of the image to be segmented to the original coordinate system of the target image; The first candidate region generation unit is used to generate the candidate region of interest based on pixels mapped to the original coordinate system and belonging to the target region category.

[0130] Optionally, it further includes a boundary processing module, the boundary processing module comprising: The refinement region determination unit is used to determine boundary refinement regions on both sides of the region contour based on the region contour of the candidate region of interest; wherein, the greater the reduction of the image to be segmented relative to the target image, the greater the width of the boundary refinement region; The boundary refinement unit is used to refine the boundary contour of the candidate region of interest by utilizing image information located within the boundary refinement area in the target image.

[0131] Optionally, the refinement area determination unit includes: An initial width determination subunit is used to determine the initial width of the boundary refinement region based on the image scaling ratio; The target width determination subunit is used to determine the corresponding width adjustment parameter according to the target region category, and adjust the initial width according to the width adjustment parameter to obtain the target width of the boundary refinement region.

[0132] Optionally, the boundary refinement unit includes: The refinement method selection subunit is used to select at least one boundary refinement method from local fine segmentation, edge alignment with the target image, boundary re-extraction after local super-resolution processing, hole filling and contour smoothing according to the target region category. The contour update subunit is used to process the image information in the target image within the boundary refinement area according to the selected boundary refinement method, and update the region contour of the candidate region of interest based on the processing result.

[0133] Optionally, the region generation and display module 504 includes: The category mask generation unit is used to generate a category mask corresponding to the category of the target region based on the pixels in the category label image whose category is the target region category; A connected region determination unit is used to determine each connected region in the category mask; The second candidate region generation unit is used to generate the candidate regions of interest according to each of the connected regions, and to determine the target region category as the region category of each of the candidate regions of interest.

[0134] Optionally, the second candidate region generation unit includes: The region parameter acquisition subunit is used to acquire corresponding region processing parameters according to the target region category; wherein, the region processing parameters include at least one of region filtering parameters, shape adjustment parameters, and contour processing parameters; The region processing subunit is used to perform at least one of the following processing on each of the connected regions according to the region processing parameters: region filtering, shape adjustment, and contour processing, and generate the candidate region of interest based on the processing results.

[0135] Optionally, the image acquisition module 501 is used to acquire the target image from the video stream of the security device when it receives a region recognition operation triggered by a user on the video preview page of the security device; The region generation and display module 504 is used to display the candidate region of interest on the target image using at least one of semi-transparent filling and contour stroking.

[0136] Optionally, an interactive editing module is also included for: Receive user editing operations on the candidate regions of interest; wherein the editing operations include at least one of deletion, outline adjustment, region category modification, display, or hiding; When the editing operation is deletion, outline adjustment, or region category modification, the corresponding candidate region of interest is updated according to the editing operation. When the editing operation is to show or hide, the display state of the corresponding candidate region of interest is updated according to the editing operation; When the editing operation is a region category modification, the modified region category is determined as the region category of the corresponding candidate region of interest.

[0137] Optionally, the configuration sending module 506 includes: A polygon configuration unit is used to convert the region outline of the target region of interest into a polygon with a preset number of vertices, and send the position data of each vertex in the polygon and the region category corresponding to the target region of interest to the security device; And / or, a compressed block map configuration unit is used to generate a semantic mask based on the target region of interest and its corresponding region category, perform block and compression processing on the semantic mask to obtain a compressed block map, and send the compressed block map to the security device.

[0138] Please refer to Figure 6 , Figure 6 This is a structural block diagram of a terminal device provided in an embodiment of the present invention. The embodiment of the present invention provides a terminal device 10, including a processor 11 and a memory 12; wherein, the memory 12 is used to store a computer program; the processor 11 is used to execute the monitoring area configuration method provided in the foregoing embodiment when executing the computer program.

[0139] For details on the specific process of configuring the monitoring area described above, please refer to the relevant content provided in the foregoing embodiments, which will not be repeated here.

[0140] Furthermore, the memory 12, as a carrier for resource storage, can be a read-only memory, random access memory, disk, or optical disk, and the storage method can be temporary or permanent storage. The memory 12 can be used to store computer programs, category mapping tables, region category strategy tables, candidate semantic segmentation models, and monitoring region configuration data.

[0141] In addition, the terminal device 10 also includes a power supply 13, a communication interface 14, an input / output interface 15, and a communication bus 16; wherein, the power supply 13 is used to provide operating voltage for each hardware device on the terminal device 10; the communication interface 14 can create a data transmission channel between the terminal device 10 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this invention, and is not specifically limited here; the input / output interface 15 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0142] This embodiment also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the aforementioned monitoring area configuration method. The computer-readable storage medium can be a read-only memory, random access memory, magnetic storage medium, optical storage medium, or other media capable of storing program instructions.

[0143] This embodiment also provides a computer program product, which includes a computer program that, when executed by a processor, implements the aforementioned monitoring area configuration method.

[0144] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0145] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0146] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0147] The monitoring area configuration method and security system provided by this invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this invention. It should be noted that those skilled in the art can make several improvements and modifications to this invention without departing from the principles of this invention, and these improvements and modifications also fall within the protection scope of this invention.

Claims

1. A method for configuring a monitoring area, characterized in that, Applied to a terminal device, the method includes: Acquire target images captured by security equipment; The target image is semantically segmented using a semantic segmentation model deployed on the terminal device to obtain a category label map; wherein each pixel in the category label map has a corresponding preset region category; Receive user selection information for the preset area category, and determine the target area category based on the selection information; Based on the pixels in the category label image that belong to the target region category, generate and display candidate regions of interest corresponding to the target region category; Receive confirmation information from the user regarding the candidate regions of interest, and determine the target region of interest from the candidate regions of interest based on the confirmation information; The area information of the target region of interest is sent to the security device as monitoring area configuration information.

2. The monitoring area configuration method according to claim 1, characterized in that, The step of performing semantic segmentation on the target image using a semantic segmentation model deployed on the terminal device includes: Obtain the computing power information of the terminal device; The image scaling ratio is determined based on the computing power information, and the target semantic segmentation model is determined from multiple candidate semantic segmentation models deployed on the terminal device. The target image is scaled according to the image scaling ratio to obtain the image to be segmented, and the target semantic segmentation model is used to perform semantic segmentation on the image to be segmented.

3. The monitoring area configuration method according to claim 2, characterized in that, The step of generating candidate regions of interest corresponding to the target region category based on pixels in the category label image that belong to the target region category includes: The position of each pixel in the category label image is mapped from the coordinate system of the image to be segmented to the original coordinate system of the target image; The candidate region of interest is generated based on pixels mapped to the original coordinate system and belonging to the target region category.

4. The monitoring area configuration method according to claim 3, characterized in that, After generating the candidate region of interest, the method further includes: Based on the region contour of the candidate region of interest, boundary refinement regions are determined on both sides of the region contour; wherein, the greater the reduction of the image to be segmented relative to the target image, the greater the width of the boundary refinement region; Using image information located within the boundary refinement area in the target image, the region contour of the candidate region of interest is refined.

5. The monitoring area configuration method according to claim 4, characterized in that, The defined boundary refinement area includes: The initial width of the boundary refinement area is determined based on the image scaling ratio; The corresponding width adjustment parameter is determined according to the target region category, and the initial width is adjusted according to the width adjustment parameter to obtain the target width of the boundary refinement region.

6. The monitoring area configuration method according to claim 5, characterized in that, The boundary refinement of the region contour of the candidate region of interest includes: Based on the target region category, at least one boundary refinement method is selected from local fine segmentation, edge alignment with the target image, boundary re-extraction after local super-resolution processing, hole filling, and contour smoothing. Within the boundary refinement area, the image information in the target image is processed according to the selected boundary refinement method, and the region contour of the candidate region of interest is updated based on the processing result.

7. The monitoring area configuration method according to claim 1, characterized in that, The step of generating candidate regions of interest corresponding to the target region category based on pixels in the category label image that belong to the target region category includes: Based on the pixels in the category label image that belong to the target region category, generate a category mask corresponding to the target region category; Determine each connected region in the category mask; The candidate regions of interest are generated based on each of the connected regions, and the target region category is determined as the region category of each candidate region of interest.

8. The monitoring area configuration method according to claim 7, characterized in that, The step of generating the candidate regions of interest based on each of the connected regions includes: Obtain the corresponding region processing parameters according to the target region category; wherein, the region processing parameters include at least one of region filtering parameters, shape adjustment parameters, and contour processing parameters; Based on the region processing parameters, each connected region is subjected to at least one of the following processing methods: region filtering, shape adjustment, and contour processing, and the candidate region of interest is generated based on the processing results.

9. The monitoring area configuration method according to claim 1, characterized in that, The acquisition of the target image captured by the security equipment includes: When a user triggers a region recognition operation on the video preview page of the security device, the target image is obtained from the video stream of the security device.

10. The monitoring area configuration method according to claim 1, characterized in that, The region information includes region outline data and region category; The step of sending the area information of the target region of interest as monitoring area configuration information to the security device includes: The region outline of the target region of interest is converted into a polygon with a preset number of vertices, and the position data of each vertex in the polygon and the region category corresponding to the target region of interest are sent to the security device.

11. The monitoring area configuration method according to claim 1, characterized in that, The region information includes region outline data and region category; The step of sending the area information of the target region of interest as monitoring area configuration information to the security device includes: A semantic mask is generated based on the target region of interest and its corresponding region category. The semantic mask is then divided into blocks and compressed to obtain a compressed block image, which is then sent to the security device.

12. A security system, characterized in that, It includes security equipment and terminal equipment, wherein the security equipment and the terminal equipment establish a communication connection; The security equipment is used to capture and send target images to the terminal device, and to receive monitoring area configuration information sent by the terminal device; The terminal device is used to execute the monitoring area configuration method as described in any one of claims 1 to 11.