CN113129387A - Camera position detection method, device, equipment and storage medium - Google Patents

Camera position detection method, device, equipment and storage medium Download PDF

Info

Publication number
CN113129387A
CN113129387A CN202110435812.9A CN202110435812A CN113129387A CN 113129387 A CN113129387 A CN 113129387A CN 202110435812 A CN202110435812 A CN 202110435812A CN 113129387 A CN113129387 A CN 113129387A
Authority
CN
China
Prior art keywords
detected
image
traffic indication
category
image set
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110435812.9A
Other languages
Chinese (zh)
Inventor
张宪法
潘柳华
徐麟
闫正
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Eye Control Technology Co Ltd
Original Assignee
Shanghai Eye Control Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Eye Control Technology Co Ltd filed Critical Shanghai Eye Control Technology Co Ltd
Priority to CN202110435812.9A priority Critical patent/CN113129387A/en
Publication of CN113129387A publication Critical patent/CN113129387A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/97Determining parameters from multiple pictures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Traffic Control Systems (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the invention discloses a camera position detection method, a device, equipment and a storage medium. Wherein, the method comprises the following steps: acquiring an image set to be detected of a target camera and a reference traffic indication mark category corresponding to each image to be detected in the image set to be detected; determining a first traffic indication mark category corresponding to each image to be detected in the image set to be detected through a traffic indication mark classification model; and determining a position detection result of the target camera according to the number of target type images to be detected contained in a preset number of images to be detected in the image set to be detected, wherein the target type images to be detected comprise the images to be detected, which are different from the corresponding first traffic indication mark type and the reference traffic indication mark type. The technical scheme provided by the embodiment of the invention can effectively judge whether the position of the camera is abnormally changed or not, and is favorable for correcting the position of the camera in time.

Description

Camera position detection method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the field of intelligent transportation, in particular to a camera position detection method, device, equipment and storage medium.
Background
In recent years, new technologies such as artificial intelligence, big data, internet of things and cloud computing are rapidly developed, and the development of the intelligent transportation field is promoted due to the integration of the new technologies and the transportation industry. The large data generated in the intelligent transportation field are various, such as data of a gate, road video monitoring, electronic police, traffic signal control, vehicle-mounted video, a public traffic network, vehicle positioning and the like.
In the field of intelligent transportation, if a camera at an intersection rotates or shakes, a shooting scene of the intersection changes, and the change of the shooting scene can cause erroneous judgment and missed judgment of an intelligent illegal auditing system.
At present, no better method is available for realizing the position detection of the camera.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a storage medium for detecting the position of a camera, which can effectively judge whether the position of the camera is abnormally changed or not and are beneficial to correcting the position of the camera in time.
In a first aspect, an embodiment of the present invention provides a method for detecting a camera position, where the method includes:
acquiring an image set to be detected of a target camera and a reference traffic indication mark category corresponding to each image to be detected in the image set to be detected;
determining a first traffic indication mark category corresponding to each image to be detected in the image set to be detected through a traffic indication mark classification model;
and determining the position detection result of the target camera according to the number of target type images to be detected contained in a preset number of images to be detected in the image set to be detected, wherein the target type images to be detected comprise the images to be detected, which are different from the corresponding first traffic indication identifier category and the reference traffic indication identifier category.
In a second aspect, an embodiment of the present invention provides a camera position detection apparatus, including:
the system comprises an acquisition module, a traffic indication identification generation module and a traffic indication identification generation module, wherein the acquisition module is used for acquiring an image set to be detected of a target camera and a reference traffic indication identification category corresponding to each image to be detected in the image set to be detected;
the category determination module is used for determining a first traffic indication identifier category corresponding to each image to be detected in the image set to be detected through a traffic indication identifier classification model;
and the result determining module is used for determining the position detection result of the target camera according to the number of target type images to be detected contained in a preset number of images to be detected in the image set to be detected, wherein the target type images to be detected comprise the images to be detected, which are different from the corresponding first traffic indication identifier category and the reference traffic indication identifier category.
In a third aspect, an embodiment of the present invention provides a computer device, where the computer device includes:
one or more processors;
storage means for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement the camera position detection method according to any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the camera position detection method according to any embodiment of the present invention.
The embodiment of the invention provides a camera position detection method, a device, equipment and a storage medium, which comprises the steps of firstly obtaining an image set to be detected of a target camera and a reference traffic indication mark category corresponding to each image to be detected in the image set to be detected, then determining a first traffic indication mark category corresponding to each image to be detected in the image set to be detected through a traffic indication mark classification model, and finally determining the position detection result of the target camera according to the number of target type images to be detected contained in a preset number of images to be detected in the image set to be detected, so that whether the position of the camera is abnormally changed or not can be effectively judged, and the position of the camera can be corrected in time.
Drawings
Fig. 1 is a flowchart of a method for detecting a camera position according to an embodiment of the present invention;
fig. 2 is a flowchart of a camera position detection method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a camera position detection apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a camera position detection method according to an embodiment of the present invention, which is applicable to a situation of detecting positions of cameras installed at an intersection. The camera position detection method provided by this embodiment may be executed by the camera position detection apparatus provided by the embodiment of the present invention, and the apparatus may be implemented by software and/or hardware and integrated in a computer device executing the method.
Referring to fig. 1, the method of the present embodiment includes, but is not limited to, the following steps:
s110, acquiring an image set to be detected of the target camera and a reference traffic indication mark category corresponding to each image to be detected in the image set to be detected.
The cameras in the embodiment of the present invention may include cameras installed on any road segment of a road, for example, at intersections of main roads in cities, toll stations, and intersections of provinces or city, and the like, and the driving conditions of the current road segment can be photographed by the cameras. The target camera is a camera that needs position detection. The camera in the embodiment of the invention can be a bayonet camera, and the target camera comprises a target bayonet camera. The image set to be detected comprises an image set obtained according to video data currently shot by the target camera. The reference traffic indication mark category can be determined according to traffic-related marks which exist on the road and can be shot by a camera, and the specific category division rule can be set according to actual requirements and can be used as the reference category according to the actual requirements. For example, the reference traffic indicator category includes at least one of a traffic light category, a straight guide line category, a left turn guide line category, a right turn guide line category, a straight left turn guide line category, a straight right turn guide line category, and a solid line category.
In order to detect the position of the target camera and correct the position of the target camera in time when the position of the target camera is found to be abnormally changed, so as to ensure the accuracy of video data shot by the target camera, an image set to be detected of the target camera needs to be obtained according to the video data currently shot by the target camera, and because the image set to be detected contains a plurality of images to be detected and a reference traffic indication identifier category corresponding to each image to be detected in the image set to be detected needs to be obtained, whether a first traffic indication identifier category corresponding to each image to be detected in the image set to be detected determined by the traffic indication identifier classification model is the same as a reference category or not is determined by taking the reference traffic indication identifier category as the reference category subsequently.
S120, determining a first traffic indication mark category corresponding to each image to be detected in the image set to be detected through the traffic indication mark classification model.
The traffic indication mark classification model is a classification model which is trained in advance and can identify the traffic indication mark category corresponding to the image to be detected.
And respectively inputting each image to be detected in the image set to be detected into the traffic indication mark classification model, and determining a first traffic indication mark category corresponding to each image to be detected so as to subsequently determine the image to be detected with different first traffic indication mark categories and reference traffic indication mark categories in the image set to be detected, thereby determining the position detection result of the target camera according to the number of the images to be detected in the target type.
S130, determining the position detection result of the target camera according to the number of the target type images to be detected contained in the preset number of images to be detected in the image set to be detected.
The target type image to be detected comprises a corresponding image to be detected, wherein the corresponding first traffic indication mark type is different from the reference traffic indication mark type. The preset number may be set in advance, or may be determined according to specific situations, and the embodiment is not particularly limited.
After acquiring a reference traffic indication identifier category corresponding to each image to be detected in an image set to be detected and determining a first traffic indication identifier category corresponding to each image to be detected, selecting a preset number of images to be detected in the image set to be detected as an image sample to be detected in order to quickly determine a position detection result of a target camera because the image set to be detected comprises a plurality of images to be detected, judging whether the reference traffic indication identifier category corresponding to the current image to be detected is the same as the first traffic indication identifier category or not according to each image to be detected in the image sample to be detected, and if not, determining that the current image to be detected is the image to be detected of the target type; and if the target type image is the same as the target type image, determining that the current image to be detected is not the target type image to be detected. Summarizing all the images to be detected of the target type, obtaining the number of the images to be detected of the target type contained in the image sample to be detected, and determining the position detection result of the target camera according to the number of the images to be detected of the target type, for example, if the number of the images to be detected of the target type is 0, it is indicated that the position detection result of the target camera is that the position is not abnormally changed.
According to the technical scheme, firstly, an image set to be detected of a target camera and a reference traffic indication mark category corresponding to each image to be detected in the image set to be detected are obtained, then a first traffic indication mark category corresponding to each image to be detected in the image set to be detected is determined through a traffic indication mark classification model, and finally, according to the number of images to be detected of target types contained in a preset number of images to be detected in the image set to be detected, a position detection result of the target camera is determined, whether the position of the camera is abnormally changed or not can be effectively judged, timely correction of the position of the camera is facilitated, and adverse effects caused by abnormal change of the position of the camera are avoided.
In some embodiments, the acquiring a to-be-detected image set of a target camera and a reference traffic indicator category corresponding to each to-be-detected image in the to-be-detected image set may specifically include: acquiring a position information set of a reference traffic indication mark and a category information set of the reference traffic indication mark corresponding to the target camera under the condition that the position of the target camera is normal, and acquiring a first image set corresponding to video data currently shot by the target camera; selecting a first reference traffic indication mark from the category information set aiming at each first image in the first image set, and cutting a current first image according to position information corresponding to the category of the first reference traffic indication mark in the position information set to obtain an image to be detected; and summarizing all the images to be detected to obtain an image set to be detected.
And the reference traffic indication mark category corresponding to the image to be detected is the corresponding first reference traffic indication mark. The position information set of the reference traffic indication mark is an information set of a specific position of the reference traffic indication mark contained in the current road section which can be shot by the target camera. The category information set of the reference traffic indication mark is an information set of a specific category of the reference traffic indication mark contained in the current road section which can be shot by the target camera, and the category in the category information set of the reference traffic indication mark and the position in the position information set of the reference traffic indication mark are in one-to-one correspondence. The category of the reference traffic indication mark included in the category information set of the reference traffic indication mark may include at least one of a traffic light category, a straight guidance line category, a left turn guidance line category, a right turn guidance line category, a straight left turn guidance line category, a straight right turn guidance line category, and a solid line category.
In the embodiment of the invention, a first reference traffic indication mark is selected from a category information set of the reference traffic indication mark corresponding to the target camera under the condition of normal position, each first image in a first image set corresponding to video data currently shot by the target camera is cut according to the position information corresponding to the first reference traffic indication mark, and the corresponding image set to be detected and the reference traffic indication mark category corresponding to each image to be detected in the image set to be detected can be obtained, so that the first traffic indication mark category corresponding to each image to be detected in the image set to be detected and the number of the images to be detected of the target type can be determined through a traffic indication mark classification model.
In some embodiments, after a first image set corresponding to video data currently shot by a target camera is obtained, sampling may be performed every other preset first number of images to obtain a third image set, then, for each third image in the third image set, a first reference traffic indication identifier is selected from a category information set, and a current third image is clipped according to position information corresponding to a category of the first reference traffic indication identifier in a position information set to obtain an image to be detected.
The preset first number may be FPS/4, the FPS is a frame rate corresponding to video data currently captured by the target camera, the preset first number may also be other set values, the preset first number may also be determined according to specific situations, and the embodiment is not particularly limited.
In the embodiment of the invention, the diversity of the obtained third image set can be ensured by sampling every other preset first number of images, so that the images contained in the third image set are richer, and the subsequently obtained image set to be detected is more accurate.
In some embodiments, when the first reference traffic indicator is selected, all the categories of the reference traffic indicators (i.e., the traffic light category, the straight guidance line category, the left turn guidance line category, the right turn guidance line category, the straight left turn guidance line category, the straight right turn guidance line category, and the solid line category) existing on the current road may be sorted first, for example, sorted according to the completeness of the shot reference traffic indicators, easily photographed and completely arranged in front of the road during sorting, easily blocked by a vehicle and arranged behind the road during sorting, for example, the traffic light is not on the ground and is not easily blocked, the priority of the sorting is set to be the highest, and the categories of other categories, such as the straight guidance line category or the left turn guidance line category, are easily blocked by the vehicle and arranged behind the road during sorting, the corresponding priorities are set to be lower, the first reference traffic indicator is selected according to the ranked priority. For example, for each first image in a first image set corresponding to video data currently shot by a target camera, whether a traffic light category exists in a position information set of a reference traffic indication identifier corresponding to the target camera under the condition of normal position is judged, if yes, the traffic light category is used as the first reference traffic indication identifier, the position of the traffic light is found from the position information set of the reference traffic indication identifier corresponding to the target camera under the condition of normal position, and each first image is cut according to the position of the traffic light to obtain a corresponding image set to be detected; if the traffic light category does not exist in the position information set of the reference traffic indication mark corresponding to the target camera under the condition of normal position, sequentially judging whether a straight guiding line exists, a left-turning guiding line category, a right-turning guiding line category, a straight left-turning guiding line category, a straight right-turning guiding line category and a solid line category exist, if so, a traffic light category-like operation is performed, if none of the above-mentioned categories of all reference traffic indicators exist, it means that the scene corresponding to the video data currently shot by the target camera is not the intersection gate camera scene, there is no need to judge whether the scene changes, and gives warning information that the shooting scene of the target camera is not the intersection gate camera scene, the subsequent camera position detection is not needed by prompting related workers, and manpower and material resources are prevented from being wasted.
In the embodiment of the invention, when the first reference traffic indication mark is selected, the categories of all the reference traffic indication marks existing in the current road are sorted firstly, the first reference traffic indication mark is selected according to the sorted priority, when the categories of the reference traffic indication marks corresponding to the first image in the first image set corresponding to the video data currently shot by the target camera are more, the first reference traffic indication mark can be quickly selected, the time is saved, when the sorted priority is obtained according to the integrity of the shot reference traffic indication mark, the selected first reference traffic indication mark has higher reference value, and the finally obtained position detection result of the target camera is more accurate.
In some embodiments, before the acquiring the location information set of the reference traffic indicator and the category information set of the reference traffic indicator corresponding to the target camera in the normal location, the method may further include: acquiring a second image set corresponding to historical video data shot by a preset camera under the condition of normal position; acquiring the traffic indication identification marking result of the first number of images in the second image set to obtain a marked image set; training a preset image detection network structure by taking the marked image set as a training sample to obtain a traffic indication mark detection model; and detecting one image corresponding to the historical video data shot by the target camera under the condition of normal position through the traffic indication mark detection model to obtain a position information set of a reference traffic indication mark corresponding to the target camera under the condition of normal position and a category information set of the reference traffic indication mark.
The preset cameras can be cameras installed at intersections of main roads for city entrance and exit, toll stations, provincial and city bayonets and the like, can include target cameras and can not include target cameras, and the installation position and the number of the preset cameras are not specifically limited in the embodiment. Preferably, the camera with a normal position in the off-peak time period of the intersection is selected as the preset camera, so that the problem that the traffic indication mark contained in the image training sample is inaccurate due to the fact that the vehicle blocks the road guide line can be avoided, and the detection precision of the traffic indication mark detection model is improved. The first number may be set in advance, or may be determined according to specific situations, and this embodiment is not particularly limited. The preset image detection network structure may be a YOLOv4 network structure, a YOLOv4-Tiny network structure, or a squeezet network structure, and the present embodiment is not limited specifically.
Specifically, historical video data shot by a preset camera under a normal position condition is acquired, the historical video data is converted into a corresponding second image set, and a marking tool is used for marking traffic indication marks on each image in the first number of images in the second image set, for example, a rectangular frame is used for marking a traffic light, a straight guide line, a left turning guide line, a right turning guide line, a straight left turning guide line, a straight right turning guide line and a solid line contained in each image in the first number of images, and the traffic indication mark category corresponding to each rectangular frame is marked, so that a traffic indication mark marking result of the first number of images can be acquired, and the marked image set is obtained. And training a preset image detection network structure by taking the marked image set as a training sample, so that the obtained traffic indication mark detection model is more accurate. After the traffic indication mark detection model is obtained, one image corresponding to the historical video data shot by the target camera under the condition of normal position is detected through the traffic indication mark detection model, and a position information set of a reference traffic indication mark and a category information set of the reference traffic indication mark corresponding to the target camera under the condition of normal position can be obtained.
Further, when obtaining the position information set of the reference traffic indication identifier and the category information set of the reference traffic indication identifier corresponding to the target camera in the normal position, the method may further include: according to the position information set of the reference traffic indication mark and the category information set of the reference traffic indication mark corresponding to the target camera under the condition of normal position, the image corresponding to each reference traffic indication mark of the target camera under the condition of normal position is extracted to obtain the image set corresponding to each reference traffic indication mark, so that a training sample of a traffic indication mark classification model is selected through the image set corresponding to each reference traffic indication mark in the following process to obtain an accurate traffic indication mark classification model.
In some embodiments, after obtaining the position information set of the reference traffic indicator and the category information set of the reference traffic indicator corresponding to the target camera in the normal position, the method may further include: firstly, obtaining the identification information (such as intersection name or target camera number) of a target camera, then naming the structured file by using the identification information, and saving a position information set of a reference traffic indication identifier and a category information set of the reference traffic indication identifier corresponding to the target camera under the condition of normal position into the named structured file, for example: when the structured file is a json file,
the file name is: "baoji00001. jpg. json",
the corresponding file contents are:
{ "objects": [ { "label": "trafficlight", "polygon": [ [2070, 77], [2070, 106], [2141, 108], [2142, 79] ], "show _ text": "traffic lights" }, { "label": "straight-Guideline", "polygon": [ [2306, 1660], [2386, 1872], [2606,1852], [2400, 1574], "show _ text": "straight guide line" }, { "label": "left-guideline", "polygon": [ [1648, 1650], [1676, 1866], [1862, 1852], [1804, 1604] ], "show _ text": "left turn guide line" }.
In the embodiment of the invention, the position information set and the category information set of the reference traffic indication mark are stored according to a certain mode, so that the subsequent quick search can be conveniently carried out.
In some embodiments, the acquiring a location information set of a reference traffic indicator and a category information set of the reference traffic indicator corresponding to the target camera in a normal location may specifically include: acquiring identity identification information of the target camera; and searching a structured file corresponding to the identity identification information according to the identity identification information, and acquiring a position information set of a reference traffic indication identifier and a category information set of the reference traffic indication identifier corresponding to the target camera under the condition of normal position from the structured file.
In the embodiment of the invention, the structured file corresponding to the identity identification information is searched according to the identity identification information, so that the position information set of the reference traffic indication mark and the category information set of the reference traffic indication mark corresponding to the target camera under the condition of normal position are obtained, a large amount of time can be saved, and the subsequent selection of the first reference traffic indication mark and the acquisition of the image set to be detected are facilitated.
Example two
Fig. 2 is a flowchart of a camera position detection method according to a second embodiment of the present invention. The embodiment of the invention is optimized on the basis of the embodiment. Optionally, this embodiment explains in detail a process of obtaining a traffic indication identifier classification model and a process of determining a position detection result of a target camera.
Referring to fig. 2, the method of the present embodiment includes, but is not limited to, the following steps:
s210, acquiring an image set to be detected of the target camera and a reference traffic indication mark category corresponding to each image to be detected in the image set to be detected.
S220, determining a first traffic indication mark category corresponding to each image to be detected in the image set to be detected through the traffic indication mark classification model.
Optionally, the traffic indication identifier classification model is obtained by: acquiring an image set corresponding to each traffic indication identifier, and respectively synthesizing each image in the image set with a background image to obtain a corresponding new image set; and training a preset image recognition network structure by taking the new image set as a training sample to obtain the traffic indication identifier classification model.
The image set corresponding to each traffic indication identifier may be understood as an image set corresponding to each reference traffic indication identifier, which is obtained after the image corresponding to each reference traffic indication identifier of the target camera under the condition of normal position is extracted according to the position information set and the category information set of the reference traffic indication identifier corresponding to the target camera when the position information set and the category information set of the reference traffic indication identifier corresponding to the target camera under the condition of normal position are obtained. The preset image recognition network structure may be a neural network structure, such as a Resnet18 network structure, a Resnet18-SE network structure, or other ResNet network structures.
Specifically, after the image set corresponding to each traffic indication identifier is obtained, because the image set corresponding to each traffic indication identifier does not include a background image, in order to make a training sample of the preset image recognition network structure closer to an actual situation, each image in the image set is synthesized with the background image, so that a corresponding synthesized new image set can be obtained, the new image set is used as the training sample to train the preset image recognition network structure, and the obtained traffic indication identifier classification model is more accurate.
Optionally, the background image may be obtained by randomly cropping from the video data of the target camera, and the rate of coincidence between the cropped image and the image corresponding to each traffic indication identifier generally cannot exceed a preset percentage, where the preset percentage may be set in advance, for example, 20%, or may be determined according to a specific situation, which is not limited in this embodiment.
Further, the preset image recognition network structure comprises a Resnet18-SE network structure, and the Resnet18-SE network structure is obtained by improving the Resnet18 network structure, wherein the improvement mode comprises at least one of adding a compression and excitation module, removing a pooling layer, reducing the network width, reducing the sampling times and changing a pooling operation strategy.
Specifically, the improvement comprises at least one of the following modes:
1) adding a compression and excitation module: a compression-and-Excitation (SE) module is added into each basic block module of the Resnet18 network structure, aiming at improving the network expression capability by utilizing the characteristics of the SE module, such as retaining useful characteristics and inhibiting unimportant characteristics.
2) Removing a pooling layer: the pooling layer of the Resnet18 network structure is eliminated because the pooling layer loses semantic detail information while reducing resolution, making feature expressions inadequate.
3) And (3) reducing the network width: for example, the network width is reduced to half of the original Resnet18 network structure, that is, the number of output channels of each baseblock is reduced by half, so as to reduce the number of parameters of the network, reduce the video memory consumption, and improve the forward inference speed.
4) And (3) reducing the sampling times: for example, changing the original 5 times down-sampling into 3 times down-sampling can be used for small resolution picture classification.
5) Changing the pooling operation strategy: for example, the last step-size maximum pooling operation of the original Resnet18-SE network structure is changed to a global average pooling operation, so that the network input size is no longer limited to 224 × 224, but can be any size.
In the embodiment of the invention, the Resnet18 network structure is improved, so that the Resnet18-SE network structure is more suitable for the training process in the embodiment, the obtained traffic indication mark classification model is more accurate, and correspondingly, the first traffic indication mark category corresponding to each image to be detected in the image set to be detected determined by the traffic indication mark classification model is more accurate.
And S230, determining the number of the target type images to be detected contained in the preset number of images to be detected in the image set to be detected.
Counting the number of the images to be detected, which are different from the reference traffic indication mark type, corresponding to the first traffic indication mark type in the preset number of images to be detected in the image set to be detected, so that the number of the images to be detected of the target type contained in the preset number of images to be detected in the image set to be detected can be determined, and the position detection result of the target camera is determined to be abnormal position change if the number of the images to be detected of the target type is larger than a preset number threshold value.
S240, if the number of the images to be detected in the target type is larger than a preset number threshold, determining that the position detection result of the target camera is that the position is abnormally changed.
The preset number threshold may be pre-designed, or may be determined according to specific situations, and this embodiment is not particularly limited.
After the number of the images to be detected of the target type is determined, if the number of the images to be detected of the target type is larger than a preset number threshold, the position of the target camera is changed, such as shaking or moving, correspondingly, the position detection result of the target camera is determined to be abnormal change, and when the position detection result of the target camera is determined to be abnormal change, alarm information can be sent to prompt related workers that the camera position detection process is finished and the position of the target camera is abnormally changed, so that the target camera can be overhauled in time.
Optionally, the process of determining the position detection result of the target camera may further include: determining a sample type corresponding to an image to be detected in an image set to be detected, and storing the sample type to a corresponding storage position of a recording container, wherein the sample type comprises a positive sample and a negative sample, the positive sample is that a first traffic indication identifier category corresponding to the image to be detected is the same as a reference traffic indication identifier category, and the negative sample is that the first traffic indication identifier category corresponding to the image to be detected is different from the reference traffic indication identifier category; acquiring the total number of storage positions of the recording container; and if the number of the negative samples is more than half of the total number of the storage positions, determining that the position detection result of the target camera is that the position is abnormally changed.
Wherein, the total number of storage positions of the recording container can satisfy: 5< total storage positions of the recording containers <1.5FPS/4, wherein the FPS is a frame rate corresponding to video data currently shot by the target camera; the total number of storage locations of the recording container may also be other set values, and this embodiment is not limited in particular.
According to the embodiment of the invention, the position detection result of the target camera can be quickly determined through the relation between the number of the negative samples and half of the total number of the storage positions.
Further, if the number of the negative samples is less than or equal to half of the total number of the storage positions, determining whether the type of the sample stored in the first storage position of the recording container is a negative sample; if so, updating the number of the negative samples, deleting the sample types stored in the first storage position of the recording container, sequentially storing the sample types stored from the second storage position to the last storage position of the recording container to the previous storage position, acquiring an image to be detected behind a preset number of images to be detected in the image set to be detected, taking the image to be detected as a first image to be detected, determining the sample type of the first image to be detected, storing the sample type to the last storage position of the recording container, and determining the shake detection result of the target bayonet camera according to the number of the negative samples in all the sample types stored in the recording container.
In the embodiment of the invention, when the number of the negative samples is less than or equal to half of the total number of the storage positions and the corresponding storage positions of the recording container are full, and the type of the sample stored in the first storage position of the recording container is determined to be a negative sample, the number of the negative samples is subtracted by 1 to obtain the updated number of the negative samples, the type of the sample stored in the first storage position of the recording container is deleted, and the type of the sample stored in the subsequent storage position is moved forward, so that the last storage position is vacated to store the latest sample type of the image to be detected, and the smooth operation of the camera position detection process is ensured.
Furthermore, if the determined sample type stored in the first storage position of the recording container is not a negative sample, keeping the number of the negative samples unchanged, deleting the sample type stored in the first storage position of the recording container, sequentially storing the sample types stored in the second storage position to the last storage position of the recording container to the previous storage position, acquiring an image to be detected behind a preset number of images to be detected in the image set to be detected, using the image to be detected as a first image to be detected, determining the sample type of the first image to be detected, storing the sample type to the last storage position of the recording container, and determining the shake detection result of the target bayonet camera according to the number of the negative samples in all the sample types stored in the recording container.
In the embodiment of the invention, under the condition that the number of the negative samples is less than or equal to half of the total number of the storage positions and the corresponding storage positions of the recording container are full, when the type of the sample stored in the first storage position of the recording container is determined not to be the negative sample, the number of the negative samples is kept unchanged, the type of the sample stored in the first storage position of the recording container is deleted, and the type of the sample stored in the subsequent storage position is moved forward, so that the last storage position is left out to store the latest sample type of the image to be detected, and the smooth operation of the camera position detection process is ensured.
The technical scheme provided by this embodiment includes obtaining an image set to be detected of a target camera and a reference traffic indicator category corresponding to each image to be detected in the image set to be detected, determining a first traffic indicator category corresponding to each image to be detected in the image set to be detected through a traffic indicator classification model, determining the number of images to be detected of a target type contained in a preset number of images to be detected in the image set to be detected, and determining that a position detection result of the target camera is an abnormal position change if the number of images to be detected of the target type is greater than a preset number threshold, so as to effectively determine whether the position of the camera is changed abnormally, and when the position of the camera is changed abnormally, the position of the camera is corrected in time, and misjudgment of a traffic rule event is avoided, the traffic violation event monitoring system provides guarantee for manual or intelligent checking of traffic violation events, and meanwhile, the camera position detection process is automatic in the whole process, so that a large number of human resources are saved.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a camera position detecting device according to a third embodiment of the present invention, and as shown in fig. 3, the device may include:
an obtaining module 310, configured to obtain an image set to be detected of a target camera and a reference traffic indicator category corresponding to each image to be detected in the image set to be detected;
the category determining module 320 is configured to determine, through a traffic indicator classification model, a first traffic indicator category corresponding to each image to be detected in the image set to be detected;
a result determining module 330, configured to determine a position detection result of the target camera according to the number of target type to-be-detected images included in a preset number of to-be-detected images in the to-be-detected image set, where the target type to-be-detected images include to-be-detected images with different corresponding first traffic indicator category and reference traffic indicator category.
According to the technical scheme, firstly, an image set to be detected of a target camera and a reference traffic indication mark category corresponding to each image to be detected in the image set to be detected are obtained, then a first traffic indication mark category corresponding to each image to be detected in the image set to be detected is determined through a traffic indication mark classification model, and finally, according to the number of images to be detected of target types contained in the images to be detected in the preset number in the image set to be detected, a position detection result of the target camera is determined, whether the position of the camera is abnormally changed or not can be effectively judged, and the position of the camera is corrected in time.
Further, the obtaining module 310 may include: the first image set acquisition unit is used for acquiring a position information set of a reference traffic indication mark and a category information set of the reference traffic indication mark corresponding to the target camera under the condition that the position of the target camera is normal, and acquiring a first image set corresponding to video data currently shot by the target camera; the to-be-detected image determining unit is used for selecting a first reference traffic indication identifier from the category information set aiming at each first image in the first image set, and cutting the current first image according to the position information corresponding to the category of the first reference traffic indication identifier in the position information set to obtain the to-be-detected image; and the image set acquisition unit is used for summarizing all images to be detected to obtain an image set to be detected, wherein the reference traffic indication mark category corresponding to the images to be detected is the corresponding first reference traffic indication mark.
Further, the obtaining module 310 may further include an information set determining unit, configured to: acquiring a second image set corresponding to historical video data shot by a preset camera under the condition of normal position; acquiring the traffic indication identification marking result of the first number of images in the second image set to obtain a marked image set; training a preset image detection network structure by taking the marked image set as a training sample to obtain a traffic indication mark detection model; and detecting one image corresponding to the historical video data shot by the target camera under the condition of normal position through the traffic indication mark detection model to obtain a position information set of a reference traffic indication mark corresponding to the target camera under the condition of normal position and a category information set of the reference traffic indication mark.
Further, the first image set acquiring unit may be specifically configured to: acquiring identity identification information of the target camera; and searching a structured file corresponding to the identity identification information according to the identity identification information, and acquiring a position information set of a reference traffic indication identifier and a category information set of the reference traffic indication identifier corresponding to the target camera under the condition of normal position from the structured file.
Further, the traffic indication identifier classification model is obtained by: acquiring an image set corresponding to each traffic indication identifier, and respectively synthesizing each image in the image set with a background image to obtain a corresponding new image set; and training a preset image recognition network structure by taking the new image set as a training sample to obtain the traffic indication identifier classification model.
Further, the preset image recognition network structure comprises a Resnet18-SE network structure, and the Resnet18-SE network structure is obtained by improving the Resnet18 network structure, wherein the improvement mode comprises at least one of adding a compression and excitation module, removing a pooling layer, reducing the network width, reducing the sampling times and changing a pooling operation strategy.
Further, the result determining module 330 may be specifically configured to: determining the number of target type images to be detected contained in a preset number of images to be detected in the image set to be detected; and if the number of the images to be detected of the target type is larger than a preset number threshold, determining that the position detection result of the target camera is that the position is abnormally changed.
The camera position detection device provided by the embodiment can be applied to the camera position detection method provided by any embodiment, and has corresponding functions and beneficial effects.
Example four
Fig. 4 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention, as shown in fig. 4, the computer device includes a processor 410, a storage device 420, and a communication device 430; the number of the processors 410 in the computer device may be one or more, and one processor 410 is taken as an example in fig. 4; the processor 410, the storage 420 and the communication means 430 in the computer device may be connected by a bus or other means, and fig. 4 illustrates the connection by a bus as an example.
The storage device 420, which is a computer-readable storage medium, may be used to store software programs, computer-executable programs, and modules, such as the modules corresponding to the camera position detection method in the embodiment of the present invention (for example, the acquisition module 310, the category determination module 320, and the result determination module 330 used in the camera position detection device). The processor 410 executes various functional applications and data processing of the computer device by executing software programs, instructions and modules stored in the storage 420, that is, implements the above-described camera position detection method.
The storage device 420 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the storage 420 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the storage 420 may further include memory located remotely from the processor 410, which may be connected to a computer device over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
And a communication device 430 for implementing a network connection or a mobile data connection between the servers.
The computer device provided by the embodiment can be used for executing the camera position detection method provided by any embodiment, and has corresponding functions and beneficial effects.
EXAMPLE five
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a camera position detection method in any embodiment of the present invention, where the method specifically includes:
acquiring an image set to be detected of a target camera and a reference traffic indication mark category corresponding to each image to be detected in the image set to be detected;
determining a first traffic indication mark category corresponding to each image to be detected in the image set to be detected through a traffic indication mark classification model;
and determining the position detection result of the target camera according to the number of target type images to be detected contained in a preset number of images to be detected in the image set to be detected, wherein the target type images to be detected comprise the images to be detected, which are different from the corresponding first traffic indication identifier category and the reference traffic indication identifier category.
Of course, the storage medium provided by the embodiment of the present invention contains computer-executable instructions, and the computer-executable instructions are not limited to the operations of the method described above, and may also perform related operations in the camera position detection method provided by any embodiment of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
It should be noted that, in the embodiment of the camera position detection apparatus, the units and modules included in the embodiment are only divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A camera position detection method, comprising:
acquiring an image set to be detected of a target camera and a reference traffic indication mark category corresponding to each image to be detected in the image set to be detected;
determining a first traffic indication mark category corresponding to each image to be detected in the image set to be detected through a traffic indication mark classification model;
and determining the position detection result of the target camera according to the number of target type images to be detected contained in a preset number of images to be detected in the image set to be detected, wherein the target type images to be detected comprise the images to be detected, which are different from the corresponding first traffic indication identifier category and the reference traffic indication identifier category.
2. The method according to claim 1, wherein the acquiring the image set to be detected of the target camera and the reference traffic indicator category corresponding to each image to be detected in the image set to be detected comprises:
acquiring a position information set of a reference traffic indication mark and a category information set of the reference traffic indication mark corresponding to the target camera under the condition that the position of the target camera is normal, and acquiring a first image set corresponding to video data currently shot by the target camera;
selecting a first reference traffic indication mark from the category information set aiming at each first image in the first image set, and cutting a current first image according to position information corresponding to the category of the first reference traffic indication mark in the position information set to obtain an image to be detected;
and summarizing all images to be detected to obtain an image set to be detected, wherein the reference traffic indication mark category corresponding to the images to be detected is the corresponding first reference traffic indication mark.
3. The method according to claim 2, further comprising, before the obtaining a set of location information of a reference traffic indicator and a set of category information of the reference traffic indicator corresponding to the target camera under a normal situation of location, the steps of:
acquiring a second image set corresponding to historical video data shot by a preset camera under the condition of normal position;
acquiring the traffic indication identification marking result of the first number of images in the second image set to obtain a marked image set;
training a preset image detection network structure by taking the marked image set as a training sample to obtain a traffic indication mark detection model;
and detecting one image corresponding to the historical video data shot by the target camera under the condition of normal position through the traffic indication mark detection model to obtain a position information set of a reference traffic indication mark corresponding to the target camera under the condition of normal position and a category information set of the reference traffic indication mark.
4. The method according to claim 2, wherein the acquiring a position information set of a reference traffic indicator and a category information set of the reference traffic indicator corresponding to the target camera under a normal position condition comprises:
acquiring identity identification information of the target camera;
and searching a structured file corresponding to the identity identification information according to the identity identification information, and acquiring a position information set of a reference traffic indication identifier and a category information set of the reference traffic indication identifier corresponding to the target camera under the condition of normal position from the structured file.
5. The method of claim 1, wherein the traffic indicator classification model is derived by:
acquiring an image set corresponding to each traffic indication identifier, and respectively synthesizing each image in the image set with a background image to obtain a corresponding new image set;
and training a preset image recognition network structure by taking the new image set as a training sample to obtain the traffic indication identifier classification model.
6. The method of claim 5, wherein the predetermined image recognition network structure comprises a Resnet18-SE network structure, and wherein the Resnet18-SE network structure is obtained by modifying a Resnet18 network structure, wherein the modification comprises at least one of adding a compression and excitation module, removing a pooling layer, reducing a network width, reducing a number of samples, and changing a pooling operation strategy.
7. The method according to claim 1, wherein determining the position detection result of the target camera according to the number of the target type to be detected images included in the preset number of images to be detected in the image set to be detected comprises:
determining the number of target type images to be detected contained in a preset number of images to be detected in the image set to be detected;
and if the number of the images to be detected of the target type is larger than a preset number threshold, determining that the position detection result of the target camera is that the position is abnormally changed.
8. A camera position detecting device, comprising:
the system comprises an acquisition module, a traffic indication identification generation module and a traffic indication identification generation module, wherein the acquisition module is used for acquiring an image set to be detected of a target camera and a reference traffic indication identification category corresponding to each image to be detected in the image set to be detected;
the category determination module is used for determining a first traffic indication identifier category corresponding to each image to be detected in the image set to be detected through a traffic indication identifier classification model;
and the result determining module is used for determining the position detection result of the target camera according to the number of target type images to be detected contained in a preset number of images to be detected in the image set to be detected, wherein the target type images to be detected comprise the images to be detected, which are different from the corresponding first traffic indication identifier category and the reference traffic indication identifier category.
9. A computer device, characterized in that the computer device comprises:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the camera position detection method of any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the camera position detection method according to any one of claims 1 to 7.
CN202110435812.9A 2021-04-22 2021-04-22 Camera position detection method, device, equipment and storage medium Pending CN113129387A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110435812.9A CN113129387A (en) 2021-04-22 2021-04-22 Camera position detection method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110435812.9A CN113129387A (en) 2021-04-22 2021-04-22 Camera position detection method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113129387A true CN113129387A (en) 2021-07-16

Family

ID=76779004

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110435812.9A Pending CN113129387A (en) 2021-04-22 2021-04-22 Camera position detection method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113129387A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114040094A (en) * 2021-10-25 2022-02-11 青岛海信网络科技股份有限公司 Method and equipment for adjusting preset position based on pan-tilt camera
CN115225814A (en) * 2022-06-17 2022-10-21 苏州蓝博控制技术有限公司 Camera assembly and video processing method thereof

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114040094A (en) * 2021-10-25 2022-02-11 青岛海信网络科技股份有限公司 Method and equipment for adjusting preset position based on pan-tilt camera
CN114040094B (en) * 2021-10-25 2023-10-31 青岛海信网络科技股份有限公司 Preset position adjusting method and device based on cradle head camera
CN115225814A (en) * 2022-06-17 2022-10-21 苏州蓝博控制技术有限公司 Camera assembly and video processing method thereof
CN115225814B (en) * 2022-06-17 2023-09-05 苏州蓝博控制技术有限公司 Camera assembly and video processing method thereof

Similar Documents

Publication Publication Date Title
CN113781808B (en) Method and system for passing of internet-connected automatic driving vehicle at traffic light intersection
CN110146097B (en) Method and system for generating automatic driving navigation map, vehicle-mounted terminal and server
CN114435138B (en) Vehicle energy consumption prediction method and device, vehicle and storage medium
CN113129387A (en) Camera position detection method, device, equipment and storage medium
CN111723854B (en) Expressway traffic jam detection method, equipment and readable storage medium
CN108932470B (en) Image processing system, image processing method, information processing apparatus, and recording medium
US11062154B2 (en) Non-transitory storage medium storing image transmission program, image transmission device, and image transmission method
CN109782364B (en) Traffic sign board missing detection method based on machine vision
CN111666853A (en) Real-time vehicle violation detection method, device, equipment and storage medium
CN111753612B (en) Method and device for detecting casting object and storage medium
WO2020143170A1 (en) Predicted path acquisition method and apparatus, computer device, and storage medium
CN112462774A (en) Urban road supervision method and system based on unmanned aerial vehicle navigation following and readable storage medium
CN112418081B (en) Method and system for quickly surveying traffic accidents by air-ground combination
EP4345773A1 (en) Lane line extraction method and apparatus, vehicle and storage medium
US10665096B2 (en) Non-transitory storage medium storing image transmission program, image transmission device, and image transmission method
CN114170569A (en) Method, system, storage medium and equipment for monitoring road surface abnormal condition
CN111402574B (en) Vehicle detection method, device, equipment and storage medium
CN113850237A (en) Internet vehicle target detection and evaluation method and system based on video and track data
WO2024098992A1 (en) Vehicle reversing detection method and apparatus
CN112732861A (en) Road information data acquisition method and device and electronic equipment
CN116935631A (en) Abnormal traffic situation detection method, device and system based on radar fusion
CN111325178A (en) Warning object detection result acquisition method and device, computer equipment and storage medium
CN114512005B (en) Road self-inspection method and device, unmanned aerial vehicle and storage medium
CN115762230A (en) Parking lot intelligent guiding method and device based on remaining parking space amount prediction
CN111741267B (en) Method, device, equipment and medium for determining vehicle delay

Legal Events

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