CN114842071A - Automatic image visual angle conversion method - Google Patents

Automatic image visual angle conversion method Download PDF

Info

Publication number
CN114842071A
CN114842071A CN202210439518.XA CN202210439518A CN114842071A CN 114842071 A CN114842071 A CN 114842071A CN 202210439518 A CN202210439518 A CN 202210439518A CN 114842071 A CN114842071 A CN 114842071A
Authority
CN
China
Prior art keywords
coordinate system
image
individual
individuals
population
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.)
Granted
Application number
CN202210439518.XA
Other languages
Chinese (zh)
Other versions
CN114842071B (en
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.)
South China University of Technology SCUT
Original Assignee
South China University of Technology SCUT
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 South China University of Technology SCUT filed Critical South China University of Technology SCUT
Priority to CN202210439518.XA priority Critical patent/CN114842071B/en
Publication of CN114842071A publication Critical patent/CN114842071A/en
Application granted granted Critical
Publication of CN114842071B publication Critical patent/CN114842071B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/16Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/60Rotation of whole images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • G06T2207/10012Stereo images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30244Camera pose
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Mathematical Optimization (AREA)
  • Computational Mathematics (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biophysics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Health & Medical Sciences (AREA)
  • Algebra (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Databases & Information Systems (AREA)
  • Computational Linguistics (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses an automatic image visual angle conversion method, which comprises the following steps: loading a photographic image and a plan, clicking and loading the photographic image and the loading plan, and selecting a target photographic image and a target plan in a path; connecting corresponding points of the photographic image and the plan, optimizing the optimal parameters of the conversion matrix by using a differential evolution algorithm, and converting the photographic image into the plan through the conversion matrix. In modeling, it is particularly important to estimate the true position of an object, and the error caused by directly extracting the position from an image to estimate the true position of the object is relatively large. In the invention, a differential evolution algorithm is adopted to convert the estimation problem of the real position of the object into a parameter optimization problem, and the optimal solution of the parameters of the visual angle conversion matrix is searched by utilizing the differential evolution algorithm, so that the conversion from a pixel coordinate system to a plane 2D coordinate system is realized, and the optimal coordinate system conversion effect is obtained. Experiments show that the method can effectively estimate the real position of the target in the image.

Description

Automatic image visual angle conversion method
Technical Field
The invention belongs to the field of software testing and intelligent computing, and particularly relates to an automatic image visual angle conversion method.
Background
The Differential Evolution algorithm (DE) was proposed in 1997 by Rainer storm and kennetprice on the basis of evolutionary ideas such as genetic algorithm, and is essentially a multi-objective (continuous variable) optimization algorithm (MOEAs) for solving an overall optimal solution in a multi-dimensional space. The source of the concept of differential evolution is the Genetic Algorithm (GA) proposed earlier, which simulates hybridization (cross), mutation (mutation) and replication (reproduction) in genetics to design genetic operators.
The differential evolution algorithm is a self-organizing minimization method, two randomly selected different vectors in a population are used for interfering the existing vectors, and each vector in the population needs to be interfered. It generates a new parameter vector by adding the weighted difference vector between two members of the population to the third member, which becomes a variant. Mixing the parameters of the variation vector with other predetermined target vector parameters according to a certain rule to generate an experimental vector, wherein the operation is crossed; if the cost function of the experimental vector is lower than that of the target, the experimental vector replaces the target vector in the next generation, and the operation becomes selection;
compared with a genetic algorithm, the differential evolution algorithm has the advantages that initial populations are randomly generated at the same point, the fitness value of each individual in the populations is used as a selection standard, and the main process also comprises three steps of variation, intersection and selection. The difference is that the genetic algorithm controls the parent hybridization according to the fitness value, the probability value of selecting the offspring generated after mutation is correspondingly larger in the probability of selecting the individual with large fitness value in the maximization problem. The differential evolution algorithm variation vector is generated by the parent differential vector, and is crossed with the parent individual vector to generate a new individual vector, and the new individual vector is directly selected with the parent individual. Obviously, the approximation effect of the differential evolution algorithm is more obvious compared with the genetic algorithm.
The differential evolution algorithm is mainly used for solving a real number optimization problem. The algorithm is a group-based adaptive global optimization algorithm, belongs to one of evolution algorithms, and has the characteristics of simple structure, easiness in implementation, high convergence speed, high robustness and the like, so that the algorithm is widely applied to various fields of data mining, mode recognition, digital filter design, artificial neural networks, electromagnetism and the like.
Data-driven modeling approaches have now become a popular and powerful approach to simulate complex systems, such as, for example, people systems (a. lerner, c. yiorgs, and l.dani. "windows by example," Computer Graphics forms. vol.26.no.3.blackwell Publishing Ltd,2007.), traffic systems (d.wilkie, s.janson, l.ming, "Flow redirection for datadrive traffic" and "ACM Transactions On Graphics (TOG) 32.4(2013): 89"), etc. The key idea of the data-driven approach is to train components of the model with data so that the trained model can fit real-world data. One of the most common data formats is images. With the rapid development of Image processing of pattern recognition technology, it becomes feasible to extract a position Image of an object (d.ryan, et al. "Crowd counting using multiple local defects," In Digital Image Computing: technologies and Applications,2009. DICTA' 09., pp.81-88.IEEE, 2009.). However, the images obtained are often distorted because the images are often not recorded in a perfect top-down view. The position of the object in the distorted image is inaccurate. Training models based on inaccurate data will reduce the accuracy of the training model.
Disclosure of Invention
The invention uses the searching and separating evolution algorithm in the problem of searching the optimal solution of the parameters of the visual angle conversion matrix, converts the estimation problem of the real position of the object into the parameter optimization problem, and searches the optimal solution of the parameters of the visual angle conversion matrix by using the differential evolution algorithm, thereby accurately estimating the real position of the object and solving the problem of inaccurate position of the object due to image distortion in the image processing problem.
The invention is realized by at least one of the following technical schemes.
An automatic image visual angle conversion method comprises the following steps:
loading a photographic image and a plane graph, clicking the loaded photographic image and the loaded plane graph, and selecting a target photographic image and a target plane graph in a path;
connecting corresponding points of the photographic image and the plan, optimizing the optimal parameters of the conversion matrix by using a differential evolution algorithm, and converting the photographic image into the plan through the conversion matrix.
Further, points in the photographic image that are points in the three-dimensional space are regarded as points in world coordinates, points in the plan view are regarded as points in the pixel coordinate system, and the conversion of the corresponding points of the two coordinate systems is determined by the conversion matrix.
Furthermore, accurate conversion matrix parameters are obtained by using the coordinates of the world coordinate system obtained by point drawing and the coordinates in the pixel coordinate system corresponding to the coordinates, so that the coordinates of the world coordinate system are converted into the coordinates of the pixel coordinate system, and the real position of the object is accurately estimated.
Further, the differential evolution algorithm comprises the following steps:
1) initialization
Randomly and uniformly generating M individuals in a solution space, wherein each individual is a parameter of a group of transformation matrixes, and each individual is composed of n-dimensional vectors:
X i (0)={x i,1 (0),x i,2 (0),x i,3 (0),…,x i,n (0)}
i=1,2,3,…,M
wherein M is the number of randomly transformed individuals, namely the number of randomly generated transformation matrixes; x i (0) The ith individual of the 0 th generation population in the solution space is the ith conversion matrix in the 0 th generation population; x is the number of i,n (0) Is X i (0) The medium nth vector is the nth parameter in the ith conversion matrix in the 0 th generation population;
performing mutation operation;
realizing individual variation through a differential strategy, wherein the differential strategy is to randomly select two different individuals in a population, and vector synthesis is carried out on the two different individuals after vector difference of the two different individuals is zoomed and then is subjected to vector synthesis with an individual to be varied; in the g-th iteration, 3 individuals X were randomly selected from the population p1 (g)、X p2 (g)、X p3 (g) And the selected individuals are different, the variation vectors generated by the three individuals are:
ΔP 2 ,P 3 (g)=X p2 (g)-X p3 (g)
H i (g)=X p1 (g)+F·ΔP 2 ,P 3 (g)
wherein, Δ P 2 ,P 3 (g)=X p2 (g)-X p3 (g) For the difference vector, F is the scaling factor; crossover operation
Figure BDA0003614526310000031
Wherein cr is a number of [0,1]Cross probability between v i,j V as crossing individuals i The value of the j-th dimension of (d); h is i,j To produce variant individuals; x is the number of i,j (g) The value of the j-dimension vector of the ith individual in the current g-generation population;
2) selection operation
Figure BDA0003614526310000041
For each individual, the resulting solution is better than or equal to the individual's solution by mutation, crossover, selection to total optima, X i (g +1) is the ith individual in the (g +1) th generation population; v i (g) Crossed individuals of the ith individual of the g generation population obtained by the crossed operation; x i (g) Is the ith individual of the population of the g generation.
Further, the j dimension value of the ith individual is as follows:
X i,j (0)=L j_min +rand(0,1)(L j_max -L j_min )
i=1,2,3,…,M
j=1,2,3,…,n
wherein L is j_min Is the lower bound of the j-th dimension vector value, L j_max Is the upper bound of the vector value of the j-th dimension.
Further, the scaling factor F is a random number between [0,1 ].
Further, the adaptive adjustment of the scaling factor F is as follows:
sorting three randomly selected individuals in the mutation operator from good to bad to obtain X b 、X m ,、X w Corresponding toFitness of f b 、f m 、f w The mutation operator is:
V i =X b +F i ·(X m -X w )
wherein, F i The scaling factor is the scaling factor of the ith individual in the population, and meanwhile, the value of F is adaptively changed according to the two individuals generating the differential vector:
Figure BDA0003614526310000042
F l =0.1,F u =0.9
wherein, F l To the lower bound of the scaling factor, F u Is the upper bound of the scaling factor.
Furthermore, the mutation operator is a fixed constant, or has the self-adaptive capacity of the mutation step length and the search direction, and performs corresponding automatic adjustment according to different objective functions.
Further, the objective function is defined as the sum of the euclidean distances of all points on two edges in the image coordinate system and their corresponding coordinates in the real world coordinate system:
φ(S)=∑ i |X i -X′ i |
wherein X i Is a point, X ', on both sides of the image' i Are corresponding points in the real world coordinate system.
Further, the adaptive adjustment of the cross probability cr is as follows:
Figure BDA0003614526310000051
wherein f is i Is an individual x i Fitness value of f min And f max Respectively the fitness values of the worst and best individual in the current population,
Figure BDA0003614526310000052
is the average value of the fitness of the current population, cr l And cr u Lower and upper limits of cr, respectively.
The differential evolution algorithm is a heuristic algorithm. In the searching process, the differential evolution algorithm can complete parameter optimization of the searching matrix by using the differential evolution algorithm based on the coordinate positions according to the corresponding positions between the images provided by the user, so that the corresponding positions of the target positions in the images are extracted. In order to further improve the global searching capability and efficiency of the algorithm, corresponding positions of multiple groups of target positions are extracted as much as possible, and the searching accuracy of the algorithm can be improved.
Compared with the prior art, the invention has the beneficial effects that:
it is proposed to estimate the true position of an object based on an evolutionary algorithm. Some reference information of the image is used to estimate a transformation matrix that transforms the image position to a real-world position. The problem of inaccurate estimated object coordinates caused by image distortion is effectively solved.
Drawings
FIG. 1 is a flow chart of an embodiment of an image conversion system operation;
FIG. 2 is an interface diagram of an image conversion system;
FIG. 3 is the original diagram of example 2;
FIG. 4 is a graph showing the results of the conversion in example 2.
Detailed Description
The method of the present invention is further described below with reference to the accompanying drawings.
The invention is applicable to processing raw images, describing and interpreting specific information in the image to apply to a certain transformation. For example: the noise reduction, contrast, rotation, and density calculation operations may be performed at the pixel level. The image view angle conversion enables a user to complete the operation without complex knowledge of the image and only with knowledge of the target characteristics.
In modeling, it is particularly important to estimate the true position of an object, and the error caused by directly extracting the position from an image to estimate the true position of the object is relatively large. In the image visual angle automatic conversion method, an evolutionary algorithm is adopted to convert the estimation problem of the real position of an object into a parameter optimization problem, and a differential evolutionary algorithm is utilized to search the optimal solution of the parameters of a visual angle conversion matrix, so that the conversion from a pixel coordinate system to a plane 2D coordinate system is realized, and the optimal coordinate system conversion effect is obtained. Experiments show that the method can effectively estimate the real position of the target in the image.
Example 1
(1) Loading a photographic image and a plan, clicking and loading the photographic image and the loading plan, and selecting a target photographic image and a target plan in a local path of a computer where the image is located;
(2) points are drawn according to corresponding points in the shot image and the plan image, the points in the shot image are points in a three-dimensional space (points in world coordinates), the points in the plan image are points in a pixel coordinate system, and the conversion of the corresponding points of the two coordinate systems is determined by a conversion matrix. The more the corresponding point groups of the connected camera image and the plane image are, the more the verification groups provided for the differential evolution algorithm are, so that the more accurate the conversion matrix parameters converted by the operation are.
The optimization content of this embodiment is 18 parameters of the transform matrix. Therefore, the more points are traced, the more corresponding points of the obtained world coordinate system in the pixel coordinate system are, the larger the search space is, and the more accurate the corresponding points are traced, the more accurate the calculated conversion array parameters are;
(3) after the point drawing is finished, clicking a running DE button (such as the DE button shown in FIG. 2), converting the matrix to start operation, and starting displaying an operation process by a progress bar;
(4) after the calculation is finished, a dialog box of' transformation matrix search is finished! "
(5) Clicking a confirmation button in the dialog box, and at the moment, clicking any point in the photographic image, and displaying a point on the planar image corresponding to the point on the planar image;
(6) at the same time of the calculation of the transformation matrix, 18 parameters of the transformation matrix are output in the disk.
Image processing refers to techniques for analyzing, processing, and manipulating images to meet visual, psychological, or other requirements. Image processing is one application of signal processing in the field of images. Most of the images are stored in digital form at present, and thus image processing is referred to as digital image processing in many cases. In addition, a processing method based on optical theory still occupies an important position. Image processing is a subclass of signal processing, and is also closely related to the fields of computer science, artificial intelligence, and the like.
Many of the conventional one-dimensional signal processing methods and concepts can still be directly applied to image processing, such as noise reduction, quantization, etc. However, the image is a two-dimensional signal, which has its own unique side, and the way and angle of processing is different from the one-dimensional signal.
The image processing according to the present invention is mainly to process coordinate information of a three-dimensional stereoscopic image into coordinates in a two-dimensional plane view. Four coordinate systems are involved in this image processing: world coordinate system, camera coordinate system, image coordinate system, pixel coordinate system. The image perspective conversion is the conversion between a pixel coordinate system and a world coordinate system.
A conversion relation exists between the coordinates of a world coordinate system (three-dimensional perspective) and the coordinates of a corresponding point in a plane pixel coordinate system (two-dimensional plane diagram), and the conversion is completed by a conversion matrix containing 18 parameters. The specific conversion is described in detail in the following description of the conversion of the world coordinate system into the pixel coordinate system. The optimized content in the invention is that the numerical values of 18 parameters of the conversion matrix containing 18 parameters are optimized by using a differential evolution algorithm, so that the accurate conversion matrix parameters can be obtained by using the coordinates of the world coordinate system obtained by point tracing and the coordinates in the pixel coordinate system corresponding to the coordinates, the conversion from the coordinates of the world coordinate system to the coordinates of the pixel coordinate system can be accurately realized, and the real position of the object can be accurately estimated.
(1) World coordinate system and camera coordinate system
From the world coordinate system to the camera coordinate system, rotation and translation are involved (in fact all movements can also be described by rotation matrices and translation vectors). And rotating different angles around different coordinate axes to obtain corresponding rotation matrixes. The translation between these two coordinate systems is:
Figure BDA0003614526310000081
wherein (X) C ,Y C ,Z C ) As the coordinates of the object in the camera coordinate system, (X) W ,Y W ,Z W ) Is the coordinate representation of the object in the world coordinate system.
From the world coordinate system to the camera coordinate system, rotation and translation are involved (in fact all movements can also be described by rotation matrices and translation vectors). And rotating different angles around different coordinate axes to obtain corresponding rotation matrixes.
Assuming that the angles phi, omega and theta required to rotate around the X, Y, Z axes from the world coordinate system to the camera coordinate system are obtained respectively, then the angles phi, omega and theta are obtained at this moment
Figure BDA0003614526310000082
t is a translation coordinate matrix:
Figure BDA0003614526310000083
(2) camera coordinate system and image coordinate system
From the camera coordinate system to the image coordinate system, belonging to perspective projection relation, from 3D to 2D. The conversion relation between the two coordinate systems is
Figure BDA0003614526310000084
Wherein (X) C ,Y C ,Z C ) Is the coordinate of the object in the camera coordinate system, and f is the camera focal length.
(3) Image coordinate system and pixel coordinate system
The pixel coordinate system and the image coordinate system are both on the imaging plane, except for the respective origin and measurement unit. The origin of the image coordinate system is the intersection of the camera optical axis and the imaging plane, typically the midpoint of the imaging plane or the principal point. The unit of an image coordinate system is mm and belongs to a physical unit, while the unit of a pixel coordinate system is pixel, and a pixel point is usually described as several rows and columns. The transition between the two is as follows: where dx and dy denote how much mm each column and each row respectively represents, i.e. 1pixel ═ dx mm, and s' denotes the skew factors caused by non-orthogonality.
Figure BDA0003614526310000091
Wherein
Figure BDA0003614526310000092
s is s' f, and (u, v) is a point coordinate on the pixel coordinate system, and (u) 0 ,v 0 ) The coordinates of the point on the plane coordinate system.
How a point is converted from the world coordinate system to the pixel coordinate system can be obtained through the conversion of the above four coordinate systems.
Figure BDA0003614526310000093
Wherein
Figure BDA0003614526310000094
Is a 3 x 4 matrix.
The invention optimizes the M through a differential evolution algorithm 1 ,M 2 ,M 3 The 18 parameters in the matrix are transformed.
FIG. 1 is a flow chart illustrating the algorithm optimization test case prioritization problem of the present invention. The following describes the specific implementation of the whole algorithm in steps with respect to the contents of the flow chart:
1) initialization
M individuals (each being a parameter of a set of transformation matrices) are generated randomly and uniformly in the solution space, each individual consisting of an n-dimensional vector (in the present invention, the value of n is 18, i.e., 18 parameters of a transformation matrix):
X i (0)={x i,1 (0),x i,2 (0),x i,3 (0),…,x i,n (0)}
i=1,2,3,…,M
wherein M is the number of randomly prepared individuals, namely the number of randomly generated conversion matrixes; x i (0) The ith individual of the 0 th generation population in the solution space is the ith conversion matrix in the 0 th generation population; x is the number of i,n (0) Is X i (0) The medium nth vector is the nth parameter in the ith conversion matrix in the 0 th generation population;
the j dimension value of the ith individual is as follows:
X i,j (0)=L j_min +rand(0,1)(L j_max -L j_min )
i=1,2,3,…,M
j=1,2,3,…,n
wherein L is j_min Is the lower bound of the j-th dimension vector value, L j_max Is the upper bound of the j dimension vector value; (in the present invention n has a value of 18, i.e. 18 parameters of the transformation matrix)
Performing mutation operation;
the individual variation is realized through a differential strategy, wherein the differential strategy is to randomly select two different individuals in a population, and vector synthesis is carried out on the two different individuals after vector difference of the two different individuals is scaled and then the vector difference is subjected to vector synthesis with an individual to be varied. In the g-th iteration, 3 individuals X were randomly selected from the population p1 (g)、X p2 (g)、X p3 (g) And the selected individuals are different, the variation vectors generated by the three individuals are:
ΔP 2 ,P 3 (g)=X p2 (g)-X p3 (g)
H i (g)=X p1 (g)+F·ΔP 2 ,P 3 (g)
wherein, Δ P 2 ,P 3 (g)=X p2 (g)-X p3 (g) Is a difference vector, F is a scaling factor;
the scaling factor F is set to a random number between [0,1 ];
and F, self-adaptive adjustment:
carrying out mutation on three randomly selected individuals in mutation operatorSorting from good to bad to obtain X b 、X m ,、X w The corresponding fitness is f b 、f m 、f w The mutation operator is:
V i =X b +F i ·(X m -X w )
F i a scaling factor for the ith individual in the population;
meanwhile, the value of F is changed in a self-adaptive manner according to two individuals generating the differential vector:
Figure BDA0003614526310000111
F l =0.1,F u =0.9
F l to the lower bound of the scaling factor, F u Is the upper bound of the scaling factor;
2) crossover operation
Figure BDA0003614526310000112
Wherein cr is a number of [0,1]Cross probability between, V i,j V as crossing individuals i The value of the j-th dimension of (d); h is i,j To produce variant individuals; x i,j (g) The value of the j-dimension vector of the ith individual in the current g-generation population;
the adaptive adjustment of the parameter cr is as follows:
Figure BDA0003614526310000113
wherein f is i Is an individual x i Fitness value of (f) min And f max Respectively the fitness values of the worst and best individual in the current population,
Figure BDA0003614526310000114
is the average value of the fitness of the current population, cr l And cr u Are respectively provided withIs the lower and upper limit of cr;
3) selection operation
Figure BDA0003614526310000115
For each individual, the resulting solution is better than or equal to the individual's overall best through variation, crossover, and selection. (X) i (g +1) is the ith individual in the population of the (g +1) th generation; v i (g) Crossed individuals of the ith individual of the g generation population obtained by the crossed operation; x i (g) Is the ith individual of the population of the g generation.
The parameters of the invention are set as follows: the population number N is 100 and the termination condition is 25000 iterations. The final results show that the algorithm of the present invention does not fall into local optimization in many experiments. In the initial stage, when the corresponding points of the given camera image and the given plane image are more, the image visual angle conversion effect is very good, and the accuracy of the image visual angle conversion is higher as the corresponding points of the given camera image and the given plane image are increased. This illustrates the use of a differential evolution algorithm for the image.
Example 2
(1) The method is applied to a data set of a new york central station scene. This data set was obtained from 33 minutes of video (original video and extracted tracks from download http:// www.ee.cuhk.edu.hk/xgwang/grand central. html).
(2) The data set includes 40000 person movement tracking record tuples (more than 6000000 tuples). Each tuple consists of an ID, an x value, a y value, and a timestamp. The reference information in the present embodiment is coordinates of four corners of a station square. The coordinates of the four corners are first estimated from the trajectory approximation:
C 1 =C right,top =(544,431)
C 2 =C right,bottom =(695,0)
C 3 =C left,top =(170,431)
C 4 =C left,bottom =(3,0)
the true position of the four corners is
R 1 =R right,top =(34,48)
R 2 =R right,bottom =(34,0)
R 3 =R left,top =(3,48)
R 4 =R left,bottom =(3,0)
(3) According to the above-mentioned conversion with respect to the world coordinate system to the pixel coordinate system, there are 18 parameters to be determined.
The 18 parameters in the transformation matrix are described as:
Figure BDA0003614526310000121
Figure BDA0003614526310000122
Figure BDA0003614526310000131
defining an objective function as
Figure BDA0003614526310000132
TM 1 、TM 2 、TM 3 Respectively correspond to the above M 1 、M 2 、M 3 Three transformation matrices. C 1 、C 2 ,、C 3 、C 4 And the estimated coordinates of the corresponding points of the upper right corner, the lower right corner, the upper left corner and the lower left corner are respectively corresponded. R 1 、R 2 、R 3 、R 4 And the real coordinates of corresponding points of the upper right corner, the lower right corner, the upper left corner and the lower left corner are respectively corresponded. Phi (S) is the objective function.
(4) The DE is used to search for the optimal values of the 18 parameters to minimize the objective function. In order to improve the robustness of the differential evolution algorithm, each generation and individual are randomly selected from [0,1] by a scaling factor F and a cross rate CR, and finally, the finally calculated quasi-transform matrix parameters are as follows:
Figure BDA0003614526310000133
Figure BDA0003614526310000134
Figure BDA0003614526310000135
(5) fig. 3 shows a rough simulation of the raw data and the transformed traces, respectively. It can be observed that the invention converts the original planar pattern of the pixel coordinate system into a rectangle like a trapezoid, and when looking down from the right, the two-dimensional information can be reflected more directly. The results show that the method can effectively estimate the real position of the object in the image.
Example 3
(1) The invention is applied to a scenario where a data set crosses a road. The video duration is 60 seconds and involves about 150 pedestrians. The sidewalk area of the crosswalk was a 11m 31m rectangle, and the pedestrian position was recorded every 0.5 s. The comparison shows that in the results of the linear fitting method, the two sides of the zebra stripe rectangle are not parallel, but almost parallel with our method. The method used by the invention can produce more realistic results. .
(2) In the study of this embodiment, the reference information is two edges of the zebra stripe region. The goal is to find the correct parameters in the transformation matrix to transform the warped trapezoid into a standard rectangle. Thus, the objective function is defined as the sum of the euclidean distances of all points on two edges in the image coordinate system and their corresponding coordinates in the real world coordinate system:
φ(S)=∑ i |X i -X′ i |
wherein X i Is a point, X ', on both sides of the image' i Are corresponding points in the real world coordinate system.
(3) The DE is used to search for the optimal values of the 18 parameters to minimize the objective function.
The preferred embodiments of the invention disclosed above are intended to be illustrative only. The preferred embodiments are not intended to be exhaustive or to limit the invention to the precise embodiments disclosed. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the invention and the practical application, to thereby enable others skilled in the art to best utilize the invention. The invention is limited only by the claims and their full scope and equivalents.

Claims (10)

1. An automatic image visual angle conversion method is characterized in that: the method comprises the following steps:
loading a photographic image and a plan, clicking and loading the photographic image and the loading plan, and selecting a target photographic image and a target plan in a path;
connecting corresponding points of the photographic image and the plan, optimizing the optimal parameters of the conversion matrix by using a differential evolution algorithm, and converting the photographic image into the plan through the conversion matrix.
2. The method for automatically converting an image viewing angle according to claim 1, wherein: points in the photographic image, which are points in the three-dimensional space, are regarded as points in world coordinates, points in the plan view are regarded as points in a pixel coordinate system, and the conversion of the corresponding points of the two coordinate systems is determined by a conversion matrix.
3. The method for automatically transforming an image viewing angle according to claim 2, wherein: and obtaining accurate conversion matrix parameters by using the coordinates of the world coordinate system obtained by point drawing and the coordinates in the pixel coordinate system corresponding to the coordinates, thereby realizing the conversion from the coordinates of the world coordinate system to the coordinates of the pixel coordinate system and further accurately estimating the real position of the object.
4. The method for automatically converting the visual angle of an image according to any one of claims 1 to 3, wherein: the differential evolution algorithm comprises the following steps:
1) initialization
Randomly and uniformly generating M individuals in a solution space, wherein each individual is a parameter of a group of transformation matrixes, and each individual is composed of n-dimensional vectors:
X i (0)={x i,1 (0),x i,2 (0),x i,3 (0),...,x i,n (0)}
i=1,2,3,...,M
wherein M is the number of randomly transformed individuals, namely the number of randomly generated transformation matrixes; x i (0) The ith individual of the 0 th generation population in the solution space is the ith conversion matrix in the 0 th generation population; x is the number of i,n (0) Is X i (0) The medium nth vector is the nth parameter in the ith conversion matrix in the 0 th generation population;
performing mutation operation;
realizing individual variation through a differential strategy, wherein the differential strategy is to randomly select two different individuals in a population, and vector synthesis is carried out on the two different individuals after vector difference of the two different individuals is zoomed and then is subjected to vector synthesis with an individual to be varied; in the g-th iteration, 3 individuals X were randomly selected from the population p1 (g)、X p2 (g)、X p3 (g) And the selected individuals are different, the variation vectors generated by the three individuals are:
ΔP 2 ,P 3 (g)=X p2 (g)-X p3 (g)
H i (g)=X p1 (g)+F·ΔP 2 ,P 3 (g)
wherein, Δ P 2 ,P 3 (g)=X p2 (g)-X p3 (g) For the difference vector, F is the scaling factor; crossover operation
Figure FDA0003614526300000021
Wherein cr is a number of [0,1]Cross probability between v i,j Is cross oneV of body i The value of the j-th dimension of (d); h is i,j To produce variant individuals; x is the number of i,j (g) The value of the j-dimension vector of the ith individual in the current g-generation population;
2) selection operation
Figure FDA0003614526300000022
For each individual, the resulting solution is better than or equal to the individual's solution by mutation, crossover, selection to total optima, X i (g +1) is the ith individual in the population of the (g +1) th generation; v i (g) Crossed individuals of the ith individual of the g generation population obtained by the crossed operation; x i (g) Is the ith individual of the population of the g generation.
5. The method of claim 4, wherein the method comprises: the j dimension value of the ith individual is as follows:
X i,j (0)=L j_min +rand(0,1)(L j_max -L j_min )
i=1,2,3,...,M
j=1,2,3,...,n
wherein L is j_min Is the lower bound of the j-th dimension vector value, L j_max Is the upper bound of the jth dimension vector value.
6. The method of claim 4, wherein the method comprises: the scaling factor F is a random number between [0,1 ].
7. The method of claim 4, wherein the method comprises: the adaptation of the scaling factor F is as follows:
sorting three randomly selected individuals in the mutation operator from good to bad to obtain X b 、X m ,、X w The corresponding fitness is f b 、f m 、f w Variance calculationThe method comprises the following steps:
V i =X b +F i ·(X m -X w )
wherein, F i The scaling factor of the ith individual in the population is obtained, and meanwhile, the value of F is adaptively changed according to the two individuals generating the difference vector:
Figure FDA0003614526300000031
F l =0.1,F u =0.9
wherein, F l To the lower bound of the scaling factor, F u Is the upper bound of the scaling factor.
8. The method of claim 7, wherein the method comprises: the mutation operator is a fixed constant, or has the self-adaptive capacity of the mutation step length and the search direction, and carries out corresponding automatic adjustment according to different objective functions.
9. The method of claim 8, wherein the method comprises: the objective function is defined as the sum of the Euclidean distances between all points on two edges in the image coordinate system and the corresponding coordinates in the real world coordinate system:
φ(S)=∑ i |X i -X′ i |
wherein X i Is a point, X ', on both sides of the image' i Are corresponding points in the real world coordinate system.
10. The method of claim 4, wherein the method comprises: the adaptive adjustment of the cross probability cr is as follows:
Figure FDA0003614526300000032
wherein f is i Is an individual x i Fitness value of f min And f max Respectively the fitness values of the worst and best individual in the current population,
Figure FDA0003614526300000033
is the average value of the fitness of the current population, cr l And cr u Lower and upper limits of cr, respectively.
CN202210439518.XA 2022-04-25 2022-04-25 Automatic conversion method for image viewing angle Active CN114842071B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210439518.XA CN114842071B (en) 2022-04-25 2022-04-25 Automatic conversion method for image viewing angle

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210439518.XA CN114842071B (en) 2022-04-25 2022-04-25 Automatic conversion method for image viewing angle

Publications (2)

Publication Number Publication Date
CN114842071A true CN114842071A (en) 2022-08-02
CN114842071B CN114842071B (en) 2024-05-24

Family

ID=82565826

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210439518.XA Active CN114842071B (en) 2022-04-25 2022-04-25 Automatic conversion method for image viewing angle

Country Status (1)

Country Link
CN (1) CN114842071B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102779207A (en) * 2012-06-19 2012-11-14 北京航空航天大学 Wing profile optimal design method of parallel difference evolutionary algorithm based on open computing language (Open CL)
CN105631844A (en) * 2014-10-28 2016-06-01 上海大学 Image camera calibration method
CN111416972A (en) * 2020-01-21 2020-07-14 同济大学 Three-dimensional imaging system and method based on axially adjustable cascade rotating mirror
WO2021218157A1 (en) * 2020-04-28 2021-11-04 福州大学 Discrete differential evolution-based multi-strategy optimization x-architecture minimum tree construction method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102779207A (en) * 2012-06-19 2012-11-14 北京航空航天大学 Wing profile optimal design method of parallel difference evolutionary algorithm based on open computing language (Open CL)
CN105631844A (en) * 2014-10-28 2016-06-01 上海大学 Image camera calibration method
CN111416972A (en) * 2020-01-21 2020-07-14 同济大学 Three-dimensional imaging system and method based on axially adjustable cascade rotating mirror
WO2021218157A1 (en) * 2020-04-28 2021-11-04 福州大学 Discrete differential evolution-based multi-strategy optimization x-architecture minimum tree construction method

Also Published As

Publication number Publication date
CN114842071B (en) 2024-05-24

Similar Documents

Publication Publication Date Title
Wang et al. Hf-neus: Improved surface reconstruction using high-frequency details
CN110263912B (en) Image question-answering method based on multi-target association depth reasoning
Wang et al. Self-supervised multiscale adversarial regression network for stereo disparity estimation
CN108038906B (en) Three-dimensional quadrilateral mesh model reconstruction method based on image
CN109558862A (en) The people counting method and system of attention refinement frame based on spatial perception
CN110728219A (en) 3D face generation method based on multi-column multi-scale graph convolution neural network
CN111625667A (en) Three-dimensional model cross-domain retrieval method and system based on complex background image
CN112085835B (en) Three-dimensional cartoon face generation method and device, electronic equipment and storage medium
Zhou et al. Refine-net: Normal refinement neural network for noisy point clouds
CN114463492B (en) Self-adaptive channel attention three-dimensional reconstruction method based on deep learning
CN115311502A (en) Remote sensing image small sample scene classification method based on multi-scale double-flow architecture
CN111460193A (en) Three-dimensional model classification method based on multi-mode information fusion
CN110909778A (en) Image semantic feature matching method based on geometric consistency
CN115661246A (en) Attitude estimation method based on self-supervision learning
Bounsaythip et al. Genetic algorithms in image processing-a review
US7486815B2 (en) Method and apparatus for scene learning and three-dimensional tracking using stereo video cameras
Wang et al. Improved surface reconstruction using high-frequency details
Chen et al. Multi-view Pixel2Mesh++: 3D reconstruction via Pixel2Mesh with more images
CN114842071B (en) Automatic conversion method for image viewing angle
CN113887536B (en) Multi-stage efficient crowd density estimation method based on high-level semantic guidance
CN115908697A (en) Generation model based on point cloud probability distribution learning and method thereof
CN115937520A (en) Point cloud moving target segmentation method based on semantic information guidance
CN118096836B (en) Target tracking method and system based on rotary constant-change network and triple-concentration mechanism
Fei et al. A GNN Architecture With Local and Global-Attention Feature for Image Classification
CN116228994B (en) Three-dimensional model acquisition method, device, equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant