Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
An example of the invention may be performed by a monitoring device that may include a front-end portion, a transmission portion, and a back-end portion, the front-end portion: the device mainly comprises a camera, a sensor, a lens, a holder, a protective cover, a bracket, a decoder and the like, and is mainly used for shooting videos, audios or images and the like; a transmission part: cables and wires are used for transmitting video, audio or control signals in an overhead, underground or wall-mounted mode; a rear end portion: the video processing system is mainly used for processing videos or images by a picture divider, a monitor, a control device, a video storage device and the like.
The embodiment of the invention can be applied to security video monitoring scenes to analyze the video data of the scenes to judge whether target objects break into the scenes, wherein the security video monitoring scenes comprise video monitoring scenes of residential districts, video monitoring scenes of military areas or video monitoring scenes of shopping mall warehouses and the like, and the target objects comprise strange persons or animals and the like. Specifically, in order to monitor the monitored area, the shooting device of the monitoring device may shoot the monitored area to obtain video data of the monitored area. Screening a target frame image from video data of a monitored area according to a preset screening rule, obtaining a reference image of the monitored area, wherein the reference image is an image in which a target object does not break into the monitored area, comparing the characteristic information of the target frame image with the characteristic information of the reference image to obtain the matching degree between the target frame image and the reference image, and when the matching degree between the target frame image and the reference image is smaller than a preset threshold value, indicating that the difference between the target frame image and the reference image is large, and determining that the target object breaks into the monitored area. Whether a target object intrudes into the target area can be automatically identified by identifying the target frame image in the video data of the target area, so that labor resources are saved, the image identification efficiency is improved, the automatic and intelligent requirements of a user on video monitoring are met, and the safety of the user can be effectively ensured; in addition, by screening the video data of the target area, only part of frame images in the video data need to be identified, and all images in the video data do not need to be identified, so that the image identification efficiency is further improved.
Fig. 1 is a schematic flow chart of an image processing method based on image recognition according to an embodiment of the present invention, which can be executed by the above-mentioned monitoring device. In this embodiment, the image processing method based on image recognition includes the following steps.
S101, shooting a target area through a shooting device to obtain target video data of the target area.
In the embodiment of the invention, in the target area into which the intrusion of target objects such as strange people or animals is forbidden, the target area can be shot by the shooting device for the personal safety and the property safety of a user so as to obtain the target video data of the target area. The shooting device can be a panoramic shooting device or a hemispherical shooting device and the like, and the target area can be an entrance area of a residential quarter, an area where a garage or a warehouse of a shopping mall is located, a military area and the like.
In one embodiment, when a sensor in the monitoring device detects that a person or an animal or the like intrudes into the monitoring area, a shooting device of the monitoring device is triggered to shoot the monitoring area to obtain video data of the monitoring area, for example, the sensor transmits an infrared spectrum and receives a reflected infrared spectrum, a time interval between the transmitted infrared spectrum and the reflected infrared spectrum is calculated, when the time interval is lower than a preset time threshold, it is determined that the person or the animal intrudes into the target area, and the shooting device of the monitoring device is triggered to shoot the monitoring area to obtain the video data of the monitoring area.
In another embodiment, in order to reduce the pressure of the monitoring device on processing image data, the monitoring device may monitor a target area in a certain time period, specifically, a shooting time period is set for the shooting device, and when the time is within the shooting time period of the shooting device, the shooting device of the monitoring device is triggered to shoot the monitored area to obtain video data of the monitored area, the shooting time period may be set according to a time rule that the target area history intrudes into the target object, the shooting time period may be a time period in which the frequency of the target area history intruding into the target object is greater than a preset frequency, for example, the shooting time period is 6:00 to 12:00 at night.
S102, screening a target frame image from the target video data according to a preset screening rule, and acquiring a reference image of a target area, wherein the reference image is an image shot when no target object intrudes into the target area.
In the embodiment of the invention, in order to improve the efficiency of image recognition, the monitoring device may screen a target frame image from target video data according to a preset screening rule, and acquire a reference image, where the reference image may be acquired from a target video or acquired according to historical video data of a target area, and the reference image is an image shot when no target object intrudes into the target area.
S103, comparing the characteristic information of the target frame image with the characteristic information of the reference image to obtain the matching degree of the target frame image and the reference image.
In the embodiment of the present invention, the monitoring device may take the target frame image and the reference image as a whole, obtain feature information of the target frame image and feature information of the reference image, where the feature information may refer to at least one of a Histogram of Oriented Gradient (HOG), Scale-invariant feature transform (SIFT), or Color Histogram, and compare the feature information of the target frame image with the feature information of the reference image to obtain a matching degree between the target frame image and the reference image; or dividing the target frame image and the reference image into a plurality of sub-images, respectively obtaining the characteristic information of each sub-image, and determining the matching degree between the target frame image and the reference image according to the characteristic information of each sub-image. The greater the matching degree is, the greater the similarity between the target frame image and the reference image is, that is, the smaller the difference between the target frame image and the reference image is; conversely, the smaller the matching degree is, the smaller the similarity between the target frame image and the reference image is, that is, the greater the difference between the target frame image and the reference image is.
In an embodiment, in order to improve the efficiency of obtaining the matching degree between the target frame image and the reference image, part of feature information of the target frame image may be compared with part of feature information of the reference image to obtain the matching degree between the target frame image and the reference image, specifically, the feature information of the target frame image is sampled according to a preset sampling frequency, the feature information of the reference image is sampled according to the preset sampling frequency, and the feature information of a sampling point of the target frame image is compared with the feature information of a corresponding sampling point of the reference image to obtain the matching degree between the target frame image and the reference image.
In another embodiment, in order to improve the accuracy of obtaining the matching degree between the target frame image and the reference image, all the feature information of the target frame image may be compared with the corresponding feature information of the reference image to obtain the matching degree between the target frame image and the reference image.
It should be noted that, in order to improve the accuracy and flexibility of obtaining the matching degree between the target frame image and the reference image, the monitoring device may dynamically select a comparison policy of the feature information according to the stability of the target region, where the comparison policy includes all comparisons and partial comparisons, specifically, when it is detected that the stability of the target region is greater than or equal to a preset stability value, it indicates that the target region itself does not change much, for example, a background (an inherent object of the target region such as illumination and weather) changes slowly, and the probability of the target object intruding is small, and a part of the feature information may be selected as the policy, that is, a part of the feature information of the target frame image is compared with a part of the feature information of the reference image, so as to improve the matching degree between the target frame image and the reference image; when the stability of the target region is detected to be smaller than the preset stability value, it is indicated that the target region changes greatly, for example, the background changes quickly, and the probability of intrusion of the target object is high, all the feature information can be selected as this policy, that is, all the feature information of the target frame image is compared with all the feature information of the reference image, so as to obtain the matching degree between the target frame image and the reference image. The comparison strategy of the characteristic information can be manually selected by the user according to personal requirements.
And S104, when the matching degree of the target frame image and the reference image is smaller than a preset threshold value, determining that a target object intrudes into the target area.
In the embodiment of the invention, when the matching degree between the target frame image and the reference image is greater than or equal to the preset threshold value, the difference between the target frame image and the reference image is smaller, and the target object does not break into the target area; when the matching degree between the target frame image and the reference image is smaller than a preset threshold value, the difference between the target frame image and the reference image is larger, and the target object intrusion in the target area is determined. For the purpose of accurately identifying the target object, the preset threshold may be set to a difference between the background of the target area and the target object, for example, when the feature (e.g., color) of the target object is close to the background content (e.g., color of the background) of the target area, the preset threshold is set to a smaller value, and when the difference between the feature (e.g., color) of the target object and the background content (e.g., color of the background) of the target area is larger, the preset threshold is set to a larger value. .
In one example, in order to ensure the personal safety and property safety of the user, when the matching degree between the target frame image and the reference image is smaller than a preset threshold, the monitoring device may output prompt information, where the prompt information is used to prompt that a target object intrudes into the target area, and the prompt information may be output in the form of voice, or flashing warning light, vibration monitoring device, or the like.
In one embodiment, in order to timely notify a manager of timely processing an event that a target area breaks into a target object, when the matching degree of a target frame image and a reference image is smaller than a preset threshold, contact information of the manager is acquired, the target frame image is sent to a device bound with the contact information of the manager through the contact information, and the contact information includes an instant messaging account number of the manager, such as a telephone number, a WeChat account number or a QQ account number.
In the embodiment of the invention, whether a target object intrudes into the target area can be automatically identified by identifying the target frame image in the video data of the target area, so that labor resources are saved, the image identification efficiency is improved, the automatic and intelligent requirements of a user on video monitoring are met, and the safety of the user can be effectively ensured; in addition, by screening the video data of the target area, only part of frame images in the video data need to be identified, and all images in the video data do not need to be identified, so that the image identification efficiency is further improved.
Fig. 2 is a schematic flow chart of another image processing method based on image recognition according to an embodiment of the present invention, where the method according to the embodiment of the present invention can be executed by the above-mentioned monitoring device. In this embodiment, the image processing method based on image recognition includes the following steps.
S201, shooting a target area through a shooting device to obtain target video data of the target area.
In one embodiment, temperature information of a target area is acquired through a sensor, and when the temperature information of the target area indicates that a temperature value of the target area is greater than a preset temperature value, a step of shooting the target area through a shooting device to obtain target video data of the target area is executed; or receiving a shooting instruction aiming at the target area, and executing the step of shooting the target area by the shooting device to obtain target video data of the target area.
In order to reduce the pressure of processing image data by monitoring equipment, the monitoring equipment can trigger a shooting device to shoot a video according to parameters in a target area, specifically, temperature information of the target area is obtained through a sensor, when the temperature information of the target area indicates that the temperature value of the target area is greater than a preset temperature value, an object with temperature in the target area breaks into the target area, the object can be a person or an animal, in order to avoid that the broken-into object is a strange person or an animal, the shooting device of the monitoring equipment is triggered to shoot the monitoring area, and video data of the monitoring area are obtained.
Or, the user may trigger the shooting device to shoot, specifically, receive a shooting instruction sent by the user, and trigger the shooting device of the monitoring device to shoot the monitored area, so as to obtain video data of the monitored area, and the user may send the shooting instruction to the shooting device through touch (such as pressing a key, sliding, or clicking) or voice.
S202, screening a target frame image from the target video data according to a preset screening rule, and acquiring a reference image of a target area, wherein the reference image is an image shot when no target object intrudes into the target area.
In one example, the preset filtering rule includes a filtering rule according to a scene change parameter, and the step S202 includes the following steps S11 to S12.
And S11, acquiring a scene change parameter of the target area according to the historical video data of the target area, wherein the scene change parameter is used for indicating the stability of the target area.
S12, acquiring a reference image of the target area according to the scene change parameters of the target area, and screening the target frame image from the target video according to the scene change parameters of the target area.
In steps S11 to S12, the monitoring device may obtain the reference image and the target frame image according to the scene change parameter of the target area, and specifically, the monitoring device may obtain historical data of the target area within a preset time period, obtain the scene change parameter of the target area according to the historical data, obtain the reference image according to the scene change parameter of the target area, and screen the target frame image from the target video data according to the scene change parameter.
In the same time period, the scene change parameters of the target area have greater similarity, so that the monitoring device can acquire the current time, acquire historical video data of the target area corresponding to the current time, and determine the scene change parameters of the target area according to the historical video data of the target area corresponding to the current time. For example, when the current time is 6:00 nighttime, the monitoring device may acquire historical video data of the target area in a time period of 6:00 to 12:00 nighttime, and acquire the scene change parameter of the target area according to the historical video data of the target area in the time period of 6:00 to 12:00 nighttime.
In one embodiment, step S12 includes: when the scene change parameters indicate that the stability of the target area is greater than or equal to a preset stability value, acquiring multi-frame images without target objects in historical video data of the target area; and averaging the pixel information of the multiple frames of images to obtain a reference image of the target area, selecting images from the target video according to a first preset time interval, and taking the selected images as target frame images one frame at a time.
When the scene change parameter indicates that the stability of the target area is greater than or equal to a preset stable value, which indicates that the target area has small change, such as slow background change and low probability of intrusion of the target object, and the moving speed of the target object intruding into the target area is lower than the preset speed, the reference image can be obtained according to the historical video data, the monitoring device can obtain multi-frame images of the target object in the historical video data of the target area, average the pixel information of the multi-frame images to obtain the reference image of the target area, select an image from the target video according to a first preset time interval, and take the selected image as a target frame image every time, the first preset time interval can be set according to the time rule that the target area intrudes into the target object, such as high probability of intrusion into the target object at the later time, the first preset time interval may be set to a small value, the probability of intruding into the target object during the working period (e.g., 9:00 to 17:00 as early as the morning) is small, and the first preset time interval may be set to a large value.
In another embodiment, step S12 includes: when the scene change parameter indicates that the stability of the target area is smaller than a preset stability value, selecting images from the target video according to a second preset time interval, and selecting two frames of images each time; and taking a first frame image of the two frame images as a reference image of the target area, and taking a second frame image of the two frame images as the target frame image, wherein the shooting time of the first frame image is earlier than that of the second frame image.
When the scene change parameter indicates that the stability of the target area is smaller than a preset stable value, the target area changes greatly, for example, the background changes quickly, the probability of intrusion of a target object is high, the moving speed of the target object in the target area is higher than a preset speed, and then the historical video data cannot reflect the characteristics of the target area, so that a reference image can be obtained from the currently shot target video, the monitoring equipment can obtain multi-frame images of the target object which do not exist in the historical video data of the target area, select images from the target video according to a second preset time interval, and select two frames of images each time; and taking a first frame image of the two frame images as a reference image of the target area, and taking a second frame image of the two frame images as a target frame image, wherein the shooting time of the first frame image is earlier than that of the second frame image.
In one embodiment, the scene change parameter includes at least one of a background change rate of the target area, a probability of intrusion of the target object, and a moving speed of the target object in the target area, and the scene change parameter indicating that the stability of the target area is greater than or equal to a preset stability value may refer to: the background change rate of the target area is less than or equal to a preset change rate, and/or the probability of intrusion of the target object is less than or equal to a preset probability value, and/or the moving speed of the target object in the target area is less than or equal to a preset speed value; the scene change parameter indicating that the stability of the target region is smaller than the preset stability value may be: the background change rate of the target area is greater than a preset change rate, and/or the probability of intrusion of the target object is greater than a preset probability value, and/or the moving speed of the target object in the target area is greater than a preset speed value.
S203, comparing the characteristic information of the target frame image with the characteristic information of the reference image to obtain the matching degree of the target frame image and the reference image.
In one example, the target frame image and the reference image are divided into a plurality of sub-images according to a preset division rule, feature information of each sub-image in the target frame image and feature information of each sub-image in the reference image are obtained, the feature information of each sub-image in the target frame image is compared with the feature information of the corresponding sub-image in the reference image to obtain a matching degree between each sub-image in the target frame image and the corresponding sub-image in the reference image, and the determined matching degrees are subjected to weighted summation to obtain the matching degree between the target frame image and the reference image.
In order to improve the accuracy of obtaining the matching degree between the target frame image and the reference image, the monitoring device may divide the target frame image and the reference image into a plurality of sub-images according to a preset division rule, where the preset division rule includes a horizontal division rule and/or a vertical division rule and/or an oblique division rule, and obtain feature information of each sub-image in the target frame image and feature information of each sub-image in the reference image, compare the feature information of each sub-image in the target frame image with the feature information of a corresponding sub-image in the reference image to obtain the matching degree between each sub-image in the target frame image and a corresponding sub-image in the reference image, set a weight for each sub-image in the target frame image, where the weight of the sub-image is used to reflect the degree of influence of the sub-image on the matching degree between the target frame image and the reference image, and carrying out weighted summation on the determined matching degree according to the weight of each sub-image to obtain the matching degree between the target frame image and the reference image.
The above-mentioned method includes, for each sub-picture in the target frame image: the weight of each sub-graph is set according to the probability of the target object appearing in the indicated region in the sub-graph, for example, if the indicated region in the sub-graph is the fence region of the cell, the probability of the target object appearing in the region is smaller, the weight of the sub-graph can be set to a smaller value, if the indicated region in the sub-graph is the entrance region of the cell, the probability of the target object appearing in the region is larger, and the weight of the sub-graph can be set to a larger value.
Or a weight is set for each subgraph of the target frame image through a logistic regression classifier, and the logistic regression classifier sets the weight of each subgraph through the change characteristics (namely, the stability) of the region where the subgraph is located, specifically, a smaller weight is set for the subgraph with fixed change characteristics (namely, the stability of the region indicated by the subgraph is greater than or equal to the preset stability), and a larger weight is set for the subgraph without fixed change characteristics (namely, the stability of the region indicated by the subgraph is less than the preset stability). Example (c): the area where the subgraph refers is the area where the traffic signal lamp at the intersection is located, the traffic signal lamp has a fixed change characteristic, and the subgraph can be set to have a smaller weight; the area where the sub-graph refers is the area where the zebra crossing of the intersection is located, the pedestrian volume of the area where the zebra crossing is located does not usually have fixed characteristics, and the sub-graph can be set to be high in weight.
In one embodiment, in order to improve the accuracy of obtaining the matching degree between the target frame image and the reference image and improve the efficiency of obtaining the matching degree between the target frame image and the reference image, the monitoring device may divide the target frame image and the reference image into a plurality of sub-images according to a preset division rule, the preset division rule includes a horizontal division rule and/or a vertical division rule and/or an oblique division rule, and obtains the feature information of each sub-image in the target frame image and the feature information of each sub-image in the reference image, compare the feature information of each sub-image in the target frame image with the feature information of the corresponding sub-image in the reference image to obtain the matching degree between each sub-image in the target frame image and the corresponding sub-image in the reference image, and count the number of sub-images with the matching degree smaller than a preset value, and determining the matching degree between the target frame image and the reference image according to the number of the sub images. For example, when the number of the sub-images is smaller than a preset number threshold, determining that the matching degree between the target frame image and the reference image is smaller than a preset threshold; and when the number of the sub images is larger than or equal to a preset number threshold, determining that the matching degree between the target frame image and the reference image is larger than or equal to a preset threshold.
And S204, when the matching degree of the target frame image and the reference image is smaller than a preset threshold value, determining that a target object intrudes into the target area.
S205, acquiring a training image matched with the target frame image from a database.
S206, acquiring object information in the training images from a database, wherein the database comprises a plurality of training images and the object information in each training image.
And S207, taking the object information in the training image as the object information of the target object of the target frame image, and outputting the object information of the target object.
In steps S204 to S207, when it is determined that a target object intrudes into the target area, the monitoring device may obtain object information of the target object (i.e., a tag of the target object), so that a user may take corresponding measures in time, and harm to the user caused by the target object is reduced. Specifically, a training image matching the target frame image is obtained from the database, for example, a training image identical to the target frame image or a training image having a similarity greater than a preset similarity value with the target frame image is obtained, object information in the training image is obtained from the database, the object information in the training image is used as object information of the target object of the target frame image, and the object information of the target object is output. When the target object is a person, the object information of the target object comprises the identity information of the target object, and/or the contra-recording information of the target object, and the like, and the identity information of the target object comprises a name, a native place, an age, and the like; when the target object is an animal, the object information of the target object includes a name, a category, and the like.
In the embodiment of the invention, whether a target object intrudes into the target area can be automatically identified by identifying the target frame image in the video data of the target area, so that labor resources are saved, the image identification efficiency is improved, the automatic and intelligent requirements of a user on video monitoring are met, and the safety of the user can be effectively ensured; in addition, by screening the video data of the target area, only part of frame images in the video data need to be identified, and all images in the video data do not need to be identified, so that the image identification efficiency is further improved.
Fig. 3 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present invention, where the apparatus according to an embodiment of the present invention may be disposed in the above-mentioned monitoring device. In this embodiment, the apparatus includes:
a shooting module 301, configured to shoot a target area through a shooting device to obtain target video data of the target area.
The screening module 302 is configured to screen a target frame image from the target video data according to a preset screening rule, and acquire a reference image of the target area, where the reference image is an image captured when no target object intrudes into the target area.
A comparing module 303, configured to compare the feature information of the target frame image with the feature information of the reference image, so as to obtain a matching degree between the target frame image and the reference image.
A determining module 304, configured to determine that the target object intrudes into the target area when the matching degree between the target frame image and the reference image is smaller than a preset threshold.
Optionally, the shooting module 301 is specifically configured to acquire temperature information of the target area through a sensor; when the temperature information of the target area indicates that the temperature value of the target area is greater than a preset temperature value, the step of shooting the target area through a shooting device to obtain target video data of the target area is executed; or receiving a shooting instruction aiming at the target area, and executing the step of shooting the target area by the shooting device to obtain target video data of the target area.
Optionally, the preset screening rule includes a screening rule according to a scene change parameter; a screening module 302, configured to obtain a scene change parameter of the target area according to historical video data of the target area, where the scene change parameter is used to indicate a stability of the target area; and acquiring a reference image of the target area according to the scene change parameters of the target area, and screening the target frame image from the target video according to the scene change parameters of the target area.
Optionally, the screening module 302 is specifically configured to, when the scene change parameter indicates that the stability of the target region is greater than or equal to a preset stability value, obtain a multi-frame image in which the target object does not exist in the historical video data of the target region; carrying out averaging processing on the pixel information of the multi-frame image to obtain a reference image of the target area; and selecting images from the target video according to a first preset time interval, and taking the selected images as the target frame images one frame at a time.
Optionally, the screening module 302 is specifically configured to select an image from the target video according to a second preset time interval when the scene change parameter indicates that the stability of the target region is smaller than a preset stability value, and select two frames of images each time; and taking a first frame image of the two frame images as a reference image of the target area, and taking a second frame image of the two frame images as the target frame image, wherein the shooting time of the first frame image is earlier than that of the second frame image.
Optionally, the comparison module 303 is specifically configured to divide the target frame image and the reference image into a plurality of sub-images according to a preset division rule; acquiring the characteristic information of each sub-image in the target frame image and the characteristic information of each sub-image in the reference image; comparing the characteristic information of each sub-image in the target frame image with the characteristic information of the corresponding sub-image in the reference image to obtain the matching degree between each sub-image in the target frame image and the corresponding sub-image in the reference image; and carrying out weighted summation on the determined matching degree to obtain the matching degree between the target frame image and the reference image.
Optionally, the obtaining module 305 is configured to obtain a training image matched with the target frame image from a database, and obtain object information in the training image from the database, where the database includes multiple training images and object information in each training image.
Optionally, the output module 306 is configured to use the object information in the training image as the object information of the target object in the target frame image; and outputting the object information of the target object.
In the embodiment of the invention, whether a target object intrudes into the target area can be automatically identified by identifying the target frame image in the video data of the target area, so that labor resources are saved, the image identification efficiency is improved, the automatic and intelligent requirements of a user on video monitoring are met, and the safety of the user can be effectively ensured; in addition, by screening the video data of the target area, only part of frame images in the video data need to be identified, and all images in the video data do not need to be identified, so that the image identification efficiency is further improved.
Referring to fig. 4, a schematic structural diagram of a monitoring device according to an embodiment of the present invention is shown, where the monitoring device according to the embodiment of the present invention includes: one or more processors 401; one or more input devices 402, one or more output devices 403, and memory 404. The processor 401, the input device 402, the output device 403, and the memory 404 are connected by a bus 405.
The Processor 401 may be a Central Processing Unit (CPU), and may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The input device 402 may include a touch pad, a fingerprint sensor (for collecting fingerprint information of a user and direction information of a fingerprint), a temperature sensor (for acquiring temperature information of a target area), a photographing device (for acquiring video data of a target area), a microphone, etc., the output device 403 may include a display (LCD, etc.), a speaker, etc., and the output device 403 may output object information of a target object.
The memory 404 may include a read-only memory and a random access memory, and provides instructions and data to the processor 401. A portion of the memory 404 may also include a non-volatile random access memory, the memory 404 for storing a computer program comprising program instructions, the processor 401 for executing the program instructions stored by the memory 404 for performing an image processing method based on image recognition, i.e. for performing the following operations:
shooting a target area through a shooting device to obtain target video data of the target area;
screening a target frame image from the target video data according to a preset screening rule, and acquiring a reference image of the target area, wherein the reference image is an image shot when no target object intrudes into the target area;
comparing the characteristic information of the target frame image with the characteristic information of the reference image to obtain the matching degree between the target frame image and the reference image;
and when the matching degree of the target frame image and the reference image is smaller than a preset threshold value, determining that the target object intrudes into the target area.
Optionally, the processor 401 is configured to execute the program instructions stored in the memory 404, and is configured to perform the following operations:
acquiring temperature information of the target area through a sensor; when the temperature information of the target area indicates that the temperature value of the target area is greater than a preset temperature value, the step of shooting the target area through a shooting device to obtain target video data of the target area is executed; or,
and receiving a shooting instruction aiming at the target area, and executing the step of shooting the target area through a shooting device to obtain target video data of the target area.
Optionally, the processor 401 is configured to execute the program instructions stored in the memory 404, and is configured to perform the following operations:
acquiring scene change parameters of the target area according to historical video data of the target area, wherein the scene change parameters are used for indicating the stability of the target area;
and acquiring a reference image of the target area according to the scene change parameters of the target area, and screening the target frame image from the target video according to the scene change parameters of the target area.
Optionally, the processor 401 is configured to execute the program instructions stored in the memory 404, and is configured to perform the following operations:
when the scene change parameter indicates that the stability of the target area is greater than or equal to a preset stability value, acquiring a multi-frame image without the target object in the historical video data of the target area;
carrying out averaging processing on the pixel information of the multi-frame image to obtain a reference image of the target area;
and selecting images from the target video according to a first preset time interval, and taking the selected images as the target frame images one frame at a time.
Optionally, the processor 401 is configured to execute the program instructions stored in the memory 404, and is configured to perform the following operations:
when the scene change parameter indicates that the stability of the target area is smaller than a preset stability value, selecting images from the target video according to a second preset time interval, and selecting two frames of images each time;
and taking a first frame image of the two frame images as a reference image of the target area, and taking a second frame image of the two frame images as the target frame image, wherein the shooting time of the first frame image is earlier than that of the second frame image.
Optionally, the processor 401 is configured to execute the program instructions stored in the memory 404, and is configured to perform the following operations:
dividing the target frame image and the reference image into a plurality of sub-images according to a preset division rule;
acquiring the characteristic information of each sub-image in the target frame image and the characteristic information of each sub-image in the reference image;
comparing the characteristic information of each sub-image in the target frame image with the characteristic information of the corresponding sub-image in the reference image to obtain the matching degree between each sub-image in the target frame image and the corresponding sub-image in the reference image;
and carrying out weighted summation on the determined matching degree to obtain the matching degree between the target frame image and the reference image.
Optionally, the processor 401 is configured to execute the program instructions stored in the memory 404, and is configured to perform the following operations:
acquiring a training image matched with the target frame image from a database;
acquiring object information in the training images from the database, wherein the database comprises a plurality of training images and object information in each training image;
taking the object information in the training image as the object information of the target object in the target frame image;
and outputting the object information of the target object.
In the embodiment of the invention, whether a target object intrudes into the target area can be automatically identified by identifying the target frame image in the video data of the target area, so that labor resources are saved, the image identification efficiency is improved, the automatic and intelligent requirements of a user on video monitoring are met, and the safety of the user can be effectively ensured; in addition, by screening the video data of the target area, only part of frame images in the video data need to be identified, and all images in the video data do not need to be identified, so that the image identification efficiency is further improved.
The processor 401, the input device 402, and the output device 403 described in this embodiment of the present invention may execute the implementation manners described in the first embodiment and the second embodiment of the image processing method based on image recognition provided in this embodiment of the present invention, and may also execute the implementation manner of the monitoring device described in this embodiment of the present invention, which is not described herein again.
A computer-readable storage medium is further provided in the embodiments of the present invention, and the computer-readable storage medium stores a computer program, where the computer program includes program instructions, and the program instructions, when executed by a processor, implement the image processing method based on image recognition shown in the embodiments of fig. 1 and fig. 2 of the present invention.
The computer readable storage medium may be an internal storage unit of the monitoring device according to any of the foregoing embodiments, for example, a hard disk or a memory of the control device. The computer-readable storage medium may also be an external storage device of the control device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like provided on the control device. Further, the computer-readable storage medium may also include both an internal storage unit and an external storage device of the control device. The computer-readable storage medium is used to store the computer program and other programs and data required by the control device. The computer readable storage medium may also be used to temporarily store data that has been output or is to be output.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention. It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the control device and the unit described above may refer to corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed control device and method may be implemented in other ways. For example, the above-described apparatus embodiments are illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.