CN117765277A - Target object motion detection method, device, equipment and storage medium - Google Patents

Target object motion detection method, device, equipment and storage medium Download PDF

Info

Publication number
CN117765277A
CN117765277A CN202311751770.5A CN202311751770A CN117765277A CN 117765277 A CN117765277 A CN 117765277A CN 202311751770 A CN202311751770 A CN 202311751770A CN 117765277 A CN117765277 A CN 117765277A
Authority
CN
China
Prior art keywords
target object
image reference
reference block
image
similarity
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311751770.5A
Other languages
Chinese (zh)
Inventor
王桂星
陈磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Ruilian Technology Co ltd
Original Assignee
Shenzhen Ruilian Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Ruilian Technology Co ltd filed Critical Shenzhen Ruilian Technology Co ltd
Priority to CN202311751770.5A priority Critical patent/CN117765277A/en
Publication of CN117765277A publication Critical patent/CN117765277A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)

Abstract

The invention discloses a target object motion detection method, a device, equipment and a storage medium, wherein the target object motion detection method comprises the following steps: acquiring two adjacent frames of images shot by a camera, wherein the two adjacent frames of images contain a first target object; extracting a preset number of background images from the periphery of a first target object, and judging whether the background images contain a second target object or not, wherein the first target object and the second target object are preset movable objects; if the background image does not contain the second target object, determining the background image as an image reference block; calculating the similarity of image reference blocks at corresponding positions in two adjacent frames of images, and judging whether the similarity of the image reference blocks is larger than or equal to a preset threshold value; if the similarity corresponding to the at least one image reference block is smaller than a preset threshold value, determining that the first target object is in a motion state. The target object motion detection method can reduce misjudgment on the motion state of the target object.

Description

Target object motion detection method, device, equipment and storage medium
Technical Field
The present invention relates to the field of security technologies, and in particular, to a method, an apparatus, a device, and a storage medium for detecting movement of a target object.
Background
In video monitoring products, the camera of the high-speed dome camera has the function of rotatably scanning a monitoring scene, namely, the angle of the camera can rotate at a high speed in the horizontal direction and the vertical direction, and if a specific moving target is detected, an alarm is sent out and tracked. However, when the camera is tracking the walking person, the stationary car in the image is actually displaced relative to the camera due to the displacement of the camera, which may cause the monitoring device to misjudge the stationary car as moving.
Disclosure of Invention
The invention provides a target object motion detection method, a target object motion detection device, target object motion detection equipment and a storage medium, so as to solve at least one technical problem.
The invention provides a target object motion detection method, which comprises the following steps:
acquiring two adjacent frames of images shot by a camera, wherein the two adjacent frames of images contain a first target object;
extracting a preset number of background images from the periphery of the first target object, and judging whether the background images contain a second target object or not, wherein the first target object and the second target object are preset movable objects;
if the background image does not contain the second target object, determining the background image as an image reference block;
calculating the similarity of the image reference blocks at corresponding positions in the two adjacent frames of images, and judging whether the similarity of the image reference blocks is larger than or equal to a preset threshold value;
and if the similarity corresponding to the at least one image reference block is smaller than a preset threshold value, determining that the first target object is in a motion state.
According to the target object motion detection method, the similarity of the image reference blocks around the target object in the two adjacent frames of environment images is calculated, so that the motion state of the target object can be determined, and misjudgment of the motion state of the target object is avoided.
In an optional aspect of the invention, the extracting a preset number of image reference blocks from around the first target object includes:
determining a width and a height of the first target object;
taking the width of the first target object as a reference, respectively acquiring a first image reference block and a second image reference block at two sides of the first target object along the width direction, wherein the sum of the widths of the first image reference block and the second image reference block is the same as the width of the first target object;
and respectively acquiring a third image reference block and a fourth image reference block on two sides of the first target object along the height direction by taking the height of the first target object as a reference, wherein the sum of the heights of the third image reference block and the fourth image reference block is the same as the height of the first target object.
In an optional aspect of the present invention, the calculating the similarity of the image reference blocks at corresponding positions in the two adjacent frames of images includes:
acquiring a histogram array of the image reference block;
and calculating the correlation coefficient of the histogram array of the image reference block at the corresponding position in the two adjacent frames of images, and taking the correlation coefficient as the similarity.
In an optional aspect of the present invention, the obtaining the histogram array of the image reference block includes:
converting the image reference block from RGB color space to YUV format;
and acquiring a Y component value of each pixel in the image reference block under the YUV format, and counting the number of pixels corresponding to the Y component value of 0-255 in sequence to form a histogram array containing 256 statistic values.
In an optional technical solution of the present invention, the target object motion detection method includes:
the method for extracting the background images from the periphery of the first target object comprises the steps of extracting a preset number of background images from the periphery of the first target object, judging whether the background images contain a second target object, wherein after the first target object and the second target object are preset movable objects, the method comprises the following steps:
and if all the background images contain the second target object, determining that the first target object is in a static state.
In an alternative embodiment of the invention,
the calculating the similarity of the image reference blocks at the corresponding positions in the two adjacent frames of images, and judging whether the similarity of the image reference blocks is greater than or equal to a preset threshold value, comprises:
and if the similarity of the image reference blocks is greater than or equal to a preset threshold value, determining that the first target object is in a static state.
In an alternative embodiment of the invention,
if the similarity corresponding to the at least one image reference block is smaller than a preset threshold, determining that the first target object is in a motion state includes:
when the number of the first target objects in the motion state is determined to be one, controlling the camera to move so as to track the first target objects;
when the number of the first target objects in the motion state is determined to be a plurality of, controlling the camera to move according to the preset target object priority so as to track the first target object with the highest priority.
The invention also discloses a target object motion detection device, which comprises:
the first acquisition module is configured to acquire two adjacent frames of images shot by the camera, wherein the two adjacent frames of images contain a first target object;
the second acquisition module is configured to extract a preset number of background images from the periphery of the first target object, and judge whether the background images contain a second target object or not, wherein the first target object and the second target object are preset movable objects;
the first determining module is configured to determine the background image as an image reference block if the background image does not contain the second target object;
the calculating module is configured to calculate the similarity of the image reference blocks at corresponding positions in the two adjacent frames of images and judge whether the similarity of the image reference blocks is larger than or equal to a preset threshold value;
and the second determining module is configured to determine that the first target object is in a motion state if the similarity corresponding to at least one image reference block is smaller than a preset threshold value.
The invention also discloses a target object motion detection device, which comprises a memory and a processor, wherein the memory stores a computer program, and the computer program is executed by the processor to realize a target object motion detection method.
The invention also discloses a non-volatile computer readable storage medium on which a computer program is stored which, when executed by a processor, implements a target object motion detection method.
When the method and the device detect whether the first target object moves, firstly, whether the background image contains the second target object or not is judged, if the second target object does not contain the second target object, the background image is determined to be the image reference block, misjudgment of the similarity of the subsequent background image caused by interference of the second target object on the background image can be avoided, then, by comparing the similarity of the image reference blocks at corresponding positions in two adjacent frames of images, if the similarity corresponding to at least one image reference block is smaller than a preset threshold value, the first target object is determined to be in a moving state, and misjudgment of the moving state of the first target object is reduced.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a target object motion detection method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a position of a first target object according to an embodiment of the present invention;
FIG. 3 is a second schematic diagram of a position of a first target object according to an embodiment of the present invention;
FIG. 4 is a third schematic diagram of a position of a first target object according to an embodiment of the present invention;
FIG. 5 is a schematic diagram showing a position of a first target object according to an embodiment of the present invention;
fig. 6 is a schematic block diagram of a target object motion detection apparatus according to an embodiment of the present invention;
fig. 7 is a schematic block diagram of a target object motion detection apparatus according to an embodiment of the present invention.
Reference numerals illustrate:
10-a camera; a 20-processor; 30-memory; 40-a first acquisition module; 50-a second acquisition module; 60-a first determination module; 70-a calculation module; 90-a second determination module; 71-a first image reference block; 72-a second image reference block; 73-a third image reference block; 74-a fourth image reference block; 81-a first target object; 82-a second target object; 100-motion detection means; 200-motion detection device.
Detailed Description
Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary only for explaining the present invention and are not to be construed as limiting the present invention.
In video monitoring products, the camera of the high-speed dome camera has the function of rotatably scanning a monitoring scene, namely, the angle of the camera can rotate at a high speed in the horizontal direction and the vertical direction, and if a specific moving target is detected, an alarm is sent out and tracked. However, when the camera is tracking the walking person, the stationary car in the image is actually displaced relative to the camera due to the displacement of the camera, which may cause the monitoring device to misjudge the stationary car as moving.
Referring to fig. 1, an embodiment of the present invention discloses a target object motion detection method, including:
step 101, acquiring two adjacent frames of images shot by the camera 10, wherein the two adjacent frames of images contain a first target object 81;
step 103, extracting a preset number of background images from the periphery of the first target object 81, and judging whether the background images contain the second target object 82, wherein the first target object 81 and the second target object 82 are preset movable objects;
step 105, if the background image does not contain the second target object 82, determining the background image as an image reference block;
step 107, calculating the similarity of image reference blocks at corresponding positions in two adjacent frames of images, and judging whether the similarity of the image reference blocks is greater than or equal to a preset threshold value;
in step 109, if there is at least one image reference block with a similarity smaller than the preset threshold, it is determined that the first target object 81 is in a motion state.
In the above method for detecting the motion of the target object, when detecting whether the first target object moves, firstly, whether the background image contains the second target object is determined to be the image reference block by judging whether the background image does not contain the second target object, if not, the background image is determined to be the image reference block, so that misjudgment of the similarity of the subsequent background image caused by interference of the second target object to the background image can be avoided, then, by comparing the similarity of the image reference blocks at corresponding positions in two adjacent frames of images, if the similarity corresponding to at least one image reference block is smaller than a preset threshold value, the first target object is determined to be in a motion state, and misjudgment of the motion state of the first target object is reduced.
The camera 10 may acquire N frames of ambient images per second, N being 15 or less in one embodiment. In one embodiment, N is 10 or less.
For convenience of explanation, the former of the adjacent two frame environment images is defined as a first frame environment image as shown in fig. 2, and the latter is defined as a second frame environment image as shown in fig. 3; the camera 10 may have a processor 20, where the characteristics of the first target object 81 are preset in the processor 20, and the following processing or calculation is performed on the first frame and the second frame, respectively:
comparing the object features in the environment image with the features of the preset first target object 81, if the features of the preset first target object 81 are similar to the recognized object features, the object features can be recognized as the first target object 81, and the preset first target object 81 can be a person, an animal, an automobile or the like. For example, the processor 20 may use a deep learning algorithm to identify objects such as people, vehicles, pets, etc., and obtain the location of the objects in the environmental image and their corresponding rectangular extent. The target object may be marked in the ambient image using a rectangular box.
When the processor 20 identifies the first target object 81, the first target object 81 and the background image are separated through a preset algorithm, and the object features in the background image are compared with the preset target object features, if the preset target object features are similar to the identified object features, the object features are identified as the second target object 82, when the background image includes the second target object 82, the first target object 81 is judged to be in a static state, when the background image is detected to include the second target object 82, if the second target object 82 is detected to include the second target object 82, the accuracy of similarity calculation is affected if the second target object 82 is large, in order to avoid the influence of the second target object 82 on the accuracy of similarity calculation, when the second target object 82 is detected in the background image, the first target object 81 is determined to be in the static state, so that the calculation amount of the detection method can be reduced, and the detection efficiency of the detection method can be further improved.
The similarity of the image reference blocks at the corresponding positions of the first frame and the second frame is calculated, and the calculated similarity is compared with a preset range to determine the motion state of the first target object 81.
Judging whether the similarity value of the image reference block of the first target object 81 in the two adjacent frames of environment images is larger than or equal to a preset threshold value, and determining that the first target object 81 is in a motion state when the similarity value of the image reference block of the first frame and the image reference block of the second frame is larger than or equal to the preset threshold value. When the similarity value of the image reference block of the first frame and the image reference block of the second frame is equal to the preset threshold value, it is determined that the first target object 81 is in a stationary state.
The specific size of the preset range can be determined according to empirical values, simulation, test and the like, and is not particularly limited herein.
In some embodiments, extracting a preset number of image reference blocks from around the first target object 81 includes:
determining a width and a height of the first target object 81;
taking the width of the first target object 81 as a reference, respectively acquiring a first image reference block 71 and a second image reference block 72 on both sides of the first target object 81 in the width direction, wherein the sum of the widths of the first image reference block 71 and the second image reference block 72 is the same as the width of the first target object 81;
the third image reference block 73 and the fourth image reference block 74 are acquired on both sides of the first target object 81 in the height direction, respectively, with the height of the first target object 81 as a reference, and the sum of the heights of the third image reference block 73 and the fourth image reference block 74 is the same as the height of the first target object 81.
When an image is acquired, the detection method may convert coordinates in the three-dimensional space into projections in the two-dimensional space, as shown in fig. 2 to 5, two-dimensional gridding may be performed on the acquired image to form two-dimensional coordinates, as shown in fig. 2, the projections of the rectangular frame where the first target object 81 is located in the two-dimensional space may cover a certain number of digital grids, so as to determine the two-dimensional size of the target object in the two-dimensional space, that is, the height and the width of the target object.
The image reference blocks are based on the center of the first target object 81, and are distributed in the vertical direction (the height direction of the first target object 81) and the horizontal direction (the width direction of the first target object 81) with respect to the center of the first target object 81. Specifically, the image reference block may take the height of the first target object 81 as a reference, and take one half of the height of the first target object 81 above the first target object 81 to form the first image reference block 71; taking one half of the height of the first target object 81 below the first target object 81 to form a second image reference block 72; taking one half of the width of the first target object 81 to the left of the first target object 81, forming a third image reference block 73; taking one half of the width of the first target object 81 to the right of the target object, a fourth image reference block 74 is formed. It is noted that in other embodiments, the image reference blocks may include at least one of the first image reference block 71, the second image reference block 72, the third image reference block 73, and the fourth image reference block 74. The size of the image reference block is also not limited to one half of the size of the target object.
Fig. 2 to 5 show the position of the first target object 81 (person) in the environment image. In addition, fig. 2 to 5 also show the position of the second target object 82 (car) in the environment image. The second target object 82 (car) is in a stationary state and the first target object 81 (person) is in a moving state.
In some embodiments, calculating the similarity of the image reference blocks at corresponding positions in the two adjacent frames of images includes:
acquiring a histogram array of an image reference block;
and calculating the correlation coefficient of the histogram array of the image reference block at the corresponding position in the two adjacent frames of images, wherein the correlation coefficient is used as the similarity.
The similarity of the image reference blocks at the corresponding positions in two adjacent frames of images is calculated through the histogram array, and the method has the advantages of simplicity and convenience in calculation and high speed.
Referring to fig. 2 and fig. 3 in combination, the first frame of environment image is shown in fig. 2, the first frame of environment image has 4 image reference blocks, which are respectively located above, below, left and right of the first target object, and a histogram array of the four image reference blocks of the first frame of image is obtained through a histogram algorithm. The second frame of environment image is shown in fig. 3, the second frame of environment image has 4 image reference blocks which are respectively located on the upper, lower, left and right sides of the first target object, and a histogram array of the four image reference blocks of the second frame of image is obtained through a histogram algorithm.
After all histogram arrays of the two-frame ambient image are obtained, correlation coefficients of the two histogram arrays of the first image reference block 71 of the first frame ambient image and the first image reference block 71 of the second frame ambient image are calculated. The correlation coefficients of the two histogram array values of the second image reference block 72 of the first frame ambient image and the second image reference block 72 of the second frame ambient image are calculated. The correlation coefficients of the two histogram arrays of the third image reference block 73 of the first frame ambient image and the third image reference block 73 of the second frame ambient image are calculated. Correlation coefficients of two histogram arrays of the fourth image reference block 74 of the first frame ambient image and the fourth image reference block 74 of the second frame ambient image are calculated.
The correlation coefficient can be used as the similarity of image reference blocks around the target object in the two adjacent frame environment images, and the similarity is compared, so that the motion state of the target object can be determined.
In other embodiments, one of a cosine similarity algorithm, a hash algorithm, a mutual information algorithm, a mean square error algorithm, a structural similarity algorithm and a feature matching algorithm can be used for calculating the similarity of image reference blocks around the target object in the two adjacent frames of environment images, so that the calculation mode of the similarity of the image reference blocks is flexible and selectable, and a proper algorithm can be selected for calculation according to different scenes, so that the calculation efficiency of the target object motion detection method is improved.
In some embodiments, obtaining a histogram array of the image reference block includes:
converting the image reference block from the RGB color space to YUV format;
and acquiring the Y component value of each pixel in the image reference block under the YUV format, and counting the number of pixels corresponding to the Y component value of 0-255 in sequence to form a histogram array containing 256 statistic values.
Specifically, YUV format is a color coding method, where "Y" represents brightness (luminence or Luma), that is, gray scale values, and "U" and "V" represent chromaticity (chromance or Chroma).
The RGB color space, i.e., the RGB color pattern, is obtained by varying the three color channels of red (R), green (G), and blue (B) and overlapping them with each other. The calculated amount required by the RGB color space is large, and when the calculated amount is reduced by adopting the image histogram algorithm, the image reference block is firstly converted into the YUV format from the RGB color space when the calculated amount is calculated by adopting the image histogram algorithm.
In YUV format, Y represents a luminance component and UV is a chrominance component, with each Y component for a pair of UV components. When calculated, a histogram array for each image reference block may be calculated. Hx is an array that counts the luminance distribution in an image reference block, the number of pixels corresponding to each luminance value.
Each pixel in each image reference block can be uniquely identified by using three components of YUV, in order to avoid the influence of color on the similarity of the calculated image reference block, only Y components are used for calculation, each pixel has a corresponding determined Y value, the range of the Y value is 0-255, then the number of pixels corresponding to any number of 0-255 of Y in one image reference block is counted, a histogram array containing 256 statistic values is formed, and the obtained histogram array is the histogram array of one image reference block in one frame.
In some embodiments, extracting a preset number of background images from the surroundings of the first target object, and determining whether the background images include the second target object 82, where after the first target object 81 and the second target object 82 are preset movable objects, includes:
if all the background images contain the second target object 82, it is determined that the first target object 81 is in a stationary state.
In this way, it can be determined whether the first target object 81 is in a stationary state.
In some cases, a background image is extracted from around the first target object 81, and other target objects may be included in the background image, for example: the second target object 82, if it matches the second target object 82 from the extracted background image, determines that the first target object is in a stationary state, because the second target object 82 may cover all image reference blocks of the first target object 81, affect the obtained histogram array and the calculated correlation coefficient, and determine that the first target object 81 is in a stationary state when the second target object 82 is detected in order to reduce the calculation amount.
In one embodiment, calculating the similarity of the image reference blocks at corresponding positions in two adjacent frames of images, and judging whether the similarity of the image reference blocks is greater than or equal to a preset threshold value includes:
if the similarity of the image reference blocks is greater than or equal to the preset threshold, it is determined that the first target object 81 is in a stationary state.
In this way, the motion state of the first target object 81 can be determined based on the correlation coefficient compared with the preset threshold.
For ease of illustration and understanding of the following schemes, the image may be divided into a target feature layer and an environmental reference layer; wherein the first target object 81 is located at the target feature layer, and the images in each image reference block are located at the environment reference layer.
Specifically, the correlation coefficients of the two image reference blocks at the corresponding positions of the first target object 81 in the two adjacent frame images are calculated, and the correlation coefficients of the two image reference blocks at the corresponding positions around the first target object 81 in the two adjacent frame images are obtained.
When the correlation coefficients of the two image reference blocks at the corresponding positions of the first target object 81 are both greater than a preset value (i.e., the change of the environmental reference layer of the first frame image and the change of the environmental reference layer of the second frame image are not great in YUV format), it can be explained that the position of the first target object 81 in the image is not changed or is basically unchanged, and at this time, it can be determined that the similarity of the image reference blocks around the first target object 81 in two adjacent frame images is greater than or equal to a preset threshold, and then it is determined that the first target object 81 is in a static state.
If the correlation coefficient of all the image reference blocks of the two adjacent frames is not greater than the preset value after calculating the correlation coefficient, it is indicated that the change of the environmental reference layer of the first frame image and the change of the environmental reference layer of the second frame image are greater under the YUV format, so that it is determined that the similarity of the image reference blocks around the first target object 81 in the two adjacent frames is less than the preset threshold value, and further it is determined that the first target object 81 is in a motion state.
Alternatively, the correlation coefficient d may be calculated by the following formula (1):
wherein: h 1 For a histogram value of a certain image reference block of the first frame image,is H 1 Average value of H 2 Histogram values of the image reference block for the corresponding position of the second frame image, for>Is H 2 Average value of (2). H in combination with FIGS. 2 and 3 1 Histogram values, H, of a first image reference block 71, which may be a first frame image (fig. 2) 2 The histogram values of the first image reference block 71, which may be the second frame image (fig. 3). H in combination with FIGS. 3 and 4 1 Histogram values, H, of a first image reference block 71, which may be a first frame image (fig. 3) 2 The histogram values of the block 71 may be referred to for the first image of the second frame ambient image (fig. 4).
I represents the number of the arrayThe number of pixels when the brightness is I, H 1 (I) Any one of values 0 to 255 may be taken. The closer the correlation coefficient d is to 1, the more similar the two are explained.
The average value of H can be calculated by the following formula (2):
where n=256,is H K Average value of H K For the array of any reference block in the current image, J represents the number of pixels in the array with brightness J, H K (J) Any one of values 0 to 255 may be taken.
The preset value may be determined according to an empirical value, a simulation, a test, etc., which is not particularly limited in the present invention. In one embodiment, the preset value may be x, where 0< x <1. When all the correlation coefficients d are larger than x, it is determined that the first target object 81 is in a stationary state. When at least one of all the correlation coefficients d is not greater than x, it is determined that the first target object 81 is in a motion state.
In some embodiments, if there is at least one image reference block with a similarity smaller than a preset threshold, determining that the first target object 81 is in a motion state includes:
when it is determined that the number of the first target objects 81 in the moving state is one, the camera 10 is controlled to move to track the first target objects 81;
when it is determined that the number of the first target objects 81 in the moving state is plural, the camera 10 is controlled to move according to the preset target object priority to track the first target object 81 having the highest priority.
After the first target object 81 is identified, a second target object 82 is identified in the environment image again, and then the tracking object is determined according to the preset tracking priority; in the normal state, the moving state identifies that the priority of the preceding first target object 81 is high. For example, in the case where the image contains a plurality of target objects in a moving state, the camera 10 is controlled to move so as to track the first target object that recognizes the moving state.
Optionally, in an embodiment, the preset target object priority may be determined according to the type of the object, for example, the priority of a person is higher than the priority of a vehicle, the priority of a child is higher than the priority of an adult, etc.
Optionally, in an embodiment, the preset target object priority may be predetermined according to other requirements, and the present invention is not limited herein.
Referring to fig. 6, the embodiment of the present invention further discloses a motion detection apparatus 100, where the motion detection apparatus 100 includes: the first acquisition module 40, the second acquisition module 50, the first determination module 60, the calculation module 70, the second determination module 90;
a first obtaining module 40, configured to obtain two adjacent frame images captured by the camera 10, where the two adjacent frame images include a first target object 81;
a second obtaining module 50 configured to extract a preset number of background images from around the first target object 81, and determine whether the background images include the second target object 82, where the first target object 81 and the second target object 82 are preset movable objects;
a first determining module 60 configured to determine the background image as an image reference block if the second target object 82 is not included in the background image;
the calculating module 70 is configured to calculate the similarity of the image reference blocks at corresponding positions in two adjacent frames of images, and determine whether the similarity of the image reference blocks is greater than or equal to a preset threshold;
the second determining module 90 is configured to determine that the first target object 81 is in a motion state if there is at least one image reference block with a similarity smaller than a preset threshold.
Referring to fig. 7, the embodiment of the present invention further discloses a motion detection apparatus 200. The motion detection apparatus 200 comprises a memory 30 and a processor 20, the memory 30 storing a computer program which, when executed by the processor 20, implements a target object motion detection method.
The motion detection apparatus 200 provided in the foregoing embodiments of the present invention performs the method for detecting the motion of the target object in any of the foregoing embodiments of the present invention, so that all the advantages of the method for detecting the motion of the target object are provided, and are not described herein.
The embodiment of the invention also discloses a non-volatile computer readable storage medium, on which a computer program is stored, which when executed by the processor 20 implements the target object motion detection method.
In one embodiment, the target object motion detection method implemented when the computer program is executed by the processor 20 includes:
step 101, acquiring two adjacent frames of images shot by the camera 10, wherein the two adjacent frames of images contain a first target object 81;
step 103, extracting a preset number of background images from the periphery of the first target object 81, and judging whether the background images contain the second target object 82, wherein the first target object 81 and the second target object 82 are preset movable objects;
step 105, if the background image does not contain the second target object 82, determining the background image as an image reference block;
step 107, calculating the similarity of image reference blocks at corresponding positions in two adjacent frames of images, and judging whether the similarity of the image reference blocks is greater than or equal to a preset threshold value;
in step 109, if there is at least one image reference block with a similarity smaller than the preset threshold, it is determined that the first target object 81 is in a motion state.
In the present invention, the computer program includes computer program code. The computer program code may be in the form of source code, object code, executable files, or in some intermediate form, among others. The memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart memory card (SmartMediaCard, SMC), secure digital (SecureDigital, SD) card, flash card (FlashCard), at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. The processor may be a central processing unit (CentralProcessingUnit, CPU), but may also be other general purpose processors, digital signal processors (DigitalSignalProcessor, DSP), application specific integrated circuits (ApplicationSpecificIntegratedCircuit, ASIC), off-the-shelf programmable gate arrays (Field ProgrammableGateArray, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In the description of the present specification, reference to the terms "one embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that: many variations, combinations, modifications, substitutions and alterations of these embodiments may be made without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

Claims (10)

1. A target object motion detection method, characterized by comprising:
acquiring two adjacent frames of images shot by a camera, wherein the two adjacent frames of images contain a first target object;
extracting a preset number of background images from the periphery of the first target object, and judging whether the background images contain a second target object or not, wherein the first target object and the second target object are preset movable objects;
if the background image does not contain the second target object, determining the background image as an image reference block;
calculating the similarity of the image reference blocks at corresponding positions in the two adjacent frames of images, and judging whether the similarity of the image reference blocks is larger than or equal to a preset threshold value;
and if the similarity corresponding to the at least one image reference block is smaller than a preset threshold value, determining that the first target object is in a motion state.
2. The target object motion detection method of claim 1, wherein the extracting a preset number of image reference blocks from around the first target object comprises:
determining a width and a height of the first target object;
taking the width of the first target object as a reference, respectively acquiring a first image reference block and a second image reference block at two sides of the first target object along the width direction, wherein the sum of the widths of the first image reference block and the second image reference block is the same as the width of the first target object;
and respectively acquiring a third image reference block and a fourth image reference block on two sides of the first target object along the height direction by taking the height of the first target object as a reference, wherein the sum of the heights of the third image reference block and the fourth image reference block is the same as the height of the first target object.
3. The method according to claim 1, wherein the calculating the similarity of the image reference blocks at the corresponding positions in the adjacent two frames of images includes:
acquiring a histogram array of the image reference block;
and calculating the correlation coefficient of the histogram array of the image reference block at the corresponding position in the two adjacent frames of images, and taking the correlation coefficient as the similarity.
4. A method of object motion detection as defined in claim 3, wherein the acquiring a histogram array of the image reference block comprises:
converting the image reference block from RGB color space to YUV format;
and acquiring a Y component value of each pixel in the image reference block under the YUV format, and counting the number of pixels corresponding to the Y component value of 0-255 in sequence to form a histogram array containing 256 statistic values.
5. The method for detecting motion of a target object according to claim 1, wherein the extracting a preset number of background images from the periphery of the first target object, and determining whether a second target object is included in the background images, wherein after the first target object and the second target object are preset movable objects, includes:
and if all the background images contain the second target object, determining that the first target object is in a static state.
6. The method for detecting motion of a target object according to claim 1, wherein after calculating the similarity of the image reference blocks at corresponding positions in the two adjacent frames of images and determining whether the similarity of the image reference blocks is greater than or equal to a preset threshold, the method comprises:
and if the similarity of the image reference blocks is greater than or equal to a preset threshold value, determining that the first target object is in a static state.
7. The method for detecting motion of a target object according to claim 1, wherein after determining that the first target object is in a motion state if the similarity corresponding to the at least one image reference block is smaller than a preset threshold value, the method comprises:
when the number of the first target objects in the motion state is determined to be one, controlling the camera to move so as to track the first target objects;
when the number of the first target objects in the motion state is determined to be a plurality of, controlling the camera to move according to the preset target object priority so as to track the first target object with the highest priority.
8. A target object motion detection apparatus, characterized by comprising:
the first acquisition module is configured to acquire two adjacent frames of images shot by the camera, wherein the two adjacent frames of images contain a first target object;
the second acquisition module is configured to extract a preset number of background images from the periphery of the first target object, and judge whether the background images contain a second target object or not, wherein the first target object and the second target object are preset movable objects;
the first determining module is configured to determine the background image as an image reference block if the background image does not contain the second target object;
the calculating module is configured to calculate the similarity of the image reference blocks at corresponding positions in the two adjacent frames of images and judge whether the similarity of the image reference blocks is larger than or equal to a preset threshold value;
and the second determining module is configured to determine that the first target object is in a motion state if the similarity corresponding to at least one image reference block is smaller than a preset threshold value.
9. A target object motion detection device, characterized in that it comprises a memory and a processor, the memory having stored therein a computer program which, when executed by the processor, implements the target object motion detection method according to any of claims 1-7.
10. A non-transitory computer readable storage medium, characterized in that the non-transitory computer readable storage medium stores thereon a computer program, which when executed by a processor, implements the target object motion detection method according to any of claims 1-7.
CN202311751770.5A 2023-12-18 2023-12-18 Target object motion detection method, device, equipment and storage medium Pending CN117765277A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311751770.5A CN117765277A (en) 2023-12-18 2023-12-18 Target object motion detection method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311751770.5A CN117765277A (en) 2023-12-18 2023-12-18 Target object motion detection method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117765277A true CN117765277A (en) 2024-03-26

Family

ID=90317462

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311751770.5A Pending CN117765277A (en) 2023-12-18 2023-12-18 Target object motion detection method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117765277A (en)

Similar Documents

Publication Publication Date Title
US11601674B2 (en) Encoding a privacy masked image
Park et al. Vise: Visual search engine using multiple networked cameras
KR101823537B1 (en) Method of identifying relevant areas in digital images, method of encoding digital images, and encoder system
US8305440B2 (en) Stationary object detection using multi-mode background modelling
EP2053844B1 (en) Image processing device, image processing method, and program
US20100104175A1 (en) Integrated image processor
CN108182421B (en) Video segmentation method and device
US10096117B2 (en) Video segmentation method
EP1839122A2 (en) Method and electronic device for detecting a graphical object
US8077982B2 (en) Image match-point detection apparatus, image match-point detection method and storage medium
EP1412921A2 (en) Detecting a cartoon in a video data stream
US20100054542A1 (en) Processing video frames with the same content but with luminance variations across frames
CN111179302B (en) Moving target detection method and device, storage medium and terminal equipment
US20210248757A1 (en) Method of detecting moving objects via a moving camera, and related processing system, device and computer-program product
Hu et al. Robust motion detection using histogram of oriented gradients for illumination variations
CN113744256A (en) Depth map hole filling method and device, server and readable storage medium
US20110085026A1 (en) Detection method and detection system of moving object
CN109543487B (en) Automatic induction triggering method and system based on bar code edge segmentation
CN117765277A (en) Target object motion detection method, device, equipment and storage medium
US7356193B2 (en) Detection of hanging wires in digital color images
Meuel et al. Superpixel-based segmentation of moving objects for low bitrate ROI coding systems
US20170134739A1 (en) Method and apparatus for controlling a degree of compression of a digital image
CN111160340A (en) Moving target detection method and device, storage medium and terminal equipment
CN112950559A (en) Method and device for detecting copied image, electronic equipment and storage medium
US20230058934A1 (en) Method for camera control, image signal processor and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination