Motion detection method and device, computer equipment, product and storage medium
The target image is acquired through the infrared signal trigger shooting device, and the high brightness and moving pixel areas are determined. Combined with the intersection threshold and multimodal analysis, the false triggering problem in infrared image motion detection is solved, and the motion object detection with high accuracy and low false alarm rate is achieved.
Patent Information
- Application Number
- CN202510524137.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-08-12
AI Technical Summary
The existing infrared image motion detection has a high false trigger rate, making it difficult to accurately identify moving targets, especially in complex backgrounds and lighting changes.
The infrared signal triggered shooting device to collect the target image, determine the high-brightness area and moving pixel area in the target image, combine the intersection threshold and multi-modal image analysis, filter the interfering light source, and optimize the motion target detection.
High-precision motion object detection is realized, the false alarm rate is reduced, and the detection accuracy and efficiency in complex environments are improved.
Smart Images

Figure CN120472529A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a motion detection method, apparatus, computer equipment, product, and storage medium (computer-readable storage medium). Background Art
[0002] Infrared image analysis is widely used for motion detection, but motion detection through infrared signals is inaccurate. For example, infrared imaging images are grayscale images, and the edges between the target and the background in the infrared image are relatively blurred. The background in which the moving target is located is extremely complex, and the moving target is contaminated by a large amount of clutter and noise, making the processing of infrared targets more difficult and reducing the recognition accuracy. Summary of the Invention
[0003] In response to the above technical problems, embodiments of the present application provide a motion detection method, apparatus, computer equipment, product, and storage medium.
[0004] In a first aspect, an embodiment of the present application provides a motion detection method, the method comprising:
[0005] In response to a trigger operation based on an infrared signal, the camera is controlled to capture a target image;
[0006] Determining a first image region and a second image region in the target image; wherein the first image region is a region in the target image having a brightness value greater than a brightness threshold; and the second image region is a region in the target image corresponding to motion pixels, wherein the motion pixels represent pixel differences between at least two frames of the target image;
[0007] A moving target prompt is triggered according to the first image area and the second image area, wherein the first image area includes at least one, and the second image area matches the target set in the target image.
[0008] In one embodiment of the present application, the method further includes:
[0009] Perform contour detection on the highlighted pixels in the target image to filter out interfering light sources, and determine the first image area; wherein the highlighted pixels include at least two pixels in the target image whose brightness values are greater than the brightness threshold.
[0010] In one embodiment of the present application, the method further includes:
[0011] Obtaining a target image and a reference image of the target image by differential processing to obtain moving pixel points; wherein the reference image is a historical image acquired before the target image;
[0012] Clustering the moving pixels to obtain the second image region.
[0013] In one embodiment of the present application, before obtaining the moving pixel points by processing the target image and the reference image of the target image using a difference method, the method further includes:
[0014] Performing background recognition on the reference image using a preset recognition model to obtain a background model in the reference image;
[0015] The target image and the background model are processed according to the difference method to obtain the moving pixel points.
[0016] In one embodiment of the present application, triggering a moving target prompt based on the first image area and the second image area includes:
[0017] calculating an intersection-and-union ratio of the first image region and the second image region to obtain a target intersection-and-union ratio;
[0018] When the target intersection-in-union ratio is less than the intersection-in-union ratio threshold, it is determined that there is a moving target and an output prompt is output; wherein the intersection-in-union ratio threshold is set according to the ambient light intensity corresponding to the target image, and the intersection-in-union ratio threshold has the same changing trend as the ambient light intensity.
[0019] In one embodiment of the present application, the method further includes:
[0020] When the target IoU is greater than or equal to the IoU threshold, determining that the moving target does not exist, and counting the number of target images that do not contain the moving target;
[0021] When the number of the target images exceeds a preset number, it is determined that no moving target exists and the trigger operation is ignored.
[0022] In one embodiment of the present application, the method further includes:
[0023] In the case where the infrared signal changes, determining a spatial position corresponding to the changed infrared signal;
[0024] According to the spatial position and the preset mapping relationship, the shooting device is determined and the shooting device is controlled to capture the target image; wherein the preset mapping relationship is a pre-calibrated spatial position conversion relationship between the shooting device and the infrared sensing device that collects the infrared signal.
[0025] In one embodiment of the present application, the method is applied to a terminal device connected to at least two types of sensors, and the method further includes:
[0026] Acquire a detection signal collected by a sensor, and determine a target condition corresponding to the detection information based on a signal type of the detection signal;
[0027] In a case where the detection signal meets the target condition, the shooting device is controlled to capture a target image, and the steps of determining the first image area and the second image area in the target image are performed.
[0028] In one embodiment of the present application, the detection signal includes: an infrared signal and a positioning signal; the target condition corresponding to the infrared signal is a change in signal strength, and the target condition corresponding to the positioning signal is a change in signal position;
[0029] When the detection signal meets the target condition, controlling the shooting device to capture the target image includes:
[0030] When the signal strength of the infrared signal changes, controlling the shooting device to capture a target image; or
[0031] When the signal position of the positioning signal changes, the shooting device is controlled to capture the target image.
[0032] In one embodiment of the present application, the method further includes:
[0033] If the motion detection result indicates that a moving target exists, determining associated information of the moving target; the associated information includes a moving speed of the moving target detected by a speed sensor, or a surface temperature of the moving target detected by a thermal imaging sensor;
[0034] When the movement speed meets the speed range and the surface temperature meets the temperature range, an early warning prompt is triggered.
[0035] In a second aspect, an embodiment of the present application provides a motion detection device, the device comprising:
[0036] An acquisition module is used to respond to a trigger operation based on an infrared signal and control a camera to acquire a target image;
[0037] a determination module, configured to determine a first image region and a second image region in the target image; wherein the first image region is a region in the target image having a brightness value greater than a brightness threshold; and the second image region is a region in the target image corresponding to motion pixels; the motion pixels represent pixel differences between at least two frames of the target image;
[0038] An output module is used to trigger a moving target prompt based on the first image area and the second image area, wherein the first image area includes at least one, and the second image area matches the target set in the target image.
[0039] In a third aspect, an embodiment of the present application further provides a computer device, comprising a memory storing a plurality of instructions; a processor loading instructions from the memory to execute the steps of any motion detection method provided in the embodiment of the present application.
[0040] In a fourth aspect, an embodiment of the present application further provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the steps of any motion detection method provided in the embodiment of the present application.
[0041] In a fifth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores a plurality of instructions suitable for loading by a processor to execute the steps of any motion detection method provided in an embodiment of the present application.
[0042] The solution of the embodiment of the present application responds to the trigger operation based on the infrared signal, controls the shooting device to collect the target image, the infrared signal is only sensitive to a specific wavelength, filters out some heat source interference, reduces the power consumption of the shooting device while improving the triggering efficiency, and then determines the first image area and the second image area in the target image; wherein, the first image area is the area in the target image whose brightness value is greater than the brightness threshold; the second image area is the area corresponding to the motion pixel in the target image; the motion pixel represents the pixel difference between at least two frames of the target image; based on the first image area and the second image area, the moving target prompt is triggered; the first image area includes at least one, and the second image area matches the target set in the target image; the false alarm rate is reduced by spatial overlap verification of the two areas. The technical solution of the present application can achieve high-precision moving target detection and low false alarm rate prompts through collaborative optimization of infrared triggering and multimodal image analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0044] Figure 1 Schematic diagram of the application environment of the motion detection method provided in the embodiment of the present application;
[0045] Figure 2This is a flow chart of an embodiment of a motion detection method provided in an embodiment of the present application;
[0046] Figure 3 1 is a flow chart of another embodiment of the motion detection method provided in the embodiments of the present application;
[0047] Figure 4 This is a flow chart of another embodiment of the motion detection method provided in the embodiments of the present application;
[0048] Figure 5 This is a flow chart of a specific embodiment of the motion detection method provided in the embodiments of the present application;
[0049] Figure 6 is a structural diagram of a motion detection device provided in an embodiment of the present application;
[0050] Figure 7 is another structural diagram of the motion detection device provided in an embodiment of the present application;
[0051] Figure 8 It is a schematic diagram of the internal structure of the computer device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0052] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of this application. At the same time, in the description of the embodiments of the present application, the terms "first", "second", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0053] In the related art, motion target detection mainly uses infrared detection, that is, currently motion detection is mainly performed through passive infrared. However, the existing passive infrared detection method may have false triggering, so false triggering needs to be suppressed. Currently, false triggering is mainly suppressed through the following methods:
[0054] Method 1: Hardware optimization: using Fresnel lens for regional detection and dual-sensor differential signal processing;
[0055] Method 2: Signal filtering: Suppress low-frequency environmental noise and high-frequency electromagnetic interference through high-pass and low-pass filters;
[0056] Mode 3: Logical judgment: Verify the trigger validity based on pulse count and time window.
[0057] Current passive infrared motion detection systems still face the following challenges in suppressing false triggers: 1. Sunlight interference is difficult to eliminate: Dynamic infrared radiation from sunlight (such as cloud movement and mirror reflections) overlaps with the frequency band of human motion signals, leading to a high false trigger rate; 2. Single sensor limitations: Relying solely on passive infrared signals cannot distinguish between solar interference and actual moving targets; 3. Poor environmental adaptability: Traditional filtering and threshold adjustment methods fail in strong light conditions.
[0058] Based on the above problems, a motion detection method in the technical solution of the present application is proposed. In one embodiment of the present application, the motion detection method can be run on a computer device, which can be a local terminal device or a server.
[0059] In order to better understand the motion detection method, apparatus, computer device, and storage medium provided in the embodiments of the present application, the application environment applicable to the embodiments of the present application is described below.
[0060] See also Figure 1 , Figure 1 FIG1 shows a schematic diagram of an application environment of the motion detection method provided by an embodiment of the present application. As an implementation method, the motion detection method provided by the embodiment of the present application is applied to a computer device. The computer device may be Figure 1 The server 110 shown in FIG. 1 can be connected to the terminal device 120 via a network. The network is used to provide a medium for a communication link between the server 110 and the terminal device 120. The network can include various connection types, such as wired communication links, wireless communication links, etc., which are not limited in the embodiments of the present application. Alternatively, in other embodiments, the computer device can also be a smartphone, a laptop computer, etc.
[0061] It should be understood that Figure 1 The server 110, network, and terminal device 120 are merely illustrative. Any number of servers, networks, and terminal devices may be provided as needed. For example, the server 110 may be a physical server or a server cluster consisting of multiple servers, and the terminal device 120 may be a mobile phone, tablet, desktop computer, laptop computer, or the like. It will be appreciated that embodiments of the present application may allow multiple terminal devices 120 to access the server 110 simultaneously.
[0062] The following is a detailed description of each step in conjunction with the accompanying drawings. This embodiment uses a computer device as an example. It should be noted that the order in which the following embodiments are described does not limit the preferred order of the embodiments. Although the flowcharts illustrate a logical order, in some cases, the steps shown or described may be performed in a different order than that shown in the accompanying drawings.
[0063] Specifically, the technical solutions of the embodiments of this application are described in Figure 2 , Figure 2 FIG. 2 is a flow chart of an embodiment of a motion detection method provided in an embodiment of the present application. The specific flow of the motion detection method in an embodiment of the present application may be as follows: Steps 201 to 203, wherein:
[0064] Step 201 : In response to a trigger operation based on an infrared signal, control a shooting device to capture a target image.
[0065] The motion detection method in the embodiment of the present application is applied to a computer device, which is communicatively connected to an infrared sensor and a shooting device, wherein the infrared sensor and the shooting device can be built-in in the computer device; or the infrared sensor and the shooting device can also be set in an external device, and the computer device is connected to the external device through a network; the infrared sensor is a photographic device that uses infrared light technology to achieve special imaging. The infrared sensor in the embodiment of the present application is a PIR (also called a passive infrared sensor), which is a passive infrared thermal imaging. That is, the infrared sensor works based on the pyroelectric effect. When the infrared radiation (wavelength 8-14μm) emitted by the human body or animal (temperature above absolute zero) is received by the sensor, the crystal produces a charge difference due to temperature changes, and then generates an electrical signal. For example, the human body has a constant temperature of about 37°C, and its infrared wavelength is concentrated around 10μm. The PIR uses a filter to shield other interfering light sources (such as sunlight and lamplight).
[0066] The computer device obtains the infrared signal detected by the infrared sensor, and analyzes the infrared signal to determine whether the infrared signal has changed. If the infrared signal changes, it means that there may be a moving target in the external environment causing the temperature change. Of course, the temperature change may be caused by the change of sunlight, or the light source in the external environment may also cause the temperature change. In order to avoid false triggering caused by non-moving targets, this technical solution is proposed.
[0067] In the embodiment of the present application, the computer device detects a change in the infrared signal. In order to prevent infrared detection errors, in the embodiment of the present application, when a change in the infrared signal is detected, the prompt information is not directly triggered, but the shooting device is awakened to capture the target image through the shooting device. In the embodiment of the present application, the shooting device is a visible light shooting device. The number and format of the target images are not limited. The target image can be one frame or multiple frames. The target image and the infrared signal have spatial correspondence.
[0068] This application's technical solution utilizes an infrared trigger mechanism, employing an infrared sensor (e.g., PIR) trigger mode. When human heat source motion is detected, a trigger signal is sent via a computer to a camera, initiating the image acquisition process. The infrared sensor continuously monitors the environment, and the camera only wakes up when the trigger signal is valid, reducing energy consumption. Furthermore, by synchronizing the timing of the infrared sensor and camera, target loss due to delays is avoided.
[0069] It is understandable that in the embodiment of the present application, the infrared sensor and the camera are pre-calibrated, that is, in the embodiment of the present application, the infrared detection area of the infrared sensor and the field of view of the camera are mapped, for example: a checkerboard calibration plate (or other markers of known geometric structure) is arranged in the common coverage area of the PIR and the camera. The calibration plate needs to be detected by the PIR at the same time as the heat source distribution and be clearly visible in the camera image. On the camera side: the image coordinates of the checkerboard corner points are extracted using the image recognition model; on the infrared sensor PIR side: the coordinates of the boundary points of its detection area are determined by the infrared radiation distribution of the calibration plate, and the corresponding points between the camera image coordinates and the PIR physical coordinates are used to calculate the homography matrix. According to the homography matrix, the PIR detection area is mapped to the camera image plane; the target position detected by the PIR (such as the center of the heat source) is projected into the camera image coordinate system to generate the target's region of interest (ROI) in the image, thereby realizing data mapping and spatial alignment. For example, if the PIR detects a moving heat source in a certain area, it can be mapped to a specific pixel range in the camera image.
[0070] In the embodiment of the present application, the camera is triggered according to the infrared signal, the PIR provides the coarse-grained position and thermal signal of the moving target, and the camera performs high-resolution visual analysis (such as target shape and color recognition) through the ROI; for example: when the PIR detects a heat source, the camera is triggered to capture a real-time image of the mapped area, and the data of the two are combined to verify whether the target is a human or an animal. A probabilistic model (such as a Bayesian network) or a deep learning network is used to combine the confidence of the PIR with the classification result of the camera to comprehensively judge the moving target. In this way, the PIR acts as a trigger sensor and only wakes up the camera when activity is detected, reducing energy consumption. At the same time, by fusing the thermal signal of the PIR with the optical characteristics of the camera, the real target is distinguished from the environmental noise, avoiding false alarms caused by changes in lighting.
[0071] It is understandable that the embodiments of the present application can also be combined with multi-sensor collaborative calibration: for example, the technical solution of the present application can also include multiple shooting devices or radars, which can be expanded to multimodal fusion in a global coordinate system, such as combining PIR data with lidar point cloud to improve three-dimensional spatial positioning accuracy.
[0072] In an embodiment of the present application, a computer device processes a target image to determine a first image area and a second image area in the target image, wherein the first image area represents a highlight area in the target image, that is, in an embodiment of the present application, the first image area is a highlight area in the target image whose brightness value is greater than a brightness threshold; the second image area is an area in the target image where a moving target may exist, that is, the second image area is a moving area corresponding to a moving pixel in the target image.
[0073] Step 202, determining a first image area and a second image area in the target image; wherein the first image area is an area in the target image where the brightness value is greater than a brightness threshold; and the second image area is an area in the target image corresponding to motion pixels.
[0074] In the embodiment of the present application, the computer device processes the target image and determines the first image area (also called the highlight area) in the target image in a manner not limited thereto. Specifically:
[0075] Implementation method 1: The computer device obtains the brightness value of each pixel in the target image, and compares the brightness value of the pixel with a brightness threshold, where the brightness threshold is set according to the situation. For example, the target image is an HSV space image. In the HSV color space, HSV represents hue (Hue), saturation (Saturation) and value (Value), for example, the brightness threshold is HSV space V channel > 240, and the computer device forms the target pixel points in the target image whose brightness values exceed the brightness threshold into a first image area.
[0076] Implementation method 2: The computer device obtains the brightness value of each pixel in the target image, sorts the pixels from large to small, and forms the first image area with the top 10% of the target pixels in brightness.
[0077] In the embodiments of the present application, the method for determining the first image region is not limited. The extraction of the first image region (highlight region) primarily considers the following: 1. Global thresholding: An algorithm is used to calculate the global brightness threshold of the image and initially segment the highlight region. 2. Local compensation: For areas with uneven illumination, the local brightness mean is calculated block by block, and a dynamic threshold matrix is generated through bicubic interpolation to compensate for global segmentation errors.
[0078] Furthermore, in the embodiment of the present application, after the first image region is determined, morphological processing may be performed on the first image region: corrosion and dilation operations may be performed on the segmented binary image to eliminate noise interference and merge adjacent highlight regions.
[0079] In the embodiment of the present application, the computer device processes the target image and determines the second image area (also called the motion area) in the target image in a manner not limited thereto. Specifically:
[0080] Implementation method 1: By establishing a background model, the target image is used as the current frame and the background model is differentiated. The area exceeding the threshold is determined as the second image area corresponding to the moving target. The background model is dynamically updated to cope with lighting changes or scene disturbances. For example, a mixed Gaussian model uses multi-Gaussian distribution to describe pixel changes and adapt to dynamic backgrounds.
[0081] Implementation method 2: Perform pixel differentiation on two or three consecutive image frames and extract the motion region through threshold segmentation. The differentiation in the present embodiment includes a two-frame method and a three-frame method. The two-frame method is suitable for the second image region corresponding to slowly moving targets, while the three-frame method can reduce the target splitting problem: the second image region corresponding to fast-moving targets in real-time video surveillance.
[0082] Implementation method three: Detect the second image region corresponding to the moving target using the velocity vector field of the pixel points. Dense optical flow calculates global motion, while sparse optical flow tracks feature points (such as corners), making it suitable for dynamic backgrounds. Sparse optical flow reduces computational effort and is suitable for real-time scenarios such as drone tracking.
[0083] The method for detecting the second image region (moving region) in the embodiments of the present application is not limited. For example, 1. Using a mixed Gaussian model to establish a background model, extracting moving pixels by differentiating the current frame from the background; 2. Optical flow analysis: Calculating a dense optical flow field for consecutive frames, combining motion vector clustering to locate the contour of the moving target; 3. Spatiotemporal filtering: Using Kalman filtering or particle filtering to predict the target's motion trajectory, reduce false detections caused by transient noise, and ensure accurate recognition of the moving region.
[0084] In the embodiment of the present application, after the computer device determines the first image area and the second image area, the computer device processes the first image area and the second image area to determine the moving target and then provides a prompt. Specifically:
[0085] Step 203: triggering a moving target prompt according to the first image area and the second image area.
[0086] The computer device calculates the target intersection-over-union (IOU) between the first image area and the second image area. In the embodiment of the present application, the degree of overlap between the moving target and the target detection frame is determined by calculating the target intersection-over-union (IOU) between the first image area and the second image area, thereby determining whether the detection frames belong to the same moving target.
[0087] That is, in the embodiment of the present application, the areas of the two frames of the highlight area and the motion area are calculated respectively, the intersection area is determined by the intersection coordinates, the union area is the sum of the areas of the two frames minus the intersection area, and the IOU value is obtained by the ratio of the intersection and the union area, which ranges from [0, 1]. The larger the value, the higher the overlap. In the embodiment of the present application, the intersection-union ratio formula is: IOU = (first image area ∩ second image area) / (first image area ∪ second image area), and the target intersection-union ratio between the first image area and the second image area is calculated.
[0088] The computer device compares the target intersection-and-union ratio (IoU) between the first image area and the second image area with the IoU threshold; if the target IoU is greater than or equal to the IoU threshold, it is determined that there is a moving target and a prompt message is output; if the target IoU is less than or equal to the IoU threshold, it is determined that there is no moving target and the triggering of the infrared information is ignored.
[0089] In the embodiment of the present application, the first image area and the second image area are analyzed to screen out areas that meet both the highlight and motion conditions to reduce the false alarm rate; at the same time, contour matching is performed through the intersection-over-union ratio: the spatial overlap of the two areas is evaluated through convex hull detection or minimum circumscribed rectangle calculation, and a threshold is set to determine whether they are the same moving target.
[0090] At the same time, the infrared information and target image are aligned, and combined with the heat source intensity data output by the infrared sensor to verify whether the highlighted area is consistent with the heat source position, so as to efficiently identify moving targets and reduce environmental interference.
[0091] The solution of the embodiment of the present application responds to a trigger operation based on an infrared signal, controls the shooting device to capture the target image, and the infrared signal is only sensitive to a specific wavelength, filters out some heat source interference, reduces the power consumption of the shooting device while improving the triggering efficiency, and then determines the first image area and the second image area in the target image; wherein, the first image area is the area in the target image whose brightness value is greater than the brightness threshold; the second image area is the area corresponding to the moving pixels in the target image; based on the first image area and the second image area, a moving target prompt is triggered; the false alarm rate is reduced by spatial overlap verification of the two areas. The technical solution of the present application can achieve high-precision moving target detection and low false alarm rate prompts through collaborative optimization of infrared triggering and multimodal image analysis.
[0092] Furthermore, in an embodiment of the present application, triggering a moving target prompt according to the first image area and the second image area includes:
[0093] calculating an intersection-and-union ratio of the first image region and the second image region to obtain a target intersection-and-union ratio;
[0094] When the target intersection-in-union ratio is less than the intersection-in-union ratio threshold, it is determined that there is a moving target and an output prompt is output; wherein the intersection-in-union ratio threshold is set according to the ambient light intensity corresponding to the target image, and the intersection-in-union ratio threshold has the same changing trend as the ambient light intensity.
[0095] In the embodiment of the present application, the computer device calculates the intersection and union ratio of the first image area and the second image area to obtain the target intersection and union ratio. When the target intersection and union ratio is greater than or equal to the intersection and union ratio threshold, the computer device determines that there is no moving target and ignores the infrared signal; or when the target intersection and union ratio is less than the intersection and union ratio threshold, it determines that there is a moving target and outputs a prompt; the intersection and union ratio threshold is set according to the ambient light intensity corresponding to the target image. In the embodiment of the present application, the ambient light intensity is the ambient light intensity collected by the light intensity sensor at the moment of target image acquisition. For example, the camera that collects the target image is communicatively connected to the light intensity sensor, and the camera and the light intensity sensor have the same acquisition frequency and the same acquisition time. In the embodiment of the present application, the target image collected at the same time is associated with the ambient light intensity; the intersection and union ratio threshold has the same change trend as the ambient light intensity. That is, the intersection and union ratio threshold can be set according to flexible scenarios. For example, as the ambient light intensity increases, the intersection and union ratio threshold increases; and as the ambient light intensity decreases, the intersection and union ratio threshold also decreases.
[0096] In the embodiment of the present application, the intersection-over-union (IOU) threshold in the computer device is set according to the specific situation. That is, the illumination intensity of the application scene in the embodiment of the present application is variable, and the detection situation in different scenes is different. For example, in low-light scenes, insufficient illumination leads to increased image noise, blurred target edges, and low detection frame overlap (IOU). If a fixed high IOU threshold (such as 0.5) is used, it is easy to cause missed detection. The IOU adjustment strategy is: reversely adjust the IOU threshold according to the light intensity. For example, when the brightness is lower than the threshold, interpolation is used to gradually reduce the IOU threshold (such as from 0.5 to 0.3), and the matching conditions are relaxed to retain more potential targets; in high-light scenes, strong light leads to overexposure or decreased contrast in shadow areas, and target detection is prone to overlapping misjudgments, and the IOU threshold needs to be increased to reduce false detections. The IOU adjustment strategy is: when the brightness exceeds the threshold, the IOU threshold increases positively with the light intensity (such as from 0.5 to 0.7), and high-quality matching frames are strictly screened; the technical solution of the present application adjusts the overlap rate according to different light intensities. The technical solution of the present application has strong environmental adaptability: it supports high-light scenes such as deserts and seashores.
[0097] Furthermore, in the embodiment of the present application, the IOU threshold can be automatically adjusted, and the IOU threshold can be adjusted according to the light intensity. For example, when the light intensity is >100,000 lux, the IOU threshold is set to 0.3; on cloudy days, it is set to 0.1.
[0098] In the embodiment of the present application, the IOU is adjusted in real time according to the ambient light intensity, so that the target detection is more accurate. That is, by sensing the changes in ambient light in real time, the IOU matching standard in target detection is adaptively optimized to solve the image noise interference caused by insufficient light or the target edge blur caused by excessive light, thereby improving the detection accuracy and robustness.
[0099] In one embodiment of the present application, after determining the first image area and the second image area in the target image, the technical solution of the present application further includes:
[0100] 1. When the target IoU is greater than or equal to the IoU threshold, determining that the moving target does not exist, and counting the number of target images that do not contain the moving target;
[0101] 2. When the number of the target images exceeds a preset number, it is determined that there is no moving target and the trigger operation is ignored.
[0102] In the embodiment of the present application, based on the first image area and the second image area, it specifically includes: when the target intersection-and-union ratio is greater than or equal to the intersection-and-union ratio threshold, if it is directly determined that there is no moving target, a misjudgment may occur. For example, since the moving target moves slowly, it may overlap with the light source, thus resulting in a misjudgment. In order to prevent misjudgment, the technical solution of the present application further determines the number of overlaps, that is, the computer device counts the number of images whose target intersection-and-union ratio is greater than or equal to the intersection-and-union ratio threshold. If the number of images exceeds a preset number, it is determined that there is no moving target and the trigger operation is ignored. The preset number can be set according to the specific scenario. For example, the preset number is set to 3 frames.
[0103] Furthermore, in the embodiment of the present application, the acquisition time interval of the target image can also be combined to avoid the influence of the acquisition time interval, that is, the target image is a target image of multiple consecutive frames. For example, if the IOU of three consecutive frames exceeds the threshold, it is judged as solar interference and the trigger is discarded.
[0104] In the embodiment of the present application, after the target intersection-and-union ratio is greater than or equal to the intersection-and-union ratio threshold, in order to prevent accidental touches, the number of target images and information such as whether the target images are continuous can also be counted to determine whether there is no moving target and ignore the trigger operation. The triggering accuracy in the embodiment of the present application is higher.
[0105] In the embodiment of the present application, after determining that the target image contains a light source, the computer device may use the light source area as a shielding area and then exclude the shielding area for analysis. Specifically:
[0106] 1. When there are at least two first image areas, set at least one first image area in the target image as a shielding area;
[0107] 2. Trigger a moving target prompt based on the first image area and the second image area in the new target image except the shielded area.
[0108] In the embodiment of the present application, since there are multiple light sources in an image, in order to avoid misjudgment caused by different light sources, in the embodiment of the present application, when there are multiple first image areas, at least one of the first image areas is set as a shielding area that needs to be shielded. For example, the target image contains a street lamp, and the street lamp will affect the accuracy of the judgment. In the embodiment of the present application, the first area corresponding to the street lamp area is set as the shielding area, and then a new target image excluding the street lamp area is obtained.
[0109] In the embodiment of the present application, according to the first image area and the second image area in the new target image except the shielded area, the moving target prompt is triggered. Specifically, the shielded area setting and image preprocessing shielded area generation: Mask creation: Use annotation tools (such as Labelme) or code to generate masks (such as mask.png of YOLOv5), mark the first image area (high brightness area) as the shielded area (pixel value is set to 0), and other areas are set to 255. Support dynamic adjustment of the shielding range, such as through scale parameters or coordinate mapping; then preprocessing optimization: apply median filtering or Gaussian filtering to the shielded image to reduce salt and pepper noise interference and avoid misjudgment of residual highlight areas; in response to changes in ambient light, use the V channel of the HSV color space to dynamically adjust the brightness threshold to ensure the robustness of highlight area segmentation.
[0110] The computer equipment extracts and fuses the features of the remaining area to detect the new first image area (high brightness area). For example, dynamic threshold segmentation: the Otsu algorithm is used to adaptively calculate the brightness threshold of the remaining area and extract new highlight areas (such as reflective objects or heat sources); morphological optimization: the segmented binary image is expanded to connect broken areas and eliminate isolated noise points through corrosion. The first image area is the area affected by the sun, and the second image area is the area where the picture change is detected. The intersection-over-union ratio is the ratio of the intersecting area to the combined area. The larger the value, the more overlapped the two areas are. It also means that the possibility of false triggering caused by the sun is greater in the moving area, thereby performing anti-false triggering filtering.
[0111] The computer equipment extracts and fuses the features of the remaining area to detect the new second image area (motion area): for example, the background difference method: subtracts the current frame from the updated background model (such as the mixed Gaussian model GMM) to obtain the moving pixels; the optical flow method is assisted: the dense optical flow field (Farneback algorithm) is calculated, and the target contour is located in combination with motion vector clustering to reduce static interference.
[0112] Finally, according to the overlap ratio between the new first image region and the new second image region, a moving target prompt is triggered, and moving target detection can be further performed while eliminating errors.
[0113] In one embodiment of the present application, before determining the first image area and the second image area in the target image, the method further includes:
[0114] Contour detection is performed on highlight pixels in the target image to filter out interfering light sources, and the first image area is determined; the highlight pixels include at least two pixels in the target image whose brightness values are greater than the brightness threshold.
[0115] In the embodiment of the present application, the highlighted pixels are first determined, and then the highlighted pixels are analyzed to determine whether there is a light source, that is, connected domain analysis and area filtering, all connected areas are marked by a computer, and then the connected areas are screened by area threshold: small interference light sources are filtered according to a preset area threshold (such as 300 pixels). In the embodiment of the present application, considering that the shape of the light source is usually circular, the minimum circumscribed circle is fitted: the minimum circumscribed circle (center and radius) is calculated for each connected domain contour, and the variance of the distance from the contour point to the center of the circle is calculated. If the variance is less than the threshold, it is determined to be a circle, or, the Hough circle transform is used on the binary image, and the light source size is determined by adjusting the edge detection threshold. If there are multiple circular light sources in the image, the Hough transform can be called multiple times and the circle with the highest number of votes can be selected first, or the best matching circle can be selected in combination with the contour analysis results, and then the determined highlighted area is deleted.
[0116] It is understandable that in the embodiments of the present application, the detection of highlight areas of circular light sources requires the integration of multiple technical means such as threshold segmentation, morphological processing, contour shape analysis, and Hough transform. The key is to achieve anti-interference through circularity evaluation and dynamic parameter optimization, while combining the grayscale weighted centroid method to improve positioning accuracy. In scenes with complex lighting or background interference, the introduction of ROI and multi-feature verification (such as motion consistency) can significantly enhance robustness.
[0117] In the embodiment of the present application, the spatial overlap of highlight areas and motion detection (such as background difference or optical flow method) is combined to eliminate static reflective interference (such as lamps), which can make the detection of moving targets more accurate.
[0118] Reference Figure 3 , Figure 3 : is a flow chart of another embodiment of the motion detection method provided in the embodiment of the present application. In one embodiment of the present application, before determining the first image area and the second image area in the target image, the method further includes:
[0119] Step 301 : Obtain motion pixels by processing the target image and a reference image of the target image using a difference method; wherein the reference image is a historical image captured before the target image.
[0120] In this embodiment, the reference image is a historical image captured before the target image (current frame) is selected as the base frame. Typically, the previous frame (two-frame difference method) or the previous two frames (three-frame difference method) are used as the reference frame. The target image is the current video frame to be analyzed, containing the potential moving target.
[0121] Image preprocessing is performed on the target image and the reference image, including: 1. Grayscale conversion: converting the reference image and the target image into grayscale images to reduce computational complexity; 2. Denoising: applying median filtering or Gaussian filtering to eliminate image noise and avoid interference with the differential result.
[0122] Perform difference processing on the preprocessed target image and the reference image, specifically:
[0123] 1. Perform background recognition on the reference image using a preset recognition model to obtain a background model in the reference image;
[0124] 2. Process the target image and the background model according to the difference method to obtain the moving pixel points.
[0125] That is, the difference method in the embodiment of the present application includes: 1. The inter-frame difference method performs absolute value difference on two consecutive frames (or three frames) of images pixel by pixel; 2. The three-frame difference method: performs a logical "and" operation through two difference operations (current frame and previous frame, current frame and next frame) to reduce the "ghosting" problem of moving targets; 3. The background difference method: establishes a background model (such as a Gaussian mixture model or a sliding average method), subtracts the current frame from the background model, and then binarizes the difference result to distinguish the moving area from the background, and finally obtains the moving pixel point.
[0126] Step 302: cluster the moving pixels to obtain the second image region.
[0127] In the embodiment of the present application, post-processing of moving pixels includes: 1. Morphological operations include: Dilation: connecting broken areas and filling internal holes; 2. Erode: eliminating isolated noise points, for example, using a 3×3 or 5×5 rectangular kernel structure; 3. Marking connected areas, eliminating noise with too small an area (such as <50 pixels), and calculating the minimum bounding box to locate the second image area.
[0128] In the embodiments of this application, image differencing is used to achieve a balance between difference extraction and noise suppression. Inter-frame differencing is suitable for fast motion detection, while background differencing is suitable for static scenes. Combining the two can achieve a balance between speed and accuracy. In practical applications, preprocessing, thresholding strategies, and post-processing methods must be selected based on the specific scene, and dynamic model updates must be used to adapt to environmental changes.
[0129] Reference Figure 4 , Figure 4 This is a flow chart of another embodiment of the motion detection method provided in the embodiment of the present application. In one embodiment of the present application, after triggering the moving target prompt according to the first image area and the second image area, the method further includes:
[0130] Step 401, when the motion detection result indicates that there is a moving target, determine the associated information of the moving target; the associated information includes the moving speed of the moving target detected by a speed sensor, or the surface temperature of the moving target detected by a thermal imaging sensor.
[0131] The technical solution of the present application detects moving targets through multi-dimensional data. Specifically, a clock signal is used to ensure that the camera, speed sensor, and thermal imaging sensor collect data synchronously. The speed sensor in the embodiment of the present application can be a millimeter-wave radar. 2. Coordinate system conversion: Establish a mapping relationship between the pixel coordinate system of the camera, the radar polar coordinate system, and the thermal imaging sensor coordinate system, and calculate the external parameter matrix through a calibration plate (such as a chessboard): Use the trajectory of the moving target (such as a uniformly moving object) to optimize the calibration parameters in real time.
[0132] If the motion detection result indicates that a moving target exists, the computer device determines associated information of the moving target; the associated information includes the moving speed of the moving target detected by a speed sensor, or the surface temperature of the moving target detected by a thermal imaging sensor. The computer device then combines and analyzes the various parameters, specifically:
[0133] Step 402 : triggering an early warning prompt when the movement speed meets the speed range and the surface temperature meets the temperature range.
[0134] In the embodiment of the present application, the computer device is provided with a speed range of the moving target to be detected and a temperature range of the moving target, wherein the speed range is determined based on the movement information of the moving target, for example, the speed range of a person is less than 60 km / h; the temperature range is determined based on the movement information of the moving target, for example, the temperature range of a person is less than 36°C; the computer device compares the movement speed with the speed range, and compares the surface temperature with the temperature range, and triggers an early warning prompt when the movement speed meets the speed range and the surface temperature meets the temperature range.
[0135] This application's technical solution incorporates a speed sensor to detect target speed, combines Doppler characteristics to distinguish between solar interference and human motion, and uses a thermal imaging sensor to verify target temperature (36°C for human body and ambient objects). This multi-sensor combination makes early warnings more accurate.
[0136] Specifically, in response to a trigger operation based on an infrared signal, controlling a camera to capture a target image includes:
[0137] 1. When the infrared signal changes, determining the spatial position corresponding to the changed infrared signal;
[0138] 2. Determine a shooting device based on the spatial position and a preset mapping relationship, and control the shooting device to capture the target image; wherein the preset mapping relationship is a pre-calibrated spatial position conversion relationship between the shooting device and the infrared sensing device that collects the infrared signal.
[0139] In the embodiments of the present application, an infrared sensor (such as a PIR or active infrared transmitter) collects thermal radiation or active infrared reflection signals in the environment in real time to detect the movement or temperature change of a human body or object. If multiple infrared sensors are deployed, the three-dimensional coordinates of the target are calculated based on the signal arrival time difference (TDoA) or arrival angle (AoA). For example, using the arrival angle method of an active infrared beacon, the error can be controlled within ±0.5 meters; if a single infrared sensor is deployed: the rough position of the target is estimated (applicable to small-scale scenarios) through the mapping model of the thermal radiation intensity gradient distribution or the reflected signal intensity (RSSI) and distance.
[0140] According to the spatial position and the preset mapping relationship, the shooting device is determined. The preset mapping relationship can be understood as using a checkerboard calibration plate or a known geometric feature to synchronously capture images of the infrared sensor and the shooting device, and calculating the homography matrix (Homography) or external parameter matrix (rotation matrix R, translation vector T) between the two through OpenCV's findHomography or calibrateCamera. Then, in response to the wake-up command sent to the shooting device, the shooting device is awakened to capture the target image, thereby realizing image capture of the area corresponding to the infrared signal and reducing the amount of image processing.
[0141] Reference Figure 5 , Figure 5 This is a flow chart of a specific embodiment of the motion detection method provided in the embodiment of the present application; the technical solution in the embodiment of the present application includes the following steps:
[0142] Step 1: PIR trigger and camera activation. After the PIR detects a change in the infrared signal, it sends a trigger signal to the determination module. The determination module wakes up the camera and starts image acquisition (delay < 100ms). If the camera fails to start successfully, the hardware is triggered to reset and re-align the acquisition.
[0143] Step 2: Identify the sun's position in the first image region. For highlight region extraction, locate candidate regions using image brightness thresholds (HSV space V channel > 240). Shape filtering: Detect circular contours using the Hough transform to exclude interfering light sources such as car lights.
[0144] Step 3: Motion area detection in the second image area, wherein the frame difference method: compares the current frame with the background model to extract motion pixels, and target clustering: performs DBSCAN clustering on the motion pixels to generate a motion area bounding box (BoundingBox).
[0145] Step 4: IOU calculation and filtering, including calculating the intersection over union ratio. Dynamic threshold adjustment: When light intensity is >100,000 lux, the IOU threshold is set to 0.3; on cloudy days, it is set to 0.1. Multi-frame verification: If the IOU of three consecutive frames exceeds the threshold, it is determined to be solar interference and the trigger is discarded.
[0146] Furthermore, in this embodiment, PIR and camera calibration requires a pre-established spatial mapping relationship using a checkerboard calibration method. Computational resource optimization utilizes lightweight models (such as MobileNet) for real-time image processing. A false-positive filtering mechanism is implemented, with a temporary shielding zone near the sun to allow alarms to be triggered in other areas.
[0147] In one embodiment of the present application, the method is applied to a terminal device connected to at least two types of sensors, and the method further includes:
[0148] Acquire a detection signal collected by a sensor, and determine a target condition corresponding to the detection information based on a signal type of the detection signal;
[0149] In a case where the detection signal meets the target condition, the shooting device is controlled to capture a target image, and the steps of determining the first image area and the second image area in the target image are performed.
[0150] In the embodiment of the present application, a detection signal collected by a sensor is obtained, and a signal type of the detection signal is obtained. The signal type may refer to signal classification information. For example, the signal type includes an infrared signal or a position signal. After determining the signal type in the embodiment of the present application, the computer device queries a preset data table, wherein the preset data table records standard judgment conditions for different types of signals, and the computer device obtains the target condition corresponding to the signal type.
[0151] The computer device determines whether the detection signal meets the target conditions. If the detection signal does not meet the target conditions, no processing is performed. If the detection signal meets the target conditions, the target image is collected, which can reduce the number of target images collected and further reduce power consumption.
[0152] In one embodiment of the present application, the detection signal includes: an infrared signal and a positioning signal; the target condition corresponding to the infrared signal is a change in signal strength, and the target condition corresponding to the positioning signal is a change in signal position;
[0153] When the detection signal meets the target condition, controlling the shooting device to capture the target image includes:
[0154] When the signal strength of the infrared signal changes, the shooting device is controlled to capture the target image; or when the signal position of the positioning signal changes, the shooting device is controlled to capture the target image.
[0155] In the embodiment of the present application, the signal detected by the computer device is an infrared signal. If the infrared signal changes, it indicates that there is a suspected moving target. Therefore, the judgment condition of the infrared signal is set to a change in signal strength. When the signal strength of the infrared signal changes, the shooting device is controlled to capture the target image; when the signal strength of the infrared signal does not change, no processing is performed.
[0156] In the embodiment of the present application, if the signal detected by the computer device is a positioning signal, then a change in the position of the positioning signal indicates that there is a suspected moving target, and therefore the judgment condition of the positioning signal is set to a change in the signal position; if the signal position of the positioning signal changes, the shooting device is controlled to capture the target image; if the signal position of the positioning signal does not change, no processing is performed.
[0157] In the embodiment of the present application, different detection signals can be combined to determine whether to capture the target image, which can achieve accurate identification of moving targets and reduce false triggering.
[0158] Based on the same inventive concept, embodiments of the present application further provide a motion detection device for implementing the aforementioned motion detection method, and a motion detection device for implementing the aforementioned motion detection method. The implementation solution provided by the device is similar to the implementation solution described in the aforementioned method. Therefore, the specific limitations of the one or more motion detection devices and embodiments of the motion detection device provided below can be found in the above-mentioned definitions of the motion detection method and motion detection method, and the specific limitations are not repeated here.
[0159] like Figure 6 and Figure 7 As shown, Figure 6 and Figure 7 is a structural diagram of a motion detection device provided in an embodiment of the present application; this embodiment also provides a motion detection device, the device comprising:
[0160] The acquisition module 501 is used to control the camera to acquire a target image in response to a trigger operation based on an infrared signal;
[0161] Determination module 502 is configured to determine a first image region and a second image region in the target image; wherein the first image region is a region in the target image having a brightness value greater than a brightness threshold; and the second image region is a region in the target image corresponding to motion pixels; the motion pixels represent pixel differences between at least two frames of the target image.
[0162] The output module 503 is configured to trigger a moving target prompt based on the first image area and the second image area, wherein the first image area includes at least one and the second image area matches a target set in the target image.
[0163] refer to Figure 6 In the embodiment of the present application, the acquisition module includes an infrared sensor, which includes a Fresnel lens array, a dual-sensitive element infrared probe and a signal filtering circuit for accurately acquiring infrared signals. In the embodiment of the present application, the acquisition module also includes a camera, which is a visible light camera. The camera is connected to the image preprocessing unit and can process the acquired target image. In the embodiment of the present application, the determination module is also included, which includes a calibration unit for aligning multiple signal information; an IOU calculation unit for processing the target image, determining the first image area and the second image area, and also including a multi-frame verification buffer area, which can cache multiple frames of images and then combine them for analysis. Furthermore, in the embodiment of the present application, the output module is also included, and the output module includes an alarm signal interface for outputting alarm signal information; a log recording unit is used to record moving target information.
[0164] In some embodiments, the motion detection device further comprises:
[0165] Contour detection is performed on highlight pixels in the target image to filter out interfering light sources, and the first image area is determined; the highlight pixels include at least two pixels in the target image whose brightness values are greater than the brightness threshold.
[0166] In some embodiments, the motion detection device further comprises:
[0167] Obtaining a target image and a reference image of the target image by differential processing to obtain moving pixel points; wherein the reference image is a historical image acquired before the target image;
[0168] Clustering the moving pixels to obtain the second image region.
[0169] In some embodiments, the motion detection device further comprises:
[0170] Performing background recognition on the reference image using a preset recognition model to obtain a background model in the reference image;
[0171] The target image and the background model are processed according to the difference method to obtain the moving pixel points.
[0172] In some embodiments, the output module 503 in the motion detection device further includes:
[0173] calculating an intersection-and-union ratio of the first image region and the second image region to obtain a target intersection-and-union ratio;
[0174] When the target intersection-in-union ratio is less than the intersection-in-union ratio threshold, it is determined that there is a moving target and an output prompt is output; wherein the intersection-in-union ratio threshold is set according to the ambient light intensity corresponding to the target image, and the intersection-in-union ratio threshold has the same changing trend as the ambient light intensity.
[0175] In some embodiments, the motion detection device further comprises:
[0176] When the target IoU is greater than or equal to the IoU threshold, determining that the moving target does not exist, and counting the number of target images that do not contain the moving target;
[0177] When the number of the target images exceeds a preset number, it is determined that no moving target exists and the trigger operation is ignored.
[0178] In some embodiments, the acquisition module 501 further includes:
[0179] In the case where the infrared signal changes, determining a spatial position corresponding to the changed infrared signal;
[0180] According to the spatial position and the preset mapping relationship, the shooting device is determined and the shooting device is controlled to capture the target image; wherein the preset mapping relationship is a pre-calibrated spatial position conversion relationship between the shooting device and the infrared sensing device that collects the infrared signal.
[0181] In some embodiments, the motion detection device is provided in a terminal device, the terminal device is connected to at least two types of sensors, and the device further includes:
[0182] Acquire a detection signal collected by a sensor, and determine a target condition corresponding to the detection information based on a signal type of the detection signal;
[0183] In a case where the detection signal meets the target condition, the shooting device is controlled to capture a target image, and the steps of determining the first image area and the second image area in the target image are performed.
[0184] In some embodiments, the detection signal includes: an infrared signal and a positioning signal; the target condition corresponding to the infrared signal is a change in signal strength, and the target condition corresponding to the positioning signal is a change in signal position;
[0185] The motion detection device controls the shooting device to capture the target image when the detection signal meets the target condition, including:
[0186] When the signal strength of the infrared signal changes, controlling the shooting device to capture a target image; or
[0187] When the signal position of the positioning signal changes, the shooting device is controlled to capture the target image.
[0188] In some embodiments, the motion detection device further comprises:
[0189] If the motion detection result indicates that a moving target exists, determining associated information of the moving target; the associated information includes a moving speed of the moving target detected by a speed sensor, or a surface temperature of the moving target detected by a thermal imaging sensor;
[0190] When the movement speed meets the speed range and the surface temperature meets the temperature range, an early warning prompt is triggered.
[0191] In some embodiments, the motion detection device responds to a trigger operation based on an infrared signal, controls the shooting device to capture the target image, and the infrared signal is only sensitive to a specific wavelength, filters out some heat source interference, reduces the power consumption of the shooting device while improving the triggering efficiency, and then determines the first image area and the second image area in the target image; wherein, the first image area is the area in the target image where the brightness value is greater than the brightness threshold; the second image area is the area corresponding to the motion pixels in the target image; based on the first image area and the second image area, a motion target prompt is triggered; the false alarm rate is reduced by spatial overlap verification of the two areas. The technical solution of the present application can achieve high-precision motion target detection and low false alarm rate prompts through collaborative optimization of infrared triggering and multimodal image analysis.
[0192] Based on the same inventive concept, an embodiment of the present application further provides a computer device, which may be a server or a terminal device. The computer device includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the above-mentioned motion detection method. This implements various functions, such as:
[0193] In response to a trigger operation based on an infrared signal, the camera is controlled to capture a target image;
[0194] Determining a first image region and a second image region in the target image; wherein the first image region is a region in the target image having a brightness value greater than a brightness threshold; and the second image region is a region in the target image corresponding to motion pixels, wherein the motion pixels represent pixel differences between at least two frames of the target image;
[0195] A moving target prompt is triggered according to the first image area and the second image area; the first image area includes at least one, and the second image area matches the target set in the target image.
[0196] In the embodiment of the present application, the computer device responds to the trigger operation based on the infrared signal, controls the shooting device to capture the target image, the infrared signal is only sensitive to a specific wavelength, filters out some heat source interference, reduces the power consumption of the shooting device while improving the triggering efficiency, and then determines the first image area and the second image area in the target image; wherein, the first image area is the area in the target image whose brightness value is greater than the brightness threshold; the second image area is the area corresponding to the moving pixels in the target image; according to the first image area and the second image area, the moving target prompt is triggered; the false alarm rate is reduced by spatial overlap verification of the two areas. The technical solution of the present application can achieve high-precision moving target detection and low false alarm rate prompts through the coordinated optimization of infrared triggering and multimodal image analysis.
[0197] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.
[0198] In one embodiment, the computer device is a terminal device, for example, its internal structure diagram can be as follows Figure 8As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a motion detection method is implemented. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.
[0199] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0200] Based on the same inventive concept, an embodiment of the present application also provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0201] Since the computer program stored in the computer-readable storage medium can execute any motion detection method provided in the embodiments of the present application, the beneficial effects that can be achieved by any motion detection method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0202] Based on the same inventive concept, embodiments of the present application further provide a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in various optional implementations of the above embodiments.
[0203] It should be noted that the object data (including but not limited to user device information, user personal information, etc.) and conversation data involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions. Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods.
[0204] Any reference to the memory, database or other media used in the various embodiments provided herein may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0205] The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may include, but are not limited to, general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic units, data processing logic units based on quantum computing, and the like.
[0206] In the above-described embodiments of the motion detection device, computer-readable storage medium, computer equipment, and computer program product, the descriptions of each embodiment have different focuses. For portions not described in detail in a particular embodiment, reference can be made to the relevant descriptions of other embodiments. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes and beneficial effects of the above-described motion detection device, computer-readable storage medium, computer program product, computer equipment, and their corresponding units can be referred to in the description of the motion detection method in the above embodiments, and the details will not be repeated here.
[0207] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0208] The above is a detailed introduction to a motion detection method, device, computer equipment, computer-readable storage medium and computer program product provided in the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, based on the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A motion detection method, characterized in that: The method comprises: In response to a trigger operation based on an infrared signal, the camera is controlled to capture a target image; Determine a first image region and a second image region in the target image; wherein the first image region is a region in the target image having a brightness value greater than a brightness threshold; and the second image region is a region in the target image corresponding to motion pixels; the motion pixels represent pixel differences between at least two frames of the target image; A moving target prompt is triggered according to the first image area and the second image area, wherein the first image area includes at least one, and the second image area matches the target set in the target image.
2. The method according to claim 1, characterized in that The method further comprises: Perform contour detection on the highlighted pixels in the target image to filter out interfering light sources, and determine the first image area; wherein the highlighted pixels include at least two pixels in the target image whose brightness values are greater than the brightness threshold.
3. The method according to claim 1, characterized in that The method further comprises: Obtaining motion pixels by processing the target image and a reference image of the target image using a difference method, wherein the reference image is a historical image acquired before the target image; Clustering the moving pixels to obtain the second image region.
4. The method according to claim 3, characterized in that Before obtaining the moving pixel points by processing the target image and the reference image of the target image by a difference method, the method further includes: Performing background recognition on the reference image using a preset recognition model to obtain a background model in the reference image; The target image and the background model are processed according to the difference method to obtain the moving pixel points.
5. The method according to claim 1, wherein The triggering of a moving target prompt according to the first image area and the second image area includes: Obtaining an intersection-over-union (IoU) ratio between the first image area and the second image area to obtain a target IoU ratio; When the target intersection-and-union ratio is less than an intersection-and-union ratio threshold, it is determined that there is a moving target and an output prompt is output; wherein the intersection-and-union ratio threshold is set according to the ambient light intensity corresponding to the target image, and the intersection-and-union ratio threshold is positively correlated with the ambient light intensity.
6. The method according to claim 5, characterized in that The method further comprises: When the target IoU is greater than or equal to the IoU threshold, determining that the moving target does not exist, and counting the number of target images that do not contain the moving target; When the number of the target images exceeds a preset number, it is determined that no moving target exists and the trigger operation is ignored.
7. The method according to claim 5, characterized in that The triggering of a moving target prompt according to the first image area and the second image area includes: In a case where there are at least two first image areas, setting at least one first image area in the target image as a shielding area; A moving target prompt is triggered according to the first image area and the second image area in the new target image except the shielded area.
8. The method according to any one of claims 1 to 7, characterized in that The method further comprises: In the case where the infrared signal changes, determining a spatial position corresponding to the changed infrared signal; According to the spatial position and the preset mapping relationship, the shooting device is determined and the shooting device is controlled to capture the target image; wherein the preset mapping relationship is a pre-calibrated spatial position conversion relationship between the shooting device and the infrared sensing device that collects the infrared signal.
9. The method according to any one of claims 1 to 7, characterized in that The method is applied to a terminal device connected to at least two types of sensors, and the method further includes: Acquire a detection signal collected by a sensor, and determine a target condition corresponding to the detection information based on a signal type of the detection signal; In a case where the detection signal meets the target condition, the shooting device is controlled to capture a target image, and the steps of determining the first image area and the second image area in the target image are performed.
10. The method according to claim 9, characterized in that The detection signal includes: an infrared signal and a positioning signal; the target condition corresponding to the infrared signal is a change in signal strength, and the target condition corresponding to the positioning signal is a change in signal position; When the detection signal meets the target condition, controlling the shooting device to capture the target image includes: When the signal strength of the infrared signal changes, controlling the shooting device to capture a target image; or, When the signal position of the positioning signal changes, the shooting device is controlled to capture the target image.
11. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: When the motion detection result indicates that a moving target exists, determining associated information of the moving target; wherein the associated information includes a moving speed of the moving target detected by a speed sensor, or a surface temperature of the moving target detected by a thermal imaging sensor; When the movement speed meets the speed range and the surface temperature meets the temperature range, an early warning prompt is triggered.
12. A motion detection device, characterized in that: The device comprises: An acquisition module, configured to respond to a trigger operation based on an infrared signal and control a camera to acquire a target image; a control module configured to determine a first image region and a second image region in the target image; wherein the first image region is a region in the target image having a brightness value greater than a brightness threshold; and the second image region is a region in the target image corresponding to motion pixels; the motion pixels represent pixel differences between at least two frames of the target image; An output module is used to trigger a moving target prompt based on the first image area and the second image area, wherein the first image area includes at least one, and the second image area matches the target set in the target image.
13. A motion detection system, characterized in that: The system is applied to any one of the methods described in 1-8.
14. A terminal device, characterized in that: The system comprises a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps of the motion detection method according to any one of claims 1 to 11.
15. A computer program product, characterized in that The computer program product comprises a computer program or instructions, and the computer program or instructions are used by a processor to execute the steps of the motion detection method according to any one of claims 1 to 11.
16. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps of the motion detection method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Target detection method and related device
CN110569840A
Motor home night security system and method based on artificial intelligence
CN115410324A
Video monitoring management system and method applied to smart home
CN115731659A
Image processing method and device
CN116055891A
Fire source detection method, system and device
CN117315343A