Camera regulation and control method based on monitoring image analysis data
By installing cameras on street-facing houses, using image analysis technology to determine whether children are in the lane, and adjusting the camera shooting distance and acquisition frequency, the problem of preventing traffic accidents and losses in rural areas is solved, real-time monitoring of children's safety and Early warning.
Patent Information
- Application Number
- CN202411083313.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-11-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In rural areas, children with street-facing houses are prone to running to the streets, resulting in an increase in the probability of traffic accidents and loss, and it is difficult for existing technology to effectively monitor and prevent these situations.
Using a camera regulation method based on surveillance image analysis data, images are collected by cameras installed on the house, and the recognition model is used to determine whether the target object (children) is in the lane, and the shooting distance and image acquisition frequency of the camera are adjusted according to the judgment results, in real time Monitoring and early warning.
Through real-time monitoring and early warning, the probability of children's traffic accidents is reduced, and children's safety protection is improved, so that parents can find children in a timely manner and ensure their safety.
Smart Images

Figure CN118890544A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of camera technology, and in particular to a camera control method based on monitoring image analysis data. Background Art
[0002] In rural areas, some houses are facing the street, and there are many left-behind children in rural areas. Children like to run around, and it is easy for them to run into the street, which leads to traffic accidents. With the popularization of cars, the probability of traffic accidents is gradually increasing. In addition, children are often lost. Therefore, if cameras can be installed in every household facing the street, through the monitoring and control of the cameras, the activities of children can be dynamically grasped, and the probability of accidents involving children can be reduced in this way. Summary of the invention
[0003] The object of the present invention is to provide a camera control method based on monitoring image analysis data to improve the above-mentioned problem.
[0004] In order to achieve the above objectives, the present application provides the following technical solutions:
[0005] In a first aspect, an embodiment of the present application provides a camera control method based on monitoring image analysis data, the method comprising:
[0006] Acquire a first image captured by a camera at a current moment, wherein the camera is installed on a house, the house includes a courtyard, and a driveway is in front of the courtyard, and the camera can capture images of the courtyard and the driveway;
[0007] Using the recognition model to recognize the target object in the first image, obtain the position information of the target object in the first image, and determine whether the target object is in the lane according to the position information of the target object in the first image to obtain a determination result;
[0008] Analyze the judgment result, if the target object is located on the lane, adjust the shooting distance of the camera to shorten the shooting distance of the target object so as to amplify the shooting of the target object, if the target object is not located on the lane, obtain the second image collected by the camera within a preset time period, the end time of the preset time period is the current time, and adjust the camera according to all the second images;
[0009] The camera is controlled according to all the second images, including:
[0010] Using the recognition model to recognize the target object in each of the second images, and obtain the position information of the target object in each of the second images;
[0011] According to the order of the moment when each second image is acquired, the position information of the target object in each second image is marked in the form of points on the coordinate axis, wherein the horizontal axis represents the horizontal coordinate and the vertical axis represents the vertical coordinate; for any three adjacent points, the point earliest in time is recorded as the first point, the point latest in time is recorded as the third point, and the point in the middle in time is recorded as the second point; the line segment between the first point and the second point is recorded as the first line segment, and the line segment between the second point and the third point is recorded as the second line segment; the first line segment is extended, and the angle between the first line segment and the second line segment is calculated after the extension, and the cosine value corresponding to the angle is calculated; the first-order difference of two adjacent cosine values is calculated, and the standard deviation of all the first-order differences is calculated to obtain the standard deviation; the camera is adjusted according to the standard deviation.
[0012] Further, the target object in the first image is identified by using the recognition model to obtain the position information of the target object in the first image, and whether the target object is in the lane is determined according to the position information of the target object in the first image to obtain a determination result, including:
[0013] Cut the first image to obtain multiple sub-images, and filter each sub-image to obtain a sub-image containing a target object; obtain a target detection model, wherein the target detection model includes a YOLOv5 network, and replace the feature extraction structure in the target detection model with a deep learning architecture based on an attention mechanism to obtain a preliminary model;
[0014] The CIOU loss function in the preliminary model is replaced with an adaptive anchor box loss function to obtain an intermediate model; the recognition model is obtained based on the intermediate model, and the position information of the target object in the first image is obtained by using the recognition model; the lane is marked with a parallelogram to obtain a parallelogram area corresponding to the lane, and whether the target object is on the lane is determined according to the parallelogram area.
[0015] Further, obtaining the recognition model based on the intermediate model, using the recognition model to obtain the position information of the target object in the first image; using a parallelogram to identify the lane to obtain a parallelogram area corresponding to the lane, and judging whether the target object is on the lane according to the parallelogram area, including:
[0016] The spatial pyramid pooling structure in the intermediate model is replaced with a feature enhancement module to obtain the recognition model; the sub-image containing the target object is input into the recognition model for recognition to obtain first position information of the target object in the sub-image containing the target object;
[0017] Based on the position correspondence between the sub-image and the first image, the first position information of the target object in the sub-image containing the target object is converted to obtain second position information, and the second position information is filtered using a non-maximum suppression algorithm to obtain the position information of the target object in the first image. The lane is marked with a parallelogram to obtain a parallelogram area corresponding to the lane, and whether the target object is on the lane is determined based on the parallelogram area.
[0018] Further, the lane is marked by a parallelogram to obtain a parallelogram area corresponding to the lane, and whether the target object is on the lane is determined according to the parallelogram area, including:
[0019] Using the coordinate information of the two vertices on the long side of the parallelogram region, corresponding linear equations are constructed to obtain two linear equations respectively;
[0020] The location information of the target object in the first image is converted into geographic coordinates, and the longitude in the geographic coordinates is substituted into two linear equations respectively to obtain two latitude coordinates in turn to form a latitude area range; it is determined whether the latitude in the geographic coordinates is within the latitude area range, and if so, it proves that the target object is on the lane; otherwise, it is not on the lane.
[0021] In a second aspect, an embodiment of the present application provides a camera control device based on monitoring image analysis data, including:
[0022] an acquisition module, used to acquire a first image captured by a camera at a current moment, wherein the camera is installed on a house, the house includes a courtyard, and a driveway is in front of the courtyard, and the camera can capture images of the courtyard and the driveway;
[0023] a judgment module, configured to recognize the target object in the first image by using a recognition model, obtain position information of the target object in the first image, and judge whether the target object is in a lane according to the position information of the target object in the first image, and obtain a judgment result;
[0024] a control module, configured to analyze the judgment result; if the target object is located on the lane, control the shooting distance of the camera to shorten the shooting distance of the target object so as to amplify the shooting of the target object; if the target object is not located on the lane, obtain a second image collected by the camera within a preset time period, the end time of the preset time period being the current time, and control the camera according to all the second images;
[0025] The control module includes:
[0026] an identification unit, configured to identify the target object in each of the second images by using a recognition model, and obtain position information of the target object in each of the second images;
[0027] A control unit is used to mark the position information of the target object in each second image in the form of points on the coordinate axis in the order of the acquisition time of each second image, wherein the horizontal axis represents the horizontal coordinate and the vertical axis represents the vertical coordinate; for any three adjacent points, the point closest in time is recorded as the first point, the point closest in time is recorded as the third point, and the point in the middle in time is recorded as the second point; the line segment between the first point and the second point is recorded as the first line segment, and the line segment between the second point and the third point is recorded as the second line segment; the first line segment is extended, and after the extension, the angle between the first line segment and the second line segment is calculated, and the cosine value corresponding to the angle is calculated; the first-order difference of two adjacent cosine values is calculated, and the standard deviation of all the first-order differences is calculated to obtain the standard deviation; the camera is controlled according to the standard deviation.
[0028] Furthermore, the judgment module includes:
[0029] A cutting unit is used to cut the first image to obtain multiple sub-images, and screen each sub-image to obtain a sub-image containing a target object; obtain a target detection model, wherein the target detection model includes a YOLOv5 network, and replace the feature extraction structure in the target detection model with a deep learning architecture based on an attention mechanism to obtain a preliminary model;
[0030] A judgment unit is used to replace the CIOU loss function in the preliminary model with an adaptive anchor box loss function to obtain an intermediate model; obtain the recognition model based on the intermediate model, and use the recognition model to obtain the position information of the target object in the first image; use a parallelogram to identify the lane, obtain a parallelogram area corresponding to the lane, and judge whether the target object is on the lane according to the parallelogram area.
[0031] Furthermore, the judging unit comprises:
[0032] A replacement unit is used to replace the spatial pyramid pooling structure in the intermediate model with a feature enhancement module to obtain the recognition model; input the sub-image containing the target object into the recognition model for recognition, and obtain the first position information of the target object in the sub-image containing the target object;
[0033] An identification unit is used to convert first position information of a target object in a sub-image containing the target object based on a position correspondence between the sub-image and the first image to obtain second position information, filter the second position information using a non-maximum suppression algorithm to obtain the position information of the target object in the first image, identify the lane using a parallelogram to obtain a parallelogram area corresponding to the lane, and determine whether the target object is on the lane based on the parallelogram area.
[0034] Furthermore, the identification unit includes:
[0035] A construction unit, used to construct corresponding linear equations using coordinate information of two vertices on the long side of the parallelogram region, and obtain two linear equations respectively;
[0036] The conversion unit is used to convert the position information of the target object in the first image into geographic coordinates, substitute the longitude in the geographic coordinates into two linear equations respectively, obtain two latitude coordinates in turn, and form a latitude area range; determine whether the latitude in the geographic coordinates is within the latitude area range, if so, it proves that the target object is on the lane; otherwise, it is not on the lane.
[0037] In a third aspect, an embodiment of the present application provides a camera control device based on monitoring image analysis data, the device comprising a memory and a processor. The memory is used to store a computer program; the processor is used to implement the steps of the camera control method based on monitoring image analysis data when executing the computer program.
[0038] In a fourth aspect, an embodiment of the present application provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the above-mentioned camera control method based on monitoring image analysis data are implemented.
[0039] The beneficial effects of the present invention are:
[0040] In the present invention, the first image captured by the camera installed on the house facing the street at the current moment is first analyzed. Through a series of analyses, the position information of the target object in the first image at the current moment can be obtained; then the data of the lane in front of the house is obtained to obtain the parallelogram area of the lane, and then the target object is judged whether it is located on the lane according to the current position information of the target object. If the target object, i.e., the child, is located on the lane, then the child is in a dangerous environment. At this time, the camera is immediately adjusted to shoot at a close distance, and the shot picture is sent to the user, prompting the user to immediately go to the lane to check. This method can reduce the probability of a child having a vehicle accident; otherwise, the second image captured by the camera within a preset time period is obtained, and the activity level of the child is judged according to all the second images. If the activity level is level three, the camera is adjusted to increase the image acquisition frequency, and then the child's next movement direction or position can be predicted according to a large number of image frames, which helps parents find the child and is also conducive to ensuring the safety of the child. The camera control method in the present invention can improve the safety protection of children and reduce the probability of accidents involving children.
[0041] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or be understood by implementing the embodiments of the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0043] Figure 1 is a schematic flow chart of a camera control method based on monitoring image analysis data described in an embodiment of the present invention;
[0044] Figure 2 is a schematic structural diagram of a camera control device based on monitoring image analysis data in an embodiment of the present invention;
[0045] Figure 3 It is a schematic diagram of the structure of a camera control device based on monitoring image analysis data described in an embodiment of the present invention. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0047] It should be noted that similar reference numerals or letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0048] Example 1
[0049] like Figure 1 As shown, this embodiment provides a camera control method based on monitoring image analysis data, which includes step S1, step S2 and step S3.
[0050] Step S1, obtaining a first image captured by a camera at the current moment, wherein the camera is installed on a house, the house includes a courtyard, and there is a driveway in front of the courtyard, and the camera can capture images of the courtyard and the driveway;
[0051] In this step, the application scenario may be a rural area, where some houses have courtyards and the courtyards face the street, that is, there is a driveway in front, and vehicles often pass by. This embodiment takes into account that in rural areas, children like to run around in the courtyards, and sometimes they accidentally run into the driveway, which is very dangerous. Therefore, if cameras can be used for monitoring and then alarm warnings can be issued, the probability of danger can be reduced.
[0052] Step S2, using the recognition model to recognize the target object in the first image, obtain the position information of the target object in the first image, and determine whether the target object is in the lane according to the position information of the target object in the first image to obtain a determination result;
[0053] In this step, the target object is a child, and the specific implementation steps of this step include step S21 and step S22;
[0054] Step S21, cutting the first image to obtain a plurality of sub-images, screening each sub-image to obtain a sub-image containing a target object; obtaining a target detection model, the target detection model including a YOLOv5 network, replacing a feature extraction structure in the target detection model with a deep learning architecture based on an attention mechanism, and obtaining a preliminary model;
[0055] In this step, the sub-image can be input into a preset target object screening model to determine whether the sub-image contains the target object; wherein the training process of the target object screening model is to annotate a large number of sub-images to mark whether they contain the target object, and after annotating, train the convolutional neural network to obtain the target object screening model; at the same time, the feature extraction structure in the target detection model is replaced with a deep learning architecture based on the attention mechanism, specifically: the feature extraction model in the YOLOv5 network is replaced with a Swin-Transformer Blocks structure; after the replacement, the performance and accuracy of the model can be improved;
[0056] Step S22, replacing the CIOU loss function in the preliminary model with an adaptive anchor box loss function to obtain an intermediate model; obtaining the recognition model based on the intermediate model, and using the recognition model to obtain the position information of the target object in the first image; using a parallelogram to identify the lane, obtaining a parallelogram area corresponding to the lane, and judging whether the target object is on the lane according to the parallelogram area.
[0057] In this step, the adaptive anchor box loss function Focal_EIOU is replaced with the CIOU loss function to improve the accuracy and robustness of model detection; in addition, the recognition model is obtained based on the intermediate model, and the position information of the target object in the first image is obtained by using the recognition model; the lane is identified by a parallelogram, and a parallelogram area corresponding to the lane is obtained, and whether the target object is on the lane is determined according to the parallelogram area. The specific implementation steps include step S221 and step S222;
[0058] Step S221, replacing the spatial pyramid pooling structure in the intermediate model with a feature enhancement module to obtain the recognition model; inputting the sub-image containing the target object into the recognition model for recognition to obtain first position information of the target object in the sub-image containing the target object;
[0059] In this step, the feature enhancement module FEM is replaced with the spatial pyramid pooling structure SPP, which can also improve the accuracy and robustness of model detection. After the recognition model is built, the sub-image containing the target object is input into it to obtain the candidate box position information of the target object in the sub-image, that is, the first position information of the target object.
[0060] Step S222: based on the position correspondence between the sub-image and the first image, convert the first position information of the target object in the sub-image containing the target object to obtain second position information, filter the second position information using a non-maximum suppression algorithm to obtain the position information of the target object in the first image, use a parallelogram to identify the lane, obtain a parallelogram area corresponding to the lane, and determine whether the target object is on the lane based on the parallelogram area.
[0061] In this step, when dividing, each sub-image has a corresponding positional relationship with the first image, and the second position information when the first position information is mapped to the first image can be obtained by transformation; all the second position information is screened by the non-maximum suppression algorithm to obtain the position information of the target object in the first image; at the same time, in this step, it can be improved on the basis of the road network matching algorithm based on the boundary rectangle, and the rectangle is changed into a parallelogram to obtain the parallelogram area corresponding to the lane; it is also possible to directly obtain the minimum circumscribed rectangle of a small section of the lane that can be captured by the camera in front of the courtyard, and use the minimum circumscribed rectangle as the parallelogram area; in addition, the lane is identified by a parallelogram to obtain the parallelogram area corresponding to the lane, and the specific implementation steps of judging whether the target object is on the lane according to the parallelogram area include step S2221 and step S2222;
[0062] Step S2221, using the coordinate information of the two vertices on the long side of the parallelogram region, construct corresponding linear equations to obtain two linear equations respectively;
[0063] Step S2222, convert the location information of the target object in the first image into geographic coordinates, substitute the longitude in the geographic coordinates into two linear equations respectively, obtain two latitude coordinates in turn, and form a latitude area range; determine whether the latitude in the geographic coordinates is within the latitude area range, if so, it proves that the target object is on the lane; otherwise, it is not on the lane.
[0064] In this step, the geographical location of the fixed object can be found on the first image, and the geographical coordinates corresponding to the target object can be calculated according to the relative position relationship between the fixed object and the target object; other conventional calculation methods can also be used to calculate the geographical coordinates corresponding to the target object;
[0065] Step S3, analyzing the judgment result; if the target object is located on the lane, adjusting the shooting distance of the camera, shortening the shooting distance of the target object, so as to amplify the shooting of the target object, and sending the captured image to the user; if the target object is not located on the lane, obtaining the second image captured by the camera within a preset time period, the end time of the preset time period is the current time, and adjusting the camera according to all the second images.
[0066] In this step, if the target object, i.e., the child, is on the lane, then the child is in a dangerous environment. At this time, the camera is immediately controlled to take a close-up shot, and the shot image is sent to the user, prompting the user to immediately go to the lane to check;
[0067] At the same time, the specific implementation steps of adjusting the camera according to all the second images include step S31 and step S32;
[0068] Step S31, using a recognition model to recognize a target object in each of the second images, to obtain position information of the target object in each of the second images;
[0069] In this step, the second images are processed according to the processing method of the first images to obtain the position information of the target object in each second image;
[0070] Step S32, according to the order of the acquisition time of each second image, mark the position information of the target object in each second image in the form of points on the coordinate axis, wherein the horizontal axis represents the horizontal coordinate and the vertical axis represents the vertical coordinate; for any three adjacent points, the point earliest in time is recorded as the first point, the point latest in time is recorded as the third point, and the point in the middle in time is recorded as the second point; the line segment between the first point and the second point is recorded as the first line segment, and the line segment between the second point and the third point is recorded as the second line segment; the first line segment is extended, and after the extension, the angle between the first line segment and the second line segment is calculated, and the cosine value corresponding to the angle is calculated; the first-order difference of two adjacent cosine values is calculated, and the standard deviation of all the first-order differences is calculated to obtain the standard deviation; the camera is adjusted according to the standard deviation.
[0071] In this step, the specific implementation steps of adjusting the camera according to the standard deviation include step S321;
[0072] Step S321, compare the standard deviation with the preset threshold range. If the standard deviation is less than the lower limit of the threshold range, the target object activity level is judged to be level one; if the standard deviation is greater than the upper limit of the threshold range, the target object activity level is level three; otherwise, the target object activity level is level two, the higher the level, the more active; if the activity level is level three, adjust the camera to increase the image acquisition frequency.
[0073] In this step, if the standard deviation is less than the lower limit of the threshold range, it proves that the position change of the target object is small, and the target object activity level is judged to be level one; if the standard deviation is greater than the upper limit of the threshold range, it proves that the position change of the target object is large, and the target object activity level is judged to be level three; when the position change is large, it may be that the child is running around, then there may be an accident where the child is lost, then at this time it is necessary to increase the image acquisition frequency, the increase in the acquisition frequency will also obtain more frames, even if the child runs out of the monitoring range, it is possible to predict the child’s next movement direction or position based on a large number of image frames, to help parents find the child, which is beneficial to ensure the safety of the child.
[0074] Example 2
[0075] like Figure 2 As shown, this embodiment provides a camera control device based on monitoring image analysis data, and the device includes an acquisition module 1, a judgment module 2 and a control module 3.
[0076] An acquisition module 1 is used to acquire a first image captured by a camera at a current moment, wherein the camera is installed on a house, the house includes a courtyard, and a driveway is in front of the courtyard, and the camera can capture images of the courtyard and the driveway;
[0077] A judgment module 2 is used to recognize the target object in the first image by using a recognition model, obtain position information of the target object in the first image, and judge whether the target object is in the lane according to the position information of the target object in the first image to obtain a judgment result;
[0078] The control module 3 is used to analyze the judgment result. If the target object is located on the lane, the shooting distance of the camera is adjusted to shorten the shooting distance of the target object so as to amplify the shooting of the target object. If the target object is not located on the lane, the second image collected by the camera within a preset time period is obtained, and the end time of the preset time period is the current time. The camera is controlled according to all the second images.
[0079] In a specific embodiment of the present disclosure, the judgment module 2 further includes a cutting unit 21 and a judgment unit 22;
[0080] A cutting unit 21 is used to cut the first image to obtain multiple sub-images, and screen each sub-image to obtain a sub-image containing a target object; obtain a target detection model, the target detection model includes a YOLOv5 network, and replace the feature extraction structure in the target detection model with a deep learning architecture based on an attention mechanism to obtain a preliminary model;
[0081] The judgment unit 22 is used to replace the CIOU loss function in the preliminary model with an adaptive anchor box loss function to obtain an intermediate model; obtain the recognition model based on the intermediate model, and use the recognition model to obtain the position information of the target object in the first image; use a parallelogram to identify the lane, obtain a parallelogram area corresponding to the lane, and judge whether the target object is on the lane according to the parallelogram area.
[0082] In a specific implementation of the present disclosure, the judgment unit 22 further includes a replacement unit 221 and an identification unit 222;
[0083] The replacement unit 221 is used to replace the spatial pyramid pooling structure in the intermediate model with a feature enhancement module to obtain the recognition model; input the sub-image containing the target object into the recognition model for recognition, and obtain the first position information of the target object in the sub-image containing the target object;
[0084] The identification unit 222 is used to convert the first position information of the target object in the sub-image containing the target object based on the position correspondence between the sub-image and the first image to obtain second position information, filter the second position information using a non-maximum suppression algorithm to obtain the position information of the target object in the first image, use a parallelogram to identify the lane, obtain the parallelogram area corresponding to the lane, and determine whether the target object is on the lane according to the parallelogram area.
[0085] In a specific implementation of the present disclosure, the identification unit 222 further includes a construction unit 2221 and a conversion unit 2222;
[0086] A construction unit 2221 is used to construct corresponding linear equations using the coordinate information of two vertices on the long side of the parallelogram region to obtain two linear equations respectively;
[0087] The conversion unit 2222 is used to convert the position information of the target object in the first image into geographic coordinates, substitute the longitude in the geographic coordinates into two linear equations respectively, and obtain two latitude coordinates in turn to form a latitude area range; determine whether the latitude in the geographic coordinates is within the latitude area range, if so, it proves that the target object is on the lane; otherwise, it is not on the lane.
[0088] In a specific embodiment of the present disclosure, the control module 3 further includes an identification unit 31 and a control unit 32;
[0089] The recognition unit 31 is used to recognize the target object in each second image by using the recognition model to obtain the position information of the target object in each second image;
[0090] The control unit 32 is used to mark the position information of the target object in each second image in the form of points on the coordinate axis in the order of the acquisition time of each second image, wherein the horizontal axis represents the horizontal coordinate and the vertical axis represents the vertical coordinate; for any three adjacent points, the point closest in time is recorded as the first point, the point closest in time is recorded as the third point, and the point in the middle in time is recorded as the second point; the line segment between the first point and the second point is recorded as the first line segment, and the line segment between the second point and the third point is recorded as the second line segment; the first line segment is extended, and after the extension, the angle between the first line segment and the second line segment is calculated, and the cosine value corresponding to the angle is calculated; the first-order difference of two adjacent cosine values is calculated, and the standard deviation of all the first-order differences is calculated to obtain the standard deviation; the camera is controlled according to the standard deviation.
[0091] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0092] Example 3
[0093] Corresponding to the above method embodiments, the embodiments of the present disclosure also provide a camera control device based on monitoring image analysis data. The camera control device based on monitoring image analysis data described below and the camera control method based on monitoring image analysis data described above can refer to each other.
[0094] Figure 3 FIG. 3 is a block diagram of a camera control device 300 based on monitoring image analysis data according to an exemplary embodiment. Figure 3 As shown, the camera control device 300 based on monitoring image analysis data may include: a processor 301, a memory 302. The camera control device 300 based on monitoring image analysis data may also include one or more of a multimedia component 303, an I / O interface 304, and a communication component 305.
[0095] The processor 301 is used to control the overall operation of the camera control device 300 based on monitoring image analysis data to complete all or part of the steps in the above-mentioned camera control method based on monitoring image analysis data. The memory 302 is used to store various types of data to support the operation of the camera control device 300 based on monitoring image analysis data. These data may include, for example, instructions for any application or method operating on the camera control device 300 based on monitoring image analysis data, as well as application-related data, such as contact data, sent and received messages, pictures, audio, video, etc. The memory 302 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk or optical disk. The multimedia component 303 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may be further stored in the memory 302 or sent via the communication component 305. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 304 provides an interface between the processor 301 and other interface modules, and the above-mentioned other interface modules can be keyboards, mice, buttons, etc. These buttons can be virtual buttons or physical buttons. The communication component 305 is used for wired or wireless communication between the camera control device 300 based on monitoring image analysis data and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G or 4G, or a combination of one or more of them, so the corresponding communication component 305 can include: Wi-Fi module, Bluetooth module, NFC module.
[0096] In an exemplary embodiment, the camera control device 300 based on monitoring image analysis data can be implemented by one or more application specific integrated circuits (Application Specific Integrated Circuit, referred to as ASIC), digital signal processors (Digital Signal Processing Device, referred to as DSP), digital signal processing devices (Digital Signal Processing Device, referred to as DSPD), programmable logic devices (Programmable Logic Device, referred to as PLD), field programmable gate arrays (Field Programmable Gate Array, referred to as FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned camera control method based on monitoring image analysis data.
[0097] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the steps of the camera control method based on monitoring image analysis data are implemented. For example, the computer-readable storage medium may be the memory 302 including the program instructions, and the program instructions may be executed by the processor 301 of the camera control device 300 based on monitoring image analysis data to complete the camera control method based on monitoring image analysis data.
[0098] Example 4
[0099] Corresponding to the above method embodiment, the embodiment of the present disclosure further provides a readable storage medium. The readable storage medium described below and the camera control method based on monitoring image analysis data described above can refer to each other.
[0100] A readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the camera control method based on monitoring image analysis data of the above method embodiment.
[0101] The readable storage medium may specifically be a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or other readable storage medium that can store program codes.
[0102] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A camera control method based on monitoring image analysis data, characterized in that: include: Acquire a first image captured by a camera at a current moment, wherein the camera is installed on a house, the house includes a courtyard, and a driveway is in front of the courtyard, and the camera can capture images of the courtyard and the driveway; Using the recognition model to recognize the target object in the first image, obtain the position information of the target object in the first image, and determine whether the target object is in the lane according to the position information of the target object in the first image to obtain a determination result; Analyze the judgment result, if the target object is located on the lane, adjust the shooting distance of the camera to shorten the shooting distance of the target object so as to amplify the shooting of the target object, if the target object is not located on the lane, obtain the second image collected by the camera within a preset time period, the end time of the preset time period is the current time, and adjust the camera according to all the second images; The camera is controlled according to all the second images, including: Using the recognition model to recognize the target object in each of the second images, and obtain the position information of the target object in each of the second images; According to the order of the moment when each second image is acquired, the position information of the target object in each second image is marked in the form of points on the coordinate axis, wherein the horizontal axis represents the horizontal coordinate and the vertical axis represents the vertical coordinate; for any three adjacent points, the point earliest in time is recorded as the first point, the point latest in time is recorded as the third point, and the point in the middle in time is recorded as the second point; the line segment between the first point and the second point is recorded as the first line segment, and the line segment between the second point and the third point is recorded as the second line segment; the first line segment is extended, and the angle between the first line segment and the second line segment is calculated after the extension, and the cosine value corresponding to the angle is calculated; the first-order difference of two adjacent cosine values is calculated, and the standard deviation of all the first-order differences is calculated to obtain the standard deviation; the camera is adjusted according to the standard deviation.
2. The camera control method based on monitoring image analysis data according to claim 1 is characterized in that: Using the recognition model to recognize the target object in the first image, obtaining the position information of the target object in the first image, and judging whether the target object is in the lane according to the position information of the target object in the first image, and obtaining the judgment result, including: Cut the first image to obtain multiple sub-images, and filter each sub-image to obtain a sub-image containing a target object; obtain a target detection model, wherein the target detection model includes a YOLOv5 network, and replace the feature extraction structure in the target detection model with a deep learning architecture based on an attention mechanism to obtain a preliminary model; The CIOU loss function in the preliminary model is replaced with an adaptive anchor box loss function to obtain an intermediate model; the recognition model is obtained based on the intermediate model, and the position information of the target object in the first image is obtained by using the recognition model; the lane is marked with a parallelogram to obtain a parallelogram area corresponding to the lane, and whether the target object is on the lane is determined according to the parallelogram area.
3. The camera control method based on monitoring image analysis data according to claim 2 is characterized in that: Obtaining the recognition model based on the intermediate model, and obtaining the position information of the target object in the first image using the recognition model; Using a parallelogram to mark the lane, obtaining a parallelogram area corresponding to the lane, and judging whether the target object is on the lane according to the parallelogram area, including: The spatial pyramid pooling structure in the intermediate model is replaced with a feature enhancement module to obtain the recognition model; the sub-image containing the target object is input into the recognition model for recognition to obtain first position information of the target object in the sub-image containing the target object; Based on the position correspondence between the sub-image and the first image, the first position information of the target object in the sub-image containing the target object is converted to obtain second position information, and the second position information is filtered using a non-maximum suppression algorithm to obtain the position information of the target object in the first image. The lane is marked with a parallelogram to obtain a parallelogram area corresponding to the lane, and whether the target object is on the lane is determined based on the parallelogram area.
4. The camera control method based on monitoring image analysis data according to claim 3 is characterized in that: Using a parallelogram to mark the lane, obtaining a parallelogram area corresponding to the lane, and judging whether the target object is on the lane according to the parallelogram area, including: Using the coordinate information of the two vertices on the long side of the parallelogram region, corresponding linear equations are constructed to obtain two linear equations respectively; The location information of the target object in the first image is converted into geographic coordinates, and the longitude in the geographic coordinates is substituted into two linear equations respectively to obtain two latitude coordinates in turn to form a latitude area range; it is determined whether the latitude in the geographic coordinates is within the latitude area range, and if so, it proves that the target object is on the lane; otherwise, it is not on the lane.
5. A camera control device based on monitoring image analysis data, characterized in that: include: an acquisition module, used to acquire a first image captured by a camera at a current moment, wherein the camera is installed on a house, the house includes a courtyard, and a driveway is in front of the courtyard, and the camera can capture images of the courtyard and the driveway; a judgment module, configured to recognize the target object in the first image by using a recognition model, obtain position information of the target object in the first image, and judge whether the target object is in a lane according to the position information of the target object in the first image, and obtain a judgment result; a control module, configured to analyze the judgment result; if the target object is located on the lane, control the shooting distance of the camera to shorten the shooting distance of the target object so as to amplify the shooting of the target object; if the target object is not located on the lane, obtain a second image collected by the camera within a preset time period, the end time of the preset time period being the current time, and control the camera according to all the second images; The control module includes: an identification unit, configured to identify the target object in each of the second images by using a recognition model, and obtain position information of the target object in each of the second images; A control unit is used to mark the position information of the target object in each second image in the form of points on the coordinate axis in the order of the acquisition time of each second image, wherein the horizontal axis represents the horizontal coordinate and the vertical axis represents the vertical coordinate; for any three adjacent points, the point closest in time is recorded as the first point, the point closest in time is recorded as the third point, and the point in the middle in time is recorded as the second point; the line segment between the first point and the second point is recorded as the first line segment, and the line segment between the second point and the third point is recorded as the second line segment; the first line segment is extended, and after the extension, the angle between the first line segment and the second line segment is calculated, and the cosine value corresponding to the angle is calculated; the first-order difference of two adjacent cosine values is calculated, and the standard deviation of all the first-order differences is calculated to obtain the standard deviation; the camera is controlled according to the standard deviation.
6. The camera control device based on monitoring image analysis data according to claim 5, characterized in that: The judgment module includes: A cutting unit is used to cut the first image to obtain multiple sub-images, and screen each sub-image to obtain a sub-image containing a target object; obtain a target detection model, wherein the target detection model includes a YOLOv5 network, and replace the feature extraction structure in the target detection model with a deep learning architecture based on an attention mechanism to obtain a preliminary model; A judgment unit is used to replace the CIOU loss function in the preliminary model with an adaptive anchor box loss function to obtain an intermediate model; obtain the recognition model based on the intermediate model, and use the recognition model to obtain the position information of the target object in the first image; use a parallelogram to identify the lane, obtain a parallelogram area corresponding to the lane, and judge whether the target object is on the lane according to the parallelogram area.
7. The camera control device based on monitoring image analysis data according to claim 6, characterized in that: The judgment unit comprises: A replacement unit is used to replace the spatial pyramid pooling structure in the intermediate model with a feature enhancement module to obtain the recognition model; input the sub-image containing the target object into the recognition model for recognition, and obtain the first position information of the target object in the sub-image containing the target object; An identification unit is used to convert first position information of a target object in a sub-image containing the target object based on a position correspondence between the sub-image and the first image to obtain second position information, filter the second position information using a non-maximum suppression algorithm to obtain the position information of the target object in the first image, identify the lane using a parallelogram to obtain a parallelogram area corresponding to the lane, and determine whether the target object is on the lane based on the parallelogram area.
8. The camera control device based on monitoring image analysis data according to claim 7, characterized in that: Identification unit, including: A construction unit, used to construct corresponding linear equations using coordinate information of two vertices on the long side of the parallelogram region, and obtain two linear equations respectively; The conversion unit is used to convert the position information of the target object in the first image into geographic coordinates, substitute the longitude in the geographic coordinates into two linear equations respectively, obtain two latitude coordinates in turn, and form a latitude area range; determine whether the latitude in the geographic coordinates is within the latitude area range, if so, it proves that the target object is on the lane; otherwise, it is not on the lane.
Citation Information
Patent Citations
An automatic auditing method for illegal bus lane occupation based on deep learning
CN109948416A
Vehicle driving state recognition method and device and storage medium
CN110161544A
Urban traffic state prediction method, device and equipment and readable storage medium
CN113570867A
Early warning method, system and device for pedestrian crossing guardrail illegally based on target tracking algorithm, and storage medium
CN114332159A
Road traffic sign detection method and system based on deep learning
CN117274957A
