Camera line frequency control method, system and equipment
By establishing and training frequency difference in training line prediction models, frequent compensation control is used to perform frequent control of camera lines, which solves the problem of distortion caused by image collection delay in existing technologies, realizes efficient image collection and processing, reduces the system to reduce the system Cost and development cycle.
Patent Information
- Application Number
- CN202411534354.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-01-28
AI Technical Summary
The existing technology has failed to solve the distortion problem caused by the delay of speed acquisition to image acquisition from the source of image acquisition. There are problems such as large calculation volume, slow calculation speed, and high hardware requirements. It is necessary to transfer the system from the current model to other models. Redevelop an image correction algorithm, with high translation costs and long cycles.
By determine the frequency difference of the line according to the standard image and the row frequency of the image to be detected, the line frequency difference timing predictive model data set is established, and the model is trained to obtain the trained row frequency difference timing predictive model. Based on the model, the line frequency frequency uses the row frequency frequency Compensation is performed frequently.
Achieve the problem of solving the image acquisition distortion from the source of the image collection, reduce the workload of subsequent image processing, and improve the operating efficiency of the system. The calculation data is value, the number of parameters is small, the calculation speed is fast, and the calculation requirements and system costs are reduced. Essence
Smart Images

Figure CN119383451A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a camera line frequency control method, system and device. Background Art
[0002] The camera line frequency is an important parameter of industrial cameras. In practical applications, most inspections require imaging of moving products. At this time, the camera line frequency must meet the specific usage requirements to clearly and accurately image the object. Taking the application of cameras in the vehicle field as an example, in the daily maintenance of vehicles, line scan cameras are used to collect vehicle images. The image collection of line scan cameras is controlled by the camera line frequency parameters. In actual application scenarios, the vehicle speed is collected in real time by radar, and then the speed is converted into the camera line frequency according to the speed-line frequency conversion formula. However, when the vehicle speed changes, due to the delay in the conversion of radar-vehicle speed-line frequency information, the camera line frequency will be inconsistent with the actual speed of the vehicle, resulting in distortion of the collected vehicle image.
[0003] The current method to solve distortion is mainly to use the coordinate difference between the image to be detected and the standard image to correct the image to be detected. The distortion problem caused by the time delay from speed acquisition to image acquisition has not been solved from the source of image acquisition. There are problems such as large amount of calculation, slow calculation speed, and high hardware requirements. When the system is transferred from the current model to other models, the image correction algorithm needs to be redeveloped, and the translation cost is high and the cycle is long. Summary of the invention
[0004] The present invention provides a camera line frequency control method, system and device to solve the problem of distortion caused by the delay from speed acquisition to image acquisition in the prior art, which has the problems of large amount of calculation, slow calculation speed, high hardware requirements, etc. When the system is transferred from the current model to other models, it is necessary to redevelop the image correction algorithm, and the translation cost is high and the cycle is long. The present invention can solve the image acquisition distortion problem from the source of image acquisition, thereby reducing the workload of subsequent image processing. The control method is extensible and can be promoted and applied in industrial scenarios.
[0005] The present invention provides a camera line frequency control method, comprising: determining a line frequency difference according to a line frequency of a standard image and a line frequency of an image to be detected; the line frequency of the standard image is the line frequency of an object image captured by a camera when the object moves at a standard speed, and the line frequency of the image to be detected is the line frequency of an object image captured by a camera when the object moves at an actual speed; establishing a line frequency difference timing prediction model data set based on the line frequency difference; the line frequency difference timing prediction model data set includes a plurality of groups of data pairs; the data pair includes the standard speed of a historical image and the line frequency difference; training a line frequency difference timing prediction model according to the line frequency difference timing prediction model data set to obtain a trained line frequency difference timing prediction model; and controlling the camera line frequency by adopting a line frequency compensation method based on the trained line frequency difference timing prediction model.
[0006] According to a camera line frequency control method provided by the present invention, the line frequency difference is determined according to the line frequency of the standard image and the line frequency of the image to be detected, including: acquiring a standard image and an image to be detected; performing feature extraction and feature matching on the standard image and the image to be detected to obtain a spatial distribution map of feature pairs; the feature pairs include feature points on the standard image and matching feature points on the image to be detected; determining the line frequency of the standard image and the line frequency of the image to be detected according to the spatial distribution map of the feature pairs; converting the line frequency of the image to be detected into an actual line frequency at a standard speed; and subtracting the line frequency of the standard image from the actual line frequency at the standard speed to obtain the line frequency difference.
[0007] According to a camera line rate control method provided by the present invention, the feature extraction and feature matching of the standard image and the image to be detected are performed to obtain a spatial distribution map of the feature pairs, including: using a threshold segmentation algorithm to align the standard image with one end of the image to be detected; using a SFIT feature extraction algorithm to extract feature points of the standard image and the image to be detected respectively to obtain feature points on the standard image and feature points on the image to be detected; using a DMarke operator to pair the feature points on the standard image with the features on the image to be detected to obtain the spatial distribution map of the feature pairs.
[0008] According to a camera line frequency control method provided by the present invention, the line frequency of the standard image and the line frequency of the image to be detected are determined according to the spatial distribution diagram of the feature pairs, including: determining the line frequency of the standard image according to the distance and time difference between any two feature points in the standard image; determining the line frequency of the image to be detected according to the distance and time difference between any two feature points in the image to be detected.
[0009] According to a camera line frequency control method provided by the present invention, the line frequency difference timing prediction model data set is established based on the line frequency difference, including: reading the speed data of the historical image in segments to determine the actual speed data sequence; normalizing the actual speed data sequence to obtain a standard speed data sequence; using time distribution to establish a correlation relationship between the standard speed data sequence and the line frequency difference, and establishing the line frequency difference timing prediction model data set; the line frequency difference timing prediction model data set includes a training set, a validation set and a test set.
[0010] According to a camera line frequency control method provided by the present invention, the line frequency difference timing prediction model is trained according to the line frequency difference timing prediction model data set to obtain a trained line frequency difference timing prediction model, including: training an LSTM model according to the standard speed data sequence and the line frequency difference, selecting a cross entropy loss function, and obtaining a trained line frequency difference timing prediction model.
[0011] According to a camera line frequency control method provided by the present invention, the line frequency control of the camera is performed by line frequency compensation based on the trained line frequency difference timing prediction model, including: based on the trained line frequency difference timing prediction model, the line frequency compensation formula is used to control the camera line frequency; the line frequency compensation formula is: F't=Vt / Pa+ΔFs(t) / k
[0012] Among them, F't is the camera control line frequency, Vt is the speed of the object at time t, Pa is the horizontal pixel accuracy, ΔFs(t) is the trained line frequency difference timing prediction model, and k is the conversion coefficient between the line frequency of the image to be detected and the line frequency of the standard image.
[0013] According to a camera line rate control method provided by the present invention, the object is a vehicle.
[0014] The present invention also provides a camera line frequency control system, comprising: a line frequency difference determination module, used to determine the line frequency difference according to the line frequency of a standard image and the line frequency of an image to be detected; the line frequency of the standard image is the line frequency of an object image captured by a camera when the object moves at a standard speed, and the line frequency of the image to be detected is the line frequency of an object image captured by a camera when the object moves at an actual speed; a data set establishment module, used to establish a line frequency difference timing prediction model data set based on the line frequency difference; the line frequency difference timing prediction model data set includes a plurality of groups of data pairs; the data pair includes the standard speed of a historical image and the line frequency difference; a model training module, used to train a line frequency difference timing prediction model according to the line frequency difference timing prediction model data set to obtain a trained line frequency difference timing prediction model; and a control module, used to control the camera line frequency by adopting a line frequency compensation method based on the trained line frequency difference timing prediction model.
[0015] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the above-mentioned camera line rate control methods is implemented.
[0016] The present invention provides a camera line frequency control method, system and device, the method comprising: determining the line frequency difference according to the line frequency of the standard image and the line frequency of the image to be detected; the line frequency of the standard image is the line frequency of the object image captured by the camera when the object moves at the standard speed, and the line frequency of the image to be detected is the line frequency of the object image captured by the camera when the object moves at the actual speed; establishing a line frequency difference timing prediction model data set based on the line frequency difference; the line frequency difference timing prediction model data set includes several groups of data pairs; the data pair includes the standard speed and line frequency difference of the historical image; training the line frequency difference timing prediction model according to the line frequency difference timing prediction model data set to obtain a trained line frequency difference timing prediction model; based on the trained line frequency difference timing prediction model, controlling the camera line frequency by line frequency compensation. The present invention can solve the image acquisition distortion problem from the source of image acquisition, thereby reducing the workload of subsequent image processing, and the control method is extensible and can be promoted and applied in industrial scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 It is a flow chart of a camera line frequency control method provided by the present invention.
[0019] Figure 2 It is a schematic diagram of the principle of a camera line frequency control method provided by the present invention.
[0020] Figure 3 It is a structural schematic diagram of a camera line frequency control system provided by the present invention.
[0021] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0023] Taking the application in the vehicle field as an example, at present, all the daily maintenance image acquisition of vehicles uses line scan cameras to collect vehicle images. The image acquisition of line scan cameras is controlled by the camera line frequency parameters. In actual application scenarios, the vehicle speed is collected in real time by radar and then converted into the camera line frequency according to the speed line frequency conversion formula. However, when the vehicle speed changes, the radar-vehicle speed-line frequency information conversion has a time delay, which will cause the camera line frequency to be inconsistent with the actual vehicle speed, resulting in distortion of the collected vehicle image. The current method to solve the distortion is mainly to use the coordinate difference between the image to be detected and the standard image to correct the image to be detected. The distortion problem caused by the delay from speed acquisition to image acquisition has not been solved from the source of image acquisition. There are problems such as large amount of calculation, slow calculation speed, and high hardware requirements. When the system is transferred from the current model to other models, the image correction algorithm needs to be redeveloped, and the translation cost is high and the cycle is long.
[0024] Please refer to Figure 1 , Figure 1 A schematic flow chart of a camera line rate control method provided by the present invention.
[0025] In order to solve the technical problems existing in the prior art, the present invention provides a camera line frequency control method, comprising: 101: determining a line frequency difference according to a line frequency of a standard image and a line frequency of an image to be detected; the line frequency of the standard image is the line frequency of an image of the object captured by the camera when the object moves at a standard speed, and the line frequency of the image to be detected is the line frequency of an image of the object captured by the camera when the object moves at an actual speed; 102: establishing a line frequency difference time series prediction model data set based on the line frequency difference; the line frequency difference time series prediction model data set includes a plurality of data pairs; the data pairs include a standard speed and a line frequency difference of a historical image; 103: training the line frequency difference time series prediction model according to the line frequency difference time series prediction model data set to obtain a trained line frequency difference time series prediction model; 104: Based on the trained line frequency difference timing prediction model, the line frequency of the camera is controlled by using line frequency compensation.
[0026] The present invention provides a camera line frequency control method. First, a standard image is established in a test environment, and a vehicle acquires an image to be detected under normal operating conditions. Then, the line frequency difference of each position of the image is calculated using the line frequency of the standard image and the line frequency of the image to be detected. After that, a line frequency difference timing prediction model data set is established based on multiple acquisitions of historical image data. The line frequency difference timing prediction model is trained according to the line frequency difference timing prediction model data set to obtain a trained line frequency difference timing prediction model. The camera line frequency is compensated based on the trained line frequency difference timing prediction model to achieve precise control of the camera line frequency. The present invention solves the distortion problem caused by speed signal delay from the source of image acquisition, reduces the workload of subsequent image processing, and thus improves the operating efficiency of the system. The calculated data is numerical, and the number of parameters is small, the calculation speed is fast, the calculation example requirements can be reduced, and the system cost can be reduced. Based on the line scan camera acquisition principle, a line frequency compensation method is proposed, which has a low correlation with specific application scenarios, has universality, and can be promoted and applied in industrial scenarios.
[0027] As a preferred embodiment, the line frequency difference is determined according to the line frequency of the standard image and the line frequency of the image to be detected, including: acquiring the standard image and the image to be detected; performing feature extraction and feature matching on the standard image and the image to be detected to obtain a spatial distribution map of feature pairs; the feature pairs include feature points on the standard image and matching feature points on the image to be detected; determining the line frequency of the standard image and the line frequency of the image to be detected according to the spatial distribution map of the feature pairs; converting the line frequency of the image to be detected into an actual line frequency at a standard speed; and subtracting the line frequency of the standard image from the actual line frequency at the standard speed to obtain a line frequency difference.
[0028] As a preferred embodiment, feature extraction and feature matching are performed on the standard image and the image to be detected to obtain a spatial distribution map of the feature pairs, including: using a threshold segmentation algorithm to align the standard image with one end of the image to be detected; using the SFIT feature extraction algorithm to extract feature points of the standard image and the image to be detected respectively to obtain feature points on the standard image and feature points on the image to be detected; using the DMarke operator to pair the feature points on the standard image with the features on the image to be detected to obtain a spatial distribution map of the feature pairs.
[0029] As a preferred embodiment, the line frequency of the standard image and the line frequency of the image to be detected are determined according to the spatial distribution diagram of the feature pairs, including: determining the line frequency of the standard image according to the distance and time difference between any two feature points in the standard image; determining the line frequency of the image to be detected according to the distance and time difference between any two feature points in the image to be detected.
[0030] Please refer to Figure 2 , Figure 2 A schematic diagram of the principle of a camera line rate control method provided by the present invention.
[0031] In this embodiment, by extracting and matching the features of the standard image and the image to be inspected, the information space distribution difference between the image to be inspected and the standard image is calculated, thereby calculating the line frequency difference. Specifically, when a vehicle passes through the 360 detection system, the detection system uses radar to collect the real-time speed of the vehicle, the speed is m / s, and uses the speed information to control the camera to change the line frequency to complete the vehicle information collection. The conversion formula between the original speed and the camera line frequency is: Ft=Vt / Pa, Ft is the line frequency of the camera at time t, Vt is the speed of the vehicle at time t, and Pa is the horizontal pixel accuracy.
[0032] Select a vehicle to pass through the 360 detection system at a standard speed Vs, set the corresponding camera line frequency Fs, and complete standard image acquisition.
[0033] The vehicle passes through the 360-degree detection system under normal operating conditions, generating images to be detected and corresponding speed data.
[0034] The threshold segmentation method is used to align the leftmost end of the image to be detected with the standard image. The SFIT (Scale-invariant feature transform) feature extraction algorithm is used to extract feature points of the standard image and the image to be detected respectively, mainly extracting sharp corners and line feature points. 2000-3000 feature points can be extracted in every 1024×2048 spatial range of the image. The DMarke operator is used to pair the feature points of the standard image with the feature points of the image to be detected, and the spatial distribution map of the feature pairs can be obtained.
[0035] Feature extraction and feature matching will generate feature pairs on the image. By aligning the left ends of the images, the feature points of the standard image and the feature points of the image to be detected will form a time distribution under the same coordinate system. Ps1-n is the feature point of the standard image, ts1-n is the time of the corresponding feature point relative to the initial position of the standard image, Pd1-n is the feature point of the image to be detected, td1-n is the time of the corresponding feature point relative to the initial position of the image to be detected.
[0036] Calculate the distance between two feature points of the standard image, such as Ss1=Ps2-Ps1, and the time difference between the two feature points Δt1=ts2-ts1. Since 2000-3000 feature points can be extracted in every 1024×2048 spatial range of the standard image, and the density of feature points is large enough, the standard line frequency of the standard image at this feature point can be obtained as Fs=Ss1 / Δt1. Similarly, the line frequency Fs(t)=Sst / Δtt at each position of the standard image can be calculated.
[0037] Calculate the distance between two feature points of the image to be detected, such as Sd1=Pd2-Pd1, and the time difference between the two feature points Δt1=td2-td1. Since 2000-3000 feature points can be extracted within every 1024×2048 spatial range of the image to be detected, and the density of feature points is large enough, the standard line frequency of the image to be detected at this feature point can be obtained as Fd=Sd1 / Δt1. By analogy, the line frequency Fd(t)=Sdt / Δtt at each position of the image to be detected can be calculated.
[0038] Find the conversion coefficient between the line frequency of the image to be detected and the line frequency of the standard image, k= , where Vd(t) is the actual speed data of the vehicle.
[0039] Therefore, it can be obtained that the actual line frequency of the image to be detected at time t when the speed is converted into the standard speed is F's(t)=k×Fd(t).
[0040] Calculate the line frequency difference ΔFs(t)=Fs(t)-F's(t) of the image to be detected at the standard speed.
[0041] As a preferred embodiment, a line frequency difference timing prediction model data set is established based on the line frequency difference, including: reading the speed data of historical images in segments to determine the actual speed data sequence; normalizing the actual speed data sequence to obtain a standard speed data sequence; using time distribution to establish a correlation between the standard speed data sequence and the line frequency difference, and establishing a line frequency difference timing prediction model data set; the line frequency difference timing prediction model data set includes a training set, a validation set and a test set.
[0042] In this embodiment, by extracting data from the speed information in segments, using time distribution to establish the correlation between the standard speed data sequence and the line frequency difference, a line frequency difference time series prediction model data set is established. Specifically, based on multiple acquisitions of historical image data, a line frequency difference time series prediction model data set is established, and the data includes two parts of data. The first part is the actual speed data before time t. The actual speed data is read in three sections within 30 seconds before time t. The first section is 30 actual speed data (3 data per second) evenly taken from 10 seconds before time t to 20 seconds before time t. The second section is 10 actual speed data evenly taken from 10 seconds before time t to 20 seconds before time t. The third section is 5 actual speed data evenly taken from 20 seconds before time t to 30 seconds before time t, forming an actual speed data sequence. The actual speed value needs to be normalized to the standard speed, that is, the speed sequence speed {V}=k×Vd(t). The second part is the line frequency difference data ΔFs(t) at time t. The above two parts of data are formed into data pairs {V}-ΔFs(t), and a total of 6000 data pairs are established to form a line frequency difference time series prediction model data set, of which 70% is a training set, 15% is a validation set, and 15% is a test set. The present invention normalizes all actual data (speed data, line frequency data) to standard data, thereby reducing the difficulty of model training and data requirements.
[0043] As a preferred embodiment, the line frequency difference timing prediction model is trained according to the line frequency difference timing prediction model data set to obtain a trained line frequency difference timing prediction model, including: training the LSTM model according to the standard speed data sequence and the line frequency difference, selecting the cross entropy loss function, and obtaining the trained line frequency difference timing prediction model.
[0044] In this embodiment, LSTM (Long Short Term Memory) is used for supervised learning, the speed sequence data is used as the training data of LSTM, the corresponding line frequency difference data ΔFs(t) is the training labeled data, and the cross entropy loss function is selected. After training, a line frequency difference time series prediction model ΔFs(t)=L({V}) is formed.
[0045] As a preferred embodiment, based on the trained line frequency difference timing prediction model, the line frequency of the camera is controlled by line frequency compensation, including: based on the trained line frequency difference timing prediction model, the line frequency compensation formula is used to control the line frequency of the camera; the line frequency compensation formula is: F't=Vt / Pa+ΔFs(t) / k
[0046] Among them, F't is the camera control line frequency, Vt is the speed of the object at time t, Pa is the horizontal pixel accuracy, ΔFs(t) is the trained line frequency difference timing prediction model, and k is the conversion coefficient between the line frequency of the image to be detected and the line frequency of the standard image.
[0047] As a preferred embodiment, the object is a vehicle.
[0048] In this embodiment, when the line frequency is calculated at time t in combination with the operation of the detection system, the speed data 30 seconds before time t is first read and the standard speed data {Vt} is screened out according to the training set establishment method, and the trained line frequency difference timing prediction model ΔFs(t)=L({Vt}) is used to use this value to perform real-time compensation for the standard line frequency (Ft=Vt / Pa) at time t, and the camera control line frequency F't=Vt / Pa+ΔFs(t) / k is obtained.
[0049] Of course, the method of the present invention is not limited to the vehicle field, but can also be promoted and applied in other industrial scenarios.
[0050] The camera line frequency control system provided by the present invention is described below. The camera line frequency control system described below and the camera line frequency control method described above can be referred to each other.
[0051] Please refer to Figure 3 , Figure 3 A schematic structural diagram of a camera line frequency control system provided by the present invention.
[0052] The present invention also provides a camera line frequency control system, including: a line frequency difference determination module 1, used to determine the line frequency difference according to the line frequency of a standard image and the line frequency of an image to be detected; the line frequency of the standard image is the line frequency of the object image captured by the camera when the object moves at a standard speed, and the line frequency of the image to be detected is the line frequency of the object image captured by the camera when the object moves at an actual speed; a data set establishment module 2, used to establish a line frequency difference timing prediction model data set based on the line frequency difference; the line frequency difference timing prediction model data set includes several groups of data pairs; the data pair includes the standard speed and line frequency difference of historical images; a model training module 3, used to train the line frequency difference timing prediction model according to the line frequency difference timing prediction model data set to obtain a trained line frequency difference timing prediction model; a control module 4, used to control the camera line frequency by adopting a line frequency compensation method based on the trained line frequency difference timing prediction model.
[0053] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4As shown, the electronic device may include: a processor (processor) 401, a communication interface (Communications Interface) 402, a memory (memory) 403 and a communication bus 404, wherein the processor 401, the communication interface 402, and the memory 403 communicate with each other through the communication bus 404. The processor 401 can call the logic instructions in the memory 403 to execute the camera line frequency control method, which includes: determining the line frequency difference according to the line frequency of the standard image and the line frequency of the image to be detected; the line frequency of the standard image is the line frequency of the object image captured by the camera when the object moves at the standard speed, and the line frequency of the image to be detected is the line frequency of the object image captured by the camera when the object moves at the actual speed; establishing a line frequency difference timing prediction model data set based on the line frequency difference; the line frequency difference timing prediction model data set includes several groups of data pairs; the data pair includes the standard speed and line frequency difference of the historical image; training the line frequency difference timing prediction model according to the line frequency difference timing prediction model data set to obtain a trained line frequency difference timing prediction model; based on the trained line frequency difference timing prediction model, using line frequency compensation to control the camera line frequency.
[0054] In addition, the logic instructions in the above-mentioned memory 403 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0055] On the other hand, the present invention also provides a computer program product, which includes a computer program, and the computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the camera line frequency control method provided by the above-mentioned methods, and the method includes: determining a line frequency difference according to the line frequency of a standard image and the line frequency of an image to be detected; the line frequency of the standard image is the line frequency of an object image captured by a camera when the object moves at a standard speed, and the line frequency of the image to be detected is the line frequency of an object image captured by a camera when the object moves at an actual speed; establishing a line frequency difference timing prediction model data set based on the line frequency difference; the line frequency difference timing prediction model data set includes several groups of data pairs; the data pair includes the standard speed and line frequency difference of historical images; training the line frequency difference timing prediction model according to the line frequency difference timing prediction model data set to obtain a trained line frequency difference timing prediction model; and controlling the camera line frequency by using line frequency compensation based on the trained line frequency difference timing prediction model.
[0056] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the camera line frequency control method provided by the above-mentioned methods, the method comprising: determining a line frequency difference according to the line frequency of a standard image and the line frequency of an image to be detected; the line frequency of the standard image is the line frequency of an object image captured by a camera when the object moves at a standard speed, and the line frequency of the image to be detected is the line frequency of an object image captured by a camera when the object moves at an actual speed; establishing a line frequency difference timing prediction model data set based on the line frequency difference; the line frequency difference timing prediction model data set includes several groups of data pairs; the data pairs include the standard speed and line frequency difference of historical images; training the line frequency difference timing prediction model according to the line frequency difference timing prediction model data set to obtain a trained line frequency difference timing prediction model; and controlling the camera line frequency by adopting line frequency compensation based on the trained line frequency difference timing prediction model.
[0057] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0058] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0059] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A camera line frequency control method, characterized in that: include: Determine the line frequency difference according to the line frequency of the standard image and the line frequency of the image to be detected; the line frequency of the standard image is the line frequency of the object image captured by the camera when the object moves at the standard speed, and the line frequency of the image to be detected is the line frequency of the object image captured by the camera when the object moves at the actual speed; Establishing a line frequency difference timing prediction model data set based on the line frequency difference; the line frequency difference timing prediction model data set includes a plurality of data pairs; the data pairs include a standard speed of a historical image and the line frequency difference; The line frequency difference timing prediction model is trained according to the line frequency difference timing prediction model data set to obtain a trained line frequency difference timing prediction model; Based on the trained line frequency difference timing prediction model, the camera line frequency is controlled by adopting a line frequency compensation method.
2. The camera line frequency control method according to claim 1, characterized in that: The step of determining the line frequency difference according to the line frequency of the standard image and the line frequency of the image to be detected comprises: Obtain a standard image and an image to be detected; Performing feature extraction and feature matching on the standard image and the image to be detected to obtain a spatial distribution map of feature pairs; the feature pairs include feature points on the standard image and matching feature points on the image to be detected; Determining the line frequency of the standard image and the line frequency of the image to be detected according to the spatial distribution diagram of the feature pairs; Converting the line frequency of the image to be detected into the actual line frequency at the standard speed; The line frequency difference is obtained by subtracting the line frequency of the standard image from the actual line frequency at the standard speed.
3. The camera line frequency control method according to claim 2, characterized in that: The step of extracting and matching features of the standard image and the image to be detected to obtain a spatial distribution map of feature pairs includes: Using a threshold segmentation algorithm to align the standard image with one end of the image to be detected; Using the SFIT feature extraction algorithm to extract feature points from the standard image and the image to be detected, respectively, to obtain feature points on the standard image and feature points on the image to be detected; The DMatch operator is used to pair the feature points on the standard image with the features on the image to be detected to obtain a spatial distribution map of the feature pairs.
4. The camera line rate control method according to claim 2, characterized in that: The determining the line frequency of the standard image and the line frequency of the image to be detected according to the spatial distribution diagram of the feature pair comprises: Determining the line frequency of the standard image according to the distance and time difference between any two feature points in the standard image; The line frequency of the image to be detected is determined according to the distance and time difference between any two feature points in the image to be detected.
5. The camera line frequency control method according to claim 1, characterized in that: The step of establishing a line frequency difference timing prediction model data set based on the line frequency difference includes: Read the speed data of the historical image in segments to determine an actual speed data sequence; Normalizing the actual speed data sequence to obtain a standard speed data sequence; The correlation relationship between the standard speed data sequence and the line frequency difference is established by using time distribution, and the line frequency difference timing prediction model data set is established; the line frequency difference timing prediction model data set includes a training set, a validation set and a test set.
6. The camera line rate control method according to claim 5, characterized in that: The step of training the line frequency difference timing prediction model according to the line frequency difference timing prediction model data set to obtain a trained line frequency difference timing prediction model includes: The LSTM model is trained according to the standard speed data sequence and the line frequency difference, and a cross entropy loss function is selected to obtain a trained line frequency difference time series prediction model.
7. The camera line rate control method according to claim 1, characterized in that: The method of controlling the camera line frequency by line frequency compensation based on the trained line frequency difference timing prediction model includes: Based on the trained line frequency difference timing prediction model, the line frequency compensation formula is used to control the camera line frequency; the line frequency compensation formula is: F't=Vt / Pa+ΔFs(t) / k Among them, F't is the camera control line frequency, Vt is the speed of the object at time t, Pa is the horizontal pixel accuracy, ΔFs(t) is the trained line frequency difference timing prediction model, and k is the conversion coefficient between the line frequency of the image to be detected and the line frequency of the standard image.
8. The camera line rate control method according to any one of claims 1 to 7, characterized in that: The object is a vehicle.
9. A camera line frequency control system, characterized in that: include: A line frequency difference determination module, used to determine the line frequency difference according to the line frequency of the standard image and the line frequency of the image to be detected; The line frequency of the standard image is the line frequency of the object image captured by the camera when the object moves at the standard speed, and the line frequency of the image to be detected is the line frequency of the object image captured by the camera when the object moves at the actual speed; A data set establishment module, used to establish a line frequency difference timing prediction model data set based on the line frequency difference; the line frequency difference timing prediction model data set includes a plurality of data pairs; the data pairs include a standard speed of a historical image and the line frequency difference; A model training module, used to train the line frequency difference timing prediction model according to the line frequency difference timing prediction model data set to obtain a trained line frequency difference timing prediction model; The control module is used to control the camera line frequency by adopting a line frequency compensation method based on the trained line frequency difference timing prediction model.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the camera line rate control method according to any one of claims 1 to 8 is implemented.