Disclosure of Invention
The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
Embodiments of the present invention provide an information processing method and apparatus, a computer storage medium, and a terminal, which can improve the efficiency of analyzing the activity state of a target object.
An embodiment of the present invention provides an information processing method, including:
acquiring activity information of a target object in a video image;
and carrying out statistical analysis on the acquired activity information to obtain the activity state of the target object.
Optionally, the acquiring the activity information of the target object in the video image includes:
determining whether each frame of image contained in the video image contains the target object;
for each frame including the image of the target object, marking the target object according to a preset image identifier;
and recording the activity position of the target object and the activity time corresponding to the activity position frame by frame for each frame of image marked with the image identifier.
Optionally, before the obtaining of the activity information of the target object in the video image, the information processing method includes:
determining whether the video image is received or not according to a preset monitoring period;
wherein the video image comprises: when the video data acquired by the preset image acquisition device is longer than a first preset time length, the acquired video data is segmented to obtain a video clip with the first preset time length.
Optionally, the statistically analyzing the activity state of the target object includes:
setting one or more groups of activity state reference parameters;
according to the set activity state reference parameters of each group, carrying out statistical analysis on the acquired activity information to obtain the activity state corresponding to each activity state reference parameter;
wherein each set of said activity state reference parameters comprises the corresponding: an activity duration threshold and/or an activity area size threshold.
Optionally, before the obtaining of the activity information of the target object in the video image, the information processing method further includes:
within a second preset time length after the video image is received, comparing two adjacent frames of images frame by frame according to the time sequencing sequence of each frame of image contained in the video image;
when the pixel difference percentage of two adjacent frames of images is smaller than a preset first percentage threshold value, determining that the next frame of image is an initial image;
and performing coordinate modeling according to the determined initial image so as to record the activity position according to the coordinate modeling.
Optionally, the determining whether each frame of image contains the target object includes:
comparing the initial image with a subsequent adjacent image, and when the percentage of pixel difference between the initial image and the subsequent adjacent image is greater than a preset second percentage threshold, analyzing and confirming whether the subsequent adjacent image contains the target object; when the percentage of the pixel difference between the initial image and the subsequent adjacent image is smaller than a preset second percentage threshold value, determining a subsequent group of adjacent images by taking the subsequent adjacent images as the previous images according to the time sequencing order;
for the determined next group of adjacent images, when the percentage of the pixel difference of the adjacent images is greater than a preset second percentage threshold value, analyzing and confirming whether the next adjacent images contain the target object; and when the percentage of the pixel difference of the adjacent images is smaller than a preset second percentage threshold value, determining a next group of adjacent images by taking the next adjacent images as the previous images according to the time sequencing order so as to continuously confirm whether the target object is contained.
Optionally, the information processing method further includes:
and respectively counting the activity states corresponding to the reference parameters of the activity states to obtain the activity frequency corresponding to each activity state.
Optionally, the target object includes a rodent, and the obtaining of the activity state of the target object includes:
according to the acquired activity information, the activity duration of the rodents in the activity areas of all sizes is statistically analyzed;
and determining the activity state of the mouse in the activity areas of all sizes according to the statistical analysis result of the activity duration of the mouse in the activity areas of all sizes.
On the other hand, an embodiment of the present invention further provides an information processing apparatus, including: an acquisition unit and a statistical analysis unit; wherein,
the acquisition unit is used for: acquiring activity information of a target object in a video image;
the statistical analysis unit is used for: and statistically analyzing the acquired activity information to obtain the activity state of the target object.
Optionally, the obtaining unit is specifically configured to:
determining whether each frame of image contained in the video image contains the target object;
for each frame including the image of the target object, marking the target object according to a preset image identifier;
and recording the activity position of the target object and the activity time corresponding to the activity position frame by frame for each frame of image marked with the image identifier.
Optionally, the information processing apparatus further includes a monitoring unit, configured to: determining whether the video image is received or not according to a preset monitoring period;
wherein the video image comprises: when the video data acquired by the preset image acquisition device is longer than a first preset time length, the acquired video data is segmented to obtain a video clip with the first preset time length.
Optionally, the statistical analysis unit is specifically configured to:
setting one or more groups of activity state reference parameters;
according to the set activity state reference parameters of each group, carrying out statistical analysis on the acquired activity information to obtain the activity state corresponding to each activity state reference parameter;
wherein each set of said activity state reference parameters comprises the corresponding: an activity duration threshold and/or an activity area size threshold.
Optionally, the information processing apparatus further includes an initial image determining unit configured to:
within a second preset time length after the video image is received, comparing two adjacent frames of images frame by frame according to the time sequencing sequence of each frame of image contained in the video image;
when the pixel difference percentage of two adjacent frames of images is smaller than a preset first percentage threshold value, determining that the next frame of image is an initial image;
and performing coordinate modeling according to the determined initial image so as to record the activity position according to the coordinate modeling.
Optionally, the obtaining unit is configured to determine whether each frame of image contains the target object, and includes:
comparing the initial image with a subsequent adjacent image, and when the percentage of pixel difference between the initial image and the subsequent adjacent image is greater than a preset second percentage threshold, analyzing and confirming whether the subsequent adjacent image contains the target object; when the pixel difference percentage between the initial image and a subsequent adjacent image is smaller than a preset second percentage threshold value, determining a subsequent group of adjacent images by taking the subsequent adjacent image as a previous image according to the time sequencing order;
for the determined next group of adjacent images, when the percentage of the pixel difference of the adjacent images is larger than a preset second percentage threshold value, analyzing and confirming whether the next adjacent images contain the target object; and when the percentage of the pixel difference of the adjacent images is smaller than a preset second percentage threshold value, determining a next group of adjacent images by taking the next adjacent images as the previous images according to the time sequencing order so as to continuously confirm whether the target object is contained.
Optionally, the statistical analysis unit is further configured to:
and respectively counting the activity states corresponding to the reference parameters of the activity states to obtain the activity frequency corresponding to each activity state.
Optionally, the target object includes a mouse, and the statistical analysis unit is specifically configured to:
according to the acquired activity information, the activity duration of the rodents in the activity areas of all sizes is statistically analyzed;
and determining the activity state of the mouse in the activity areas of all sizes according to the statistical analysis result of the activity duration of the mouse in the activity areas of all sizes.
In another aspect, an embodiment of the present invention further provides a computer storage medium, where computer-executable instructions are stored in the computer storage medium, and the computer-executable instructions are used to execute the information processing method.
In another aspect, an embodiment of the present invention further provides a terminal, including: a memory and a processor; wherein,
the processor is configured to execute program instructions in the memory;
the program instructions read on the processor to perform the following operations:
acquiring activity information of a target object in a video image;
and carrying out statistical analysis on the acquired activity information to obtain the activity state of the target object.
Compared with the related art, the technical scheme of the application comprises the following steps: acquiring activity information of a target object in a video image; and statistically analyzing the acquired activity information to obtain the activity state of the target object. According to the embodiment of the invention, the activity information of the target object is acquired from the video image, so that the efficiency of analyzing the activity state of the target object is improved.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
The steps illustrated in the flow charts of the figures may be performed in a computer system such as a set of computer-executable instructions. Also, while a logical order is shown in the flow diagrams, in some cases, the steps shown or described may be performed in an order different than here.
Fig. 1 is a flowchart of an information processing method according to an embodiment of the present invention, as shown in fig. 1, including:
step 101, acquiring activity information of a target object in a video image;
optionally, the acquiring of the activity information of the target object in the video image according to the embodiment of the present invention includes:
determining whether each frame of image contained in the video image contains the target object;
marking the target object according to a preset image identifier for the image containing the target object in each frame;
and recording the activity position of the target object and the activity time corresponding to the activity position frame by frame for each frame of image marked with the image identifier.
It should be noted that, the method for identifying the target object may be performed by analyzing and determining feature data of the target object existing in the related art.
Optionally, before obtaining the activity information of the target object in the video image, the information processing method according to the embodiment of the present invention includes: determining whether the video image is received or not according to a preset monitoring period;
wherein the video image includes: when the video data acquired by the preset image acquisition device is longer than a first preset time length, the acquired video data is segmented to obtain a video clip with the first preset time length. Here, the first preset duration may be determined by analysis performed by a person skilled in the art according to the real-time requirement; for example, the first preset time period is set to 1 hour.
The monitoring period may be set with reference to a real-time requirement, and for example, the monitoring period is set to 30 seconds.
Optionally, before obtaining the activity information of the target object in the video image, the information processing method according to the embodiment of the present invention further includes:
within a second preset time length after the video image is received, comparing two adjacent frames of images frame by frame according to the time sequencing sequence of each frame of image contained in the video image;
when the pixel difference percentage of two adjacent frames of images is smaller than a preset first percentage threshold value, determining that the next frame of image is an initial image;
and performing coordinate modeling according to the determined initial image so as to record the activity position according to the coordinate modeling.
And 102, carrying out statistical analysis on the acquired activity information to obtain the activity state of the target object.
Optionally, in the embodiment of the present invention, the statistically analyzing the activity state of the target object includes:
setting one or more groups of activity state reference parameters;
according to the set activity state reference parameters of each group, performing statistical analysis on the acquired activity information to obtain the activity state corresponding to each activity state reference parameter;
wherein each set of the activity state reference parameters includes a corresponding: an activity duration threshold and/or an activity area size threshold.
Optionally, the determining whether each frame of image contains the target object according to the embodiment of the present invention includes:
comparing the initial image with a subsequent adjacent image, and when the percentage of pixel difference between the initial image and the subsequent adjacent image is greater than a preset second percentage threshold, analyzing and confirming whether the subsequent adjacent image contains the target object; when the pixel difference percentage between the initial image and a subsequent adjacent image is smaller than a preset second percentage threshold value, determining a subsequent group of adjacent images by taking the subsequent adjacent image as a previous image according to the time sequencing order;
for the determined next group of adjacent images, when the percentage of the pixel difference of the adjacent images is larger than a preset second percentage threshold value, analyzing and confirming whether the next adjacent images contain the target object; and when the percentage of the pixel difference of the adjacent images is smaller than a preset second percentage threshold value, determining a next group of adjacent images by taking the next adjacent images as the previous images according to the time sequencing order so as to continuously confirm whether the target object is contained.
Optionally, after obtaining the active state, the information processing method according to the embodiment of the present invention further includes:
and respectively counting the activity states corresponding to the reference parameters of the activity states to obtain the activity frequency corresponding to each activity state.
Optionally, the target object in the embodiment of the present invention includes a mouse, and obtaining the activity state includes:
according to the acquired activity information, the activity duration of the rodents in the activity areas of all sizes is statistically analyzed;
and determining the activity state of the mouse in the activity areas of all sizes according to the statistical analysis result of the activity duration of the mouse in the activity areas of all sizes.
The embodiment of the invention can be applied to the analysis of the activity states of other animals influencing the health of human life and property, and also can be applied to the livestock production process of other animals.
Compared with the related art, the technical scheme of the application comprises the following steps: acquiring activity information of a target object in a video image; and carrying out statistical analysis on the acquired activity information to obtain the activity state of the target object. According to the embodiment of the invention, the activity information of the target object is acquired from the video image, so that the efficiency of analyzing the activity state of the target object is improved.
Fig. 2 is a block diagram of an information processing apparatus according to an embodiment of the present invention, as shown in fig. 2, including: an acquisition unit and a statistical analysis unit; wherein,
the acquisition unit is used for: acquiring activity information of a target object in a video image;
optionally, the obtaining unit in the embodiment of the present invention is specifically configured to:
determining whether each frame of image contained in the video image contains the target object;
for each frame including the image of the target object, marking the target object according to a preset image identifier;
and recording the activity position of the target object and the activity time corresponding to the activity position frame by frame for each frame of image marked with the image identifier.
The statistical analysis unit is used for: and carrying out statistical analysis on the acquired activity information to obtain the activity state of the target object.
Optionally, the information processing apparatus according to the embodiment of the present invention further includes a monitoring unit, configured to: determining whether the video image is received or not according to a preset monitoring period;
wherein the video image comprises: when the video data acquired by the preset image acquisition device is longer than a first preset time length, the acquired video data is segmented to obtain a video clip with the first preset time length. The monitoring period may be set with reference to a real-time requirement, and for example, the monitoring period is set to 30 seconds.
Optionally, the statistical analysis unit in the embodiment of the present invention is specifically configured to:
setting one or more groups of activity state reference parameters;
according to the set activity state reference parameters of each group, performing statistical analysis on the acquired activity information to obtain the activity state corresponding to each activity state reference parameter;
wherein each set of said activity state reference parameters comprises the corresponding: an activity duration threshold and/or an activity area size threshold.
Optionally, the information processing apparatus in the embodiment of the present invention further includes an initial image determining unit, configured to:
within a second preset time length after the video image is received, comparing two adjacent frames of images frame by frame according to the time sequencing sequence of each frame of image contained in the video image;
when the pixel difference percentage of two adjacent frames of images is smaller than a preset first percentage threshold value, determining that the next frame of image is an initial image;
and performing coordinate modeling according to the determined initial image so as to record the activity position according to the coordinate modeling.
Optionally, the determining, by the obtaining unit in the embodiment of the present invention, whether each frame of image includes the target object includes:
comparing the initial image with a subsequent adjacent image, and when the percentage of pixel difference between the initial image and the subsequent adjacent image is greater than a preset second percentage threshold value, analyzing and confirming whether the subsequent adjacent image contains the target object; when the pixel difference percentage between the initial image and a subsequent adjacent image is smaller than a preset second percentage threshold value, determining a subsequent group of adjacent images by taking the subsequent adjacent image as a previous image according to the time sequencing order;
for the determined next group of adjacent images, when the percentage of the pixel difference of the adjacent images is greater than a preset second percentage threshold value, analyzing and confirming whether the next adjacent images contain the target object; and when the percentage of the pixel difference of the adjacent images is smaller than a preset second percentage threshold value, determining a next group of adjacent images by taking the next adjacent images as the previous images according to the time sequencing order so as to continuously confirm whether the target object is contained.
Optionally, the statistical analysis unit in the embodiment of the present invention is further configured to:
and respectively counting the activity states corresponding to the reference parameters of the activity states to obtain the activity frequency corresponding to each activity state.
Optionally, in the embodiment of the present invention, the target object includes a mouse, and the statistical analysis unit is specifically configured to:
according to the obtained activity information, the activity duration of the rodents in the activity areas of various sizes is statistically analyzed;
and determining the activity state of the mouse in the activity areas of all sizes according to the statistical analysis result of the activity duration of the mouse in the activity areas of all sizes.
The embodiment of the invention also provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used for executing the information processing method.
An embodiment of the present invention further provides a terminal, including: a memory and a processor; wherein,
the processor is configured to execute program instructions in the memory;
the program instructions read on the processor to perform the following operations:
acquiring activity information of a target object in a video image;
and carrying out statistical analysis on the acquired activity information to obtain the activity state of the target object.
The method of the embodiment of the present invention is described in detail below by using application examples, which are only used for illustrating the present invention and are not used for limiting the protection scope of the present invention.
Application examples
The application example is described by taking a camera installed indoors as an example, and when the camera acquires video data, the acquired video data is divided by taking one hour as unit duration to obtain a video image processed by the application example. The video images obtained by cutting can be stored according to a preset storage path. In the application example, the video image can be processed in an encryption mode, a compression mode and the like and then transmitted, and the video image can be backed up and recorded according to the related technology.
After the application example cuts and obtains video data, the video data obtained by cutting are sent to a server or a device for analyzing the activity information of the target object; the server or the device for analyzing the target object activity information determines whether the video image is received according to a preset monitoring period and a preset monitoring period; here, the monitoring period may be set according to a real-time requirement for performing the activity information analysis; for example, 30 seconds can be set, and the occupation of bandwidth resources does not need to be considered because the information amount is small;
table 1 shows how to store the video image recording information, and as shown in table 1, the file number, the storage path, the start time, and the end time of the video image are recorded, and the transmission status of whether to transmit the video image to a server or a device that performs the target object activity information analysis is included.
File numbering
|
Storage path
|
Starting time
|
End time
|
Sending status
|
207
|
/data/207.avi
|
2017-12-26 05:00:00
|
2017-12-26 05:59:59
|
Has been processed
|
208
|
/data/208.avi
|
2017-12-26 06:00:00
|
2017-12-26 06:59:59
|
Untreated |
TABLE 1
Within a second preset time length after the video image is received, comparing two adjacent frames of images frame by frame according to the time sequencing sequence of each frame of image contained in the video image; here, the second preset duration may be determined based on the calculation and analysis speed, and it is required to ensure that the subsequently transmitted video image can be processed in time, and meanwhile, the video image is processed in time, so that the activity information of the target object can be obtained in real time.
In this application example, it may also be determined whether the processing of the activity information of the target object is completed according to the processing state, and table 2 is an example of performing the operation state analysis in this application example, as shown in table 1, the method includes: file number, time for entering an operation queue, operation starting time, operation ending time and operation state;
TABLE 2
When the pixel difference percentage of two adjacent frames of images is smaller than a preset first percentage threshold value, determining that the next frame of image is an initial image;
and carrying out coordinate modeling according to the determined initial image so as to record the activity position according to the coordinate modeling.
After determining an initial image and carrying out coordinate modeling, identifying and determining whether each frame of image contains a target object; the present application example determines whether each frame image contains a target object includes:
comparing the initial image with a subsequent adjacent image, and when the percentage of pixel difference between the initial image and the subsequent adjacent image is greater than a preset second percentage threshold, analyzing and confirming whether the subsequent adjacent image contains the target object; when the pixel difference percentage between the initial image and the subsequent adjacent image is smaller than a preset second percentage threshold value, determining a subsequent group of adjacent images by taking the subsequent adjacent images as the previous images according to the time sequencing order;
for the determined next group of adjacent images, when the percentage of the pixel difference of the adjacent images is larger than a preset second percentage threshold value, analyzing and confirming whether the next adjacent images contain the target object; and when the percentage of the pixel difference of the adjacent images is smaller than a preset second percentage threshold value, determining a next group of adjacent images by taking the next adjacent images as the previous images according to the time sorting sequence so as to continuously confirm whether the target object is contained.
The present application example does not analyze the image frame with less change by the percentage of the pixel difference, that is, filters the image frame with less information amount by the percentage of the pixel difference;
after the target object is identified, the application example marks the target object according to a preset image identifier for each frame of image containing the target object;
and recording the activity position of the target object and the activity time corresponding to the activity position frame by frame for each frame of image marked with the image identification.
Table 3 is an illustration of activity information recording performed by the present application example, and as shown in table 3, the activity information recording includes: coordinate numbers, file numbers, activity time and coordinates of activity positions; wherein, the coordinate label can be a number which is set according to the position set by the camera and analyzed by the person skilled in the art.
Coordinate numbering
|
File numbering
|
Time of activity
|
Active position
|
102
|
207
|
2017-12-26 05:02:24
|
728,730,758,760
|
102
|
207
|
2017-12-26 05:02:25
|
748,736,770,758
|
102
|
207
|
2017-12-26 05:02:26
|
768,732,788,762
|
102
|
207
|
2017-12-26 05:02:27
|
750,716,774,738
|
102
|
207
|
2017-12-26 05:02:28
|
776,768,796,704
|
102
|
207
|
2017-12-26 05:02:29
|
796,656,822,690
|
102
|
207
|
2017-12-26 05:02:30
|
820,632,844,668
|
102
|
207
|
2017-12-26 05:02:31
|
816,608,842,626
|
102
|
207
|
2017-12-26 05:02:32
|
820,600,848,622
|
102
|
207
|
2017-12-26 05:02:33
|
820,582,856,616
|
102
|
207
|
2017-12-26 05:02:34
|
830,562,858,592
|
102
|
207
|
2017-12-26 05:02:35
|
868,554,898,584
|
102
|
207
|
2017-12-26 05:02:36
|
916,550,940,586 |
TABLE 3
After the activity time of the target object is recorded and obtained, the embodiment of the invention statistically analyzes the activity state of the target object; specifically, the method may include: setting one or more groups of activity state reference parameters;
according to the set activity state reference parameters of each group, carrying out statistical analysis on the acquired activity information to obtain the activity state corresponding to each activity state reference parameter;
wherein each set of said activity state reference parameters comprises the corresponding: an activity duration threshold and/or an activity area size threshold.
In this application example, the active region of the target object includes:
after a target object appears in an image frame, marking the target object through a preset image identifier, recording the activity position of the target object and the activity time corresponding to the activity position frame by frame according to time sequence, and then determining the activity area of the target object according to the activity position corresponding to each activity time;
in this application example, it is assumed that two sets of active state reference parameters are set, including: a first activity duration threshold and a first activity zone size threshold; a second activity duration threshold and a second activity region size threshold; determining the activity state of the target object may comprise:
when the current activity area of the target object is smaller than the first activity area size threshold within the set first activity duration threshold, determining that the target object is in a first activity state in the current activity area;
when the current activity area of the target object is smaller than the second activity area size threshold within the set second activity duration threshold, determining that the target object is in a second activity state in the current activity area;
it should be noted that the size threshold of the active area needs to be analyzed, determined and adjusted based on the installation position of the camera and the activity degree and volume of the target object; the first activity duration threshold may be analytically determined based on an activity region size threshold based on a daily activity state of the target object.
For example, assume a pixel region with a first activity duration threshold of 5 seconds and a first activity region size threshold of 3 by 3 for a rodent; a pixel region having a second activity duration threshold of 10 seconds and a second activity region size threshold of 10 by 10; if it is determined, based on the relevant data, that the rodent is in the gnawing state in the current activity area when the first set of activity state reference parameters are satisfied, and the rodent is in the hot spot activity state in the current activity area when the second set of activity state reference parameters are satisfied, determining the activity state of the rodent may include:
when the current activity area of the rodent is smaller than a pixel area of 3 by 3 within 5 seconds, determining that the rodent is in a gnawing state in the current activity area;
and when the current activity area of the mouse is smaller than the pixel area of 10 times 10 within 10 seconds, determining that the mouse is in a hot spot activity state in the current activity area.
Based on the activity information in table 3, the present application example can insert the determination result of the activity status in table 3 to form the content in table 4, and in table 4, the gnawing status and the hot spot activity status are exemplified as the activity status:
TABLE 4
In the present application example, frequency statistics may be performed based on the activity areas and the activity states corresponding to the activity areas; and after the frequency statistics is completed, the frequency statistics can be marked and displayed in the image. The application example can also set reference parameters for judging the activity state of the rodent, such as the lingering activity, the crawling track and the like, and the rodent and the like can be more accurately analyzed through the parameter setting.
The application example can also be combined with the state of the mouse activity site to adjust the activity state reference parameters;
based on the mouse example description, the method can be applied to food storage areas such as fresh supermarkets and kitchens, and the monitoring analysis of the mouse activity and the subsequent treatment for preventing and controlling the mouse damage are realized through the activity state analysis; the damage of the rodent gnawing activity to the apparatus and the pollution of food materials are avoided.
The application example can timely realize the activity state analysis of the target object, and control processing including prevention, control, driving and the like can be carried out on the target object based on the activity state analysis.
The embodiment of the invention can be applied to the analysis of the activity states of other animals influencing the health of human life and property, and the activity state of the target object can be determined in time through the timely analysis of the activity state of the target object, so that the control processing of the target object is realized efficiently.
It will be understood by those skilled in the art that all or part of the steps of the above methods may be implemented by a program instructing associated hardware (e.g., a processor) to perform the steps, and the program may be stored in a computer readable storage medium, such as a read only memory, a magnetic or optical disk, and the like. Alternatively, all or part of the steps of the above embodiments may also be implemented using one or more integrated circuits. Accordingly, each module/unit in the above embodiments may be implemented in hardware, for example, by an integrated circuit to implement its corresponding function, or in software, for example, by a processor executing a program/instruction stored in a memory to implement its corresponding function. The present invention is not limited to any specific form of combination of hardware and software.
Although the embodiments of the present invention have been described above, the above description is only for the purpose of understanding the present invention, and is not intended to limit the present invention. It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.