CN108846861B - Image homography matrix calculation method and device, mobile terminal and storage medium - Google Patents

Image homography matrix calculation method and device, mobile terminal and storage medium Download PDF

Info

Publication number
CN108846861B
CN108846861B CN201810603608.1A CN201810603608A CN108846861B CN 108846861 B CN108846861 B CN 108846861B CN 201810603608 A CN201810603608 A CN 201810603608A CN 108846861 B CN108846861 B CN 108846861B
Authority
CN
China
Prior art keywords
image
transformation
homography
homography matrix
preset
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.)
Active
Application number
CN201810603608.1A
Other languages
Chinese (zh)
Other versions
CN108846861A (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.)
Guangzhou Maker Ray Intelligent Technology Co ltd
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Original Assignee
Guangzhou Maker Ray Intelligent Technology Co ltd
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Maker Ray Intelligent Technology Co ltd, Guangzhou Shiyuan Electronics Thecnology Co Ltd filed Critical Guangzhou Maker Ray Intelligent Technology Co ltd
Priority to CN201810603608.1A priority Critical patent/CN108846861B/en
Publication of CN108846861A publication Critical patent/CN108846861A/en
Application granted granted Critical
Publication of CN108846861B publication Critical patent/CN108846861B/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
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/08Projecting images onto non-planar surfaces, e.g. geodetic screens

Landscapes

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

Abstract

The invention provides a method and a device for calculating an image homography matrix, a mobile terminal and a storage medium, wherein the method comprises the following steps: acquiring image information of the image I and the image II, and acquiring a plurality of locally stored preset homography matrixes; respectively carrying out image transformation on the first image according to each preset homography matrix to obtain a corresponding transformation image, and carrying out image combination on all the transformation images and the second image to obtain multi-channel information; the method comprises the steps of inputting multi-channel information into a convolution network to output a plurality of transformation homography matrixes, and calculating the transformation homography matrixes according to a preset calculation rule to obtain a target homography matrix.

Description

Image homography matrix calculation method and device, mobile terminal and storage medium
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a method and an apparatus for calculating an image homography matrix, a mobile terminal, and a storage medium.
Background
With the development of the times, the living standard of people is continuously improved, the use of the camera is more and more frequent, and when the camera shoots images on the same scene at different visual angles, a unique optimal homography matrix exists between every two images. The matrix can transform one image into coincidence with the other image, and realizes complex computer vision tasks of image splicing, fusion, double-shot calibration, depth estimation and the like, so how to calculate the homography matrix of two images in the same scene is always the key point in the image processing technology.
The method adopted in the existing image homography matrix calculation method is to directly input two images into a convolution network so as to calculate a homography matrix between the two images.
In the existing image homography matrix calculation method, because two images are directly input into a convolution network, the information quantity of image overlapping in the convolution network is too small, so that the accuracy of the calculated homography matrix is low, and because the visual angle deviation of the two images is large, the overlapping part of the two images is difficult to cover by a small convolution kernel, so that the corresponding relation between the images is difficult to capture by the convolution network, and further the accuracy of the calculated homography matrix is low.
Disclosure of Invention
Based on this, an object of the embodiments of the present invention is to provide a method and an apparatus for calculating an image homography matrix with high homography matrix calculation accuracy, a mobile terminal, and a storage medium.
In a first aspect, the present invention provides a method for calculating an image homography matrix, the method comprising:
acquiring image information of the image I and the image II, and acquiring a plurality of locally stored preset homography matrixes;
respectively carrying out image transformation on the first image according to each preset homography matrix to obtain a corresponding transformation image, and carrying out image combination on all the transformation images and the second image to obtain multi-channel information;
and inputting the multi-channel information into a convolution network to output a plurality of transformation homography matrixes, and calculating the transformation homography matrixes according to a preset calculation rule to obtain a target homography matrix.
According to the image homography matrix calculation method, the image I is subjected to image transformation to obtain the design of the plurality of transformed images, so that the graphic information input to the convolution network is richer, the homography matrix calculation accuracy of the image homography matrix calculation method is improved, the overlapping degree between the image I and the image II can be increased through the transformation of the plurality of preset homography matrices, the influence of larger difference of visual angles of the two images is reduced, the expectation of the plurality of transformed homography matrices is obtained through calculation through the design of calculating the plurality of transformed homography matrices according to the preset calculation rule, and the calculation of the target homography matrix by the image homography matrix calculation method is more accurate.
Further, the step of image combining all of the transformed images with the second image comprises:
acquiring the quantity value of the transformed image, and adding 1 to the quantity value to construct image channels with the corresponding quantity after adding 1;
and respectively transmitting the image information of all the transformed images and the image information of the image II to different image channels.
Further, the step of calculating the plurality of transformation homography matrices according to a preset calculation rule includes:
respectively calculating the product of each transformation homography matrix and the preset homography matrix in the corresponding image channel to obtain a calculation homography matrix;
and calculating the average value of the sum of all the calculated homography matrixes to obtain the target homography matrix.
Further, the step of obtaining a plurality of locally stored preset homography matrices includes:
acquiring a locally stored standard homography matrix and image transformation times;
and carrying out corresponding disturbance transformation on the standard homography matrix according to the image transformation times so as to obtain the preset homography matrix with the number corresponding to the image transformation times.
Further, after obtaining the target homography matrix, the method further includes:
performing image transformation on the second image according to the target homography matrix to obtain a verification image;
judging whether the verification image is matched with the image or not;
if yes, judging that the calculation of the target homography matrix is correct;
if not, judging that the calculation of the target homography matrix is wrong, and sending out error prompt information.
Further, the step of determining whether the verification image matches the first image comprises:
respectively obtaining RGB values of pixel points on the verification image and the first image, and sequentially judging whether the RGB values of the pixel points on the verification image are the same as the RGB values of the pixel points at the same coordinate point on the first image so as to obtain different numerical values;
judging whether the different times of numerical values are smaller than a preset times of numerical values or not;
if yes, judging that the verification image is matched with the first image;
and if not, judging that the verification image does not match with the first image.
Further, before the step of inputting the multi-channel information into the convolutional network, the method further includes:
and acquiring the convolution network, and testing and training the convolution network.
In a second aspect, the present invention provides an image homography matrix calculation apparatus, comprising:
the acquisition module is used for acquiring image information of the image I and the image II and acquiring a plurality of locally stored preset homography matrixes, wherein the preset homography matrixes are obtained by carrying out multiple disturbance transformations on a standard homography matrix;
the image transformation module is used for respectively carrying out image transformation on the first image according to each preset homography matrix to obtain a plurality of transformation images, and carrying out image combination on all the transformation images and the second image to obtain multi-channel information;
and the matrix calculation module is used for inputting the multi-channel information into a convolution network so as to output a plurality of transformation homography matrixes, and calculating the transformation homography matrixes according to a preset calculation rule so as to obtain a target homography matrix.
Above-mentioned image homography matrix calculation device, through the design of image transform module, it is right image one carries out the image transformation and obtains a plurality ofly transform the image, so that it is right the graphic information of convolution network input is abundanter, has improved the precision that the homography matrix calculated, and is through a plurality of the transform of predetermineeing the homography matrix can increase image one with overlap degree between the image two has reduced and has received the great influence of two image visual angle differences, through the design of matrix calculation module, according to predetermine the calculation rule and be a plurality of transform homography matrix calculates, so that it is a plurality of to calculate transform homography matrix's expectation, make to the calculation of target homography matrix is more accurate.
In a third aspect, the present invention provides a mobile terminal, including a memory for storing a computer program and a processor for executing the computer program to make the mobile terminal execute the above image homography matrix calculation method.
In a fourth aspect, the present invention provides a storage medium having stored thereon a computer program for use in the above-described mobile terminal.
Drawings
FIG. 1 is a flowchart of a method for calculating an image homography matrix according to a first embodiment of the present invention;
FIG. 2 is a flowchart of a method for calculating an image homography matrix according to a second embodiment of the present invention;
FIG. 3 is a flowchart illustrating an embodiment of step S91 in FIG. 2;
FIG. 4 is a schematic structural diagram of an image homography matrix calculation apparatus according to a third embodiment of the present invention;
FIG. 5 is a schematic structural diagram of an image homography matrix calculation apparatus according to a fourth embodiment of the present invention;
Detailed Description
In order to facilitate a better understanding of the invention, the invention will be further explained below with reference to the accompanying drawings of embodiments. Embodiments of the present invention are shown in the drawings, but the present invention is not limited to the preferred embodiments described above. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
In the existing image processing method, the calculation of the homography matrix is an important part, one image can be converted to coincide with the other image through the homography matrix to realize complex computer vision tasks of image splicing, fusion, double-shot calibration, depth estimation and the like, but the existing image processing method carries out the calculation of the homography matrix by directly inputting the two images into a convolution network, and because the overlapped part of the two images is difficult to be covered by a small convolution kernel when the visual angle deviation of the two images is larger, the convolution network is difficult to capture the corresponding relation between the images, the precision of the calculated homography matrix is lower, and the calculated homography matrix is further inaccurate, therefore, the invention provides a convolution network based on multi-image combination to carry out the calculation of the homography matrix, and the overlapped degree between the two images is increased through the conversion of a plurality of homography matrices, the influence of larger difference of two image visual angles is reduced, and the plurality of homography matrixes output by the convolution network are calculated according to the preset calculation rule, so that the expectation of the plurality of homography matrixes is obtained through calculation, and the calculation of the target homography matrix is more accurate.
Referring to fig. 1, a flowchart of an image homography matrix calculation method according to a first embodiment of the present invention is shown, including steps S10 to S40.
Step S10, acquiring image information of the image I and the image II, and acquiring a plurality of locally stored preset homography matrixes;
the first image and the second image are images shot in the same scene at different angles, the embodiment is used for calculating a target homography matrix between the first image and the second image, and the target homography matrix can be used for image conversion, splicing, fusion, double-shot calibration and other functions between the first image and the second image.
Specifically, a plurality of preset homography matrices are locally stored in the embodiment, and the preset homography matrices are used for performing image conversion on the first image, so that the overlapping degree between the first image and the second image is increased, the influence of large visual angle difference between the first image and the second image is reduced, the calculation accuracy of the homography matrices is improved, and the locally stored preset homography matrices can be the same or different, preferably, the preset homography matrices are different from each other.
For example, when the image i and the image ii are the image M and the image N, respectively, in this embodiment, the present embodiment is configured to calculate the target homography matrix H between the image M and the image N, where the number of the locally stored preset homography matrices is N, and the preset homography matrices are homography matrices P1、P2、P3…PN
Step S20, respectively carrying out image transformation on the first image according to each preset homography matrix to obtain a corresponding transformation image;
in this embodiment, after the image transformation is performed on the first image according to each preset homography matrix, the corresponding number of different transformed images is obtained, and the image comparison information with the second image is improved by obtaining the design of the transformed images, so that the calculation accuracy of the target homography matrix is improved.
In particular, according to a homography matrix P1、P2、P3…PNImage transformation is performed on the images M to generate the images M respectively1Image M2Image M3… image MN
And step S30, performing image combination on all the transformed images and the second image to obtain multi-channel information.
And the multi-channel information comprises image information of all the transformation images and the image II.
Specifically, image M is displayed1Image M2Image M3… image MNAnd carrying out image combination with the image N to obtain the multi-channel information, wherein the number of channels in the multi-channel information is N + 1.
And step S40, inputting the multichannel information into a convolution network to output a plurality of transformation homography matrixes, and calculating the transformation homography matrixes according to a preset calculation rule to obtain a target homography matrix.
Preferably, before the step S40, the method further includes:
the method comprises the steps of obtaining the convolution network which is stored locally in advance, and testing and training the convolution network, so that data image information of the convolution network is richer, and the homography matrix obtained through solving and calculating is higher in precision.
Specifically, in this embodiment, the step of performing deep learning processing on the convolutional network is as follows:
acquiring two gray level images A and B of the same scene and corresponding homography matrix D0Randomly generating n homography matrices D1、D2、...DnTransforming image A to generate image C1、C2...Cn. Combining the image B, constructing images of n +1 channels, and combining the image C1、C2...CnAnd image B as input information in the deep learning process.
Due to D0For homographic transformation of image A to image B, DiFrom image A to image CiA homographic transformation matrix of (i 1, 2.. times.n), then image CiHomographic transformation matrix to image B to D0Di-1. Will matrix D0, D0Di-1And (i ═ 1, 2.. times, n) expanding into a column vector as an output label of the deep learning network, and inputting the column vector into the convolution network for deep learning so as to complete the deep learning process.
After the multi-channel information is input into the convolutional network, the transform homography matrix with the corresponding quantity is obtained through calculation of a plurality of convolutional layers, pooling layers and full-connection layers in the convolutional network.
In this embodiment, after obtaining a plurality of the transformation homography matrices, a product of each of the transformation homography matrices and the preset homography matrix in the corresponding image channel is respectively calculated to obtain a calculation homography matrix, and an average value of a sum of all the calculation homography matrices is calculated to obtain the target homography matrix.
Specifically, after the multi-channel image is input to the convolution network, N +1 transformation homography matrices can be calculated, and H can be obtained by calculating an average value of sums of all the calculation homography matrices.
In the embodiment, the first image is subjected to image transformation to obtain a plurality of designs of the transformed images, so that the graphic information input by the convolution network is richer, the calculation accuracy of the homography matrix of the image homography matrix calculation method is improved, the overlapping degree between the first image and the second image can be increased through the transformation of the plurality of preset homography matrices, the influence of the larger difference of the visual angles of the two images is reduced, and the expectation of the plurality of transformed homography matrices is obtained through calculation according to the design of calculating the plurality of transformed homography matrices according to the preset calculation rule, so that the calculation of the target homography matrix by the image homography matrix calculation method is more accurate.
Referring to fig. 2, a flowchart of an image homography matrix calculation method according to a second embodiment of the present invention is shown, and the method includes steps S11 to S111.
Step S11, acquiring image information of the first image and the second image, and acquiring a locally stored standard homography matrix and image transformation times;
the first image and the second image are images shot in the same scene at different angles, the embodiment is used for calculating a target homography matrix between the first image and the second image, and the target homography matrix can be used for image conversion, splicing, fusion, double-shot calibration and other functions between the first image and the second image.
The standard homography matrix is used for generating a plurality of different homography matrices, preferably, the standard homography matrix is a homography matrix of 3 × 3, and the image transformation times are the transformation times of the homography matrix set by a user, namely, the homography matrix of 3 × 3 is transformed by the corresponding times according to the values of the image transformation times.
For example, when the image one and the image two are the image M and the image N, respectively, in this embodiment, this embodiment is used to calculate the target homography matrix H between the image M and the image N.
Step S21, carrying out disturbance transformation of corresponding times on the standard homography matrix according to the image transformation times to obtain the preset homography matrix with the quantity corresponding to the image transformation times;
in this embodiment, the perturbation transformation is a random perturbation, and is configured to generate the corresponding number of the preset homography matrices, and the preset homography matrices are configured to perform image transformation on the first image, so as to increase the degree of overlap between the first image and the second image, reduce the influence of a large difference between the viewing angles of the first image and the second image, and improve the calculation accuracy of the homography matrices.
For example, when the image transformation times is 5, the standard homography matrix is P0By the pair P0After the disturbance transformation is carried out, a homography matrix P is obtained1、P2、P3、P4And P5
Step S31, respectively carrying out image transformation on the first image according to each preset homography matrix to obtain a corresponding transformation image;
in particular, according to a homography matrix P1、P2、P3、P4And P5Image transformation is performed on the images M to generate the images M respectively1Image M2Image M3Image M4And an image M5
Step S41, obtaining the quantity value of the transformed image, and adding 1 to the quantity value to construct the image channels with the corresponding quantity after adding 1;
the number value of the transformed image is obtained to facilitate the construction of the image channel, and since the image two needs to be combined with the transformed image, the number value needs to be increased by 1, for example, since the number of times of image transformation is 5, the number value generated is 5, and further the number of the image channels is 6, so 6 image channels are constructed.
Step S51, respectively transmitting the image information of all the transformed images and the image information of the image II to different image channels to obtain a multi-channel image;
and respectively transmitting the image information of the transformed image and the image information of the image II to different image channels, so that the two image information in one image channel are prevented, and the calculation accuracy of the image homography matrix calculation method on the target homography matrix is improved.
Step S61, inputting the multi-channel information into a convolution network to output a plurality of transformation homography matrixes, and respectively calculating the product of each transformation homography matrix and the preset homography matrix in the corresponding image channel to obtain a calculation homography matrix;
after the multi-channel information is input into the convolutional network, the transform homography matrix with the corresponding quantity is obtained through calculation of a plurality of convolutional layers, pooling layers and full-connection layers in the convolutional network.
For example, the transformation homography matrices obtained when the multi-channel information is input into the convolutional network are respectively Q0、Q1、Q2、Q3And Q4Respectively calculate, Q0And P1、Q1And P2、Q2And P3、Q3And P4、Q4And P5To obtain said computed homography matrix.
Step S71, calculating the average value of all the calculation homography matrixes to obtain the target homography matrix;
in this embodiment, after obtaining a plurality of the transformation homography matrices, a product of each of the transformation homography matrices and the preset homography matrix in the corresponding image channel is calculated to obtain a calculation homography matrix, and an average value of sums of all the calculation homography matrices is calculated to obtain the target homography matrix.
For example, when the calculated homography matrix is obtained as Q0P1+Q1P2+Q2P3+Q3P4+Q4P5In time, since the number of the image channels is 6, the calculation homography matrix is divided by 6 to obtain the target homography matrix H.
Preferably, the calculation formula of the target homography matrix is as follows:
Figure GDA0002681371620000091
in the above formula, n is the number value of the transformed image, and the value range of i is from 0 to the number of image transformation.
Step S81, carrying out image transformation on the image II according to the target homography matrix to obtain a verification image;
and performing image transformation on the second image according to the target homography matrix to obtain the design of the verification image, wherein the design is used for verifying whether the target homography matrix is correctly calculated or not
Step S91, judging whether the verification image is matched with the image;
please refer to fig. 3, which is a flowchart illustrating an embodiment of step S91 in fig. 2, including steps S911 to S914.
Step S911, respectively obtaining the RGB values of the pixel points on the verification image and the first image, and sequentially judging whether the RGB values of the pixel points on the verification image are the same as the RGB values of the pixel points on the same coordinate point on the first image so as to obtain different numerical values;
and judging whether the verification image is the same as the first image or not by adopting a mode of judging the RGB value of the pixel point.
Step S912, judging whether the different times are smaller than a preset times;
when the step S912 determines that the different times is smaller than the preset time value, step S913 is executed.
Step S913, determining that the verification image matches the first image.
When the step S912 determines that the different times is not less than the preset time value, step S914 is executed.
Step S914, determining that the verification image does not match the first image.
When the step S91 determines that the verification image matches the first image, step S101 is performed.
And S101, judging that the calculation of the target homography matrix is correct.
When the step S91 determines that the verification image does not match the first image, step S111 is performed.
And step S111, judging the calculation error of the target homography matrix, and sending error prompt information.
In the embodiment, the first image is subjected to image transformation to obtain a plurality of designs of the transformed images, so that the graphic information input by the convolution network is richer, the calculation accuracy of the homography matrix of the image homography matrix calculation method is improved, the overlapping degree between the first image and the second image can be increased through the transformation of the plurality of preset homography matrices, the influence of the larger difference of the visual angles of the two images is reduced, and the expectation of the plurality of transformed homography matrices is obtained through calculation according to the design of calculating the plurality of transformed homography matrices according to the preset calculation rule, so that the calculation of the target homography matrix by the image homography matrix calculation method is more accurate.
Referring to fig. 4, a schematic structural diagram of an image homography matrix calculation apparatus 100 according to a third embodiment of the present invention is shown, including:
the acquisition module 10 is configured to acquire image information of the first image and the second image, and acquire a plurality of locally stored preset homography matrices, where the plurality of preset homography matrices are obtained by performing multiple perturbation transformations on a standard homography matrix;
the image transformation module 20 is configured to perform image transformation on the first image according to each preset homography matrix to obtain a plurality of transformed images, and perform image combination on all the transformed images and the second image to obtain multi-channel information;
the matrix calculation module 30 is configured to input the multi-channel information into a convolutional network to output a plurality of transformation homography matrices, and calculate the plurality of transformation homography matrices according to a preset calculation rule to obtain a target homography matrix.
The image transformation module 20 includes:
a channel construction module 21, configured to obtain a quantity value of the transformed image, and add 1 to the quantity value to construct a corresponding number of image channels after adding 1;
and a channel marking module 22, configured to respectively transmit image information of all the transformed images and the image information of the second image to different image channels, and mark the image channel corresponding to the second image as a target channel.
The matrix calculation module 30 includes:
a first sub-calculation module 31, configured to calculate a product of each of the transformed homography matrices and the preset homography matrix in the corresponding image channel, respectively, so as to obtain a calculated homography matrix;
and a second sub-calculation module 32, configured to calculate an average value of all the calculated homography matrices according to the calculation result of the first sub-calculation module 31, so as to obtain the target homography matrix.
The acquisition module 10 includes:
the sub-acquisition module 11 is used for acquiring a locally stored standard homography matrix and image transformation times;
and a perturbation transformation module 12, configured to perform perturbation transformation on the standard homography matrix for corresponding times according to the image transformation times acquired by the sub-acquisition module 11, so as to obtain the preset homography matrices in a number corresponding to the image transformation times.
In this embodiment, through the design of the image transformation module 20, it is multiple to carry out image transformation on the first image to obtain a plurality of transformed images, so as to make the graphic information input to the convolutional network richer, improve the accuracy of the homography matrix calculation of the image homography matrix calculation device 100, and through a plurality of the transformation of the preset homography matrix, the degree of overlap between the first image and the second image can be increased, and the influence caused by the larger difference between the viewing angles of the two images is reduced, through the design of the matrix calculation module 30, it is multiple to calculate according to the preset calculation rule the transformed homography matrix, so that it is multiple to calculate the expectation of the transformed homography matrix, and it is more accurate to calculate the target homography matrix by the image homography matrix calculation device 100.
Referring to fig. 5, a schematic structural diagram of an image homography matrix calculation apparatus 100 according to a fourth embodiment of the present invention is shown, the fourth embodiment has a structure substantially the same as that of the third embodiment, and a difference therebetween is that the image homography matrix calculation apparatus 100 in this embodiment further includes:
and the verification transformation module 40 is configured to perform image transformation on the second image according to the target homography matrix to obtain a verification image.
And a judging module 50, configured to judge whether the verification image matches the image.
When the judging module 50 judges that the verification image is matched with the first image, the target homography matrix is judged to be calculated correctly;
when the judging module 50 judges that the verification image is not matched with the first image, the calculation error of the target homography matrix is judged, and an error prompt message is sent.
The judging module 50 includes:
the pixel module 51 is configured to obtain RGB values of the pixel points on the verification image and the first image, and sequentially determine whether the RGB values of the pixel points on the verification image are the same as the RGB values of the pixel points on the same coordinate point on the first image, so as to obtain different numerical values.
A sub-judgment module 52, configured to judge whether the different-order value is smaller than a preset-order value, and if so, judge that the verification image matches the first image; and if not, judging that the verification image does not match with the first image.
In this embodiment, the verification transformation module 40 is used to perform inverse transformation on the second image, and the determination module 50 determines whether the verification image obtained by inverse transformation matches the first image or not to determine whether the target homography matrix calculated by the matrix calculation module 30 is correct, so as to further improve the accuracy of calculating the target homography matrix in the image homography matrix calculation apparatus 100.
The embodiment also provides a mobile terminal, which comprises a memory and a processor, wherein the memory is used for storing a computer program, and the processor runs the computer program to enable the mobile terminal to execute the image homography matrix calculation method.
The present embodiment also provides a storage medium on which a computer program used in the above-mentioned mobile terminal is stored, which when executed, includes the steps of:
acquiring image information of the image I and the image II, and acquiring a plurality of locally stored preset homography matrixes;
respectively carrying out image transformation on the first image according to each preset homography matrix to obtain a corresponding transformation image, and carrying out image combination on all the transformation images and the second image to obtain multi-channel information;
and inputting the multi-channel information into a convolution network to output a plurality of transformation homography matrixes, and calculating the transformation homography matrixes according to a preset calculation rule to obtain a target homography matrix. The storage medium, such as: RO image M/RA image M, magnetic disk, optical disk, etc.
The above-described embodiments describe the technical principles of the present invention, and these descriptions are only for the purpose of explaining the principles of the present invention and are not to be construed as limiting the scope of the present invention in any way. Based on the explanations herein, those skilled in the art will be able to conceive of other embodiments of the present invention without inventive effort, which would fall within the scope of the present invention.

Claims (10)

1. An image homography matrix calculation method, characterized in that the method comprises:
acquiring image information of an image I and an image II, and acquiring a plurality of locally stored preset homography matrixes, wherein the preset homography matrixes are obtained by performing multiple disturbance transformations on a standard homography matrix;
respectively carrying out image transformation on the first image according to each preset homography matrix to obtain a corresponding transformation image, and carrying out image combination on all the transformation images and the second image to obtain multi-channel information;
and inputting the multi-channel information into a convolution network to output a plurality of transformation homography matrixes, and calculating the transformation homography matrixes according to a preset calculation rule to obtain a target homography matrix.
2. The method of claim 1, wherein the step of image combining all the transformed images with the second image comprises:
acquiring the quantity value of the transformed image, and adding 1 to the quantity value to construct image channels with the corresponding quantity after adding 1;
and respectively transmitting the image information of all the transformed images and the image information of the image II to different image channels.
3. The method according to claim 2, wherein the step of calculating the plurality of transformation homography matrices according to a preset calculation rule comprises:
respectively calculating the product of each transformation homography matrix and the preset homography matrix in the corresponding image channel to obtain a calculation homography matrix;
and calculating the average value of the sum of all the calculated homography matrixes to obtain the target homography matrix.
4. The method according to claim 1, wherein the step of obtaining a plurality of locally stored preset homography matrices comprises:
acquiring a locally stored standard homography matrix and image transformation times;
and carrying out corresponding disturbance transformation on the standard homography matrix according to the image transformation times so as to obtain the preset homography matrix with the number corresponding to the image transformation times.
5. The method of claim 1, wherein after obtaining the target homography, the method further comprises:
performing image transformation on the second image according to the target homography matrix to obtain a verification image;
judging whether the verification image is matched with the image or not;
if yes, judging that the calculation of the target homography matrix is correct;
if not, judging that the calculation of the target homography matrix is wrong, and sending out error prompt information.
6. The method according to claim 5, wherein the step of determining whether the verification image matches the first image comprises:
respectively obtaining RGB values of pixel points on the verification image and the first image, and sequentially judging whether the RGB values of the pixel points on the verification image are the same as the RGB values of the pixel points at the same coordinate point on the first image so as to obtain different numerical values;
judging whether the different times of numerical values are smaller than a preset times of numerical values or not;
if yes, judging that the verification image is matched with the first image;
and if not, judging that the verification image does not match with the first image.
7. The method of claim 1, wherein prior to the step of inputting the multi-channel information into a convolutional network, the method further comprises:
and acquiring the convolution network, and testing and training the convolution network.
8. An image homography matrix calculation apparatus, comprising:
the acquisition module is used for acquiring image information of the image I and the image II and acquiring a plurality of locally stored preset homography matrixes, wherein the preset homography matrixes are obtained by carrying out multiple disturbance transformations on a standard homography matrix;
the image transformation module is used for respectively carrying out image transformation on the first image according to each preset homography matrix to obtain a plurality of transformation images, and carrying out image combination on all the transformation images and the second image to obtain multi-channel information;
and the matrix calculation module is used for inputting the multi-channel information into a convolution network so as to output a plurality of transformation homography matrixes, and calculating the transformation homography matrixes according to a preset calculation rule so as to obtain a target homography matrix.
9. A mobile terminal, characterized by comprising a memory for storing a computer program and a processor for executing the computer program to cause the mobile terminal to perform the image homography matrix calculation method of any of claims 1 to 7.
10. A storage medium characterized in that it stores a computer program for use in a mobile terminal according to claim 9.
CN201810603608.1A 2018-06-12 2018-06-12 Image homography matrix calculation method and device, mobile terminal and storage medium Active CN108846861B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810603608.1A CN108846861B (en) 2018-06-12 2018-06-12 Image homography matrix calculation method and device, mobile terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810603608.1A CN108846861B (en) 2018-06-12 2018-06-12 Image homography matrix calculation method and device, mobile terminal and storage medium

Publications (2)

Publication Number Publication Date
CN108846861A CN108846861A (en) 2018-11-20
CN108846861B true CN108846861B (en) 2020-12-29

Family

ID=64211022

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810603608.1A Active CN108846861B (en) 2018-06-12 2018-06-12 Image homography matrix calculation method and device, mobile terminal and storage medium

Country Status (1)

Country Link
CN (1) CN108846861B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113992847A (en) * 2019-04-22 2022-01-28 深圳市商汤科技有限公司 Video image processing method and device
CN112907540B (en) * 2021-02-22 2024-05-14 浙江大华技术股份有限公司 Splice abnormality detection method, device, equipment and medium
CN113361542B (en) * 2021-06-02 2022-08-30 合肥工业大学 Local feature extraction method based on deep learning
CN113487580B (en) * 2021-07-16 2022-02-15 北京星天地信息科技有限公司 Unmanned aerial vehicle image overlapping degree calculation method and system based on polygon analysis

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101281640A (en) * 2007-04-05 2008-10-08 奥多比公司 Laying out multiple images
CN101882308A (en) * 2010-07-02 2010-11-10 上海交通大学 Method for improving accuracy and stability of image mosaic
CN101984463A (en) * 2010-11-02 2011-03-09 中兴通讯股份有限公司 Method and device for synthesizing panoramic image
CN104580933A (en) * 2015-02-09 2015-04-29 上海安威士科技股份有限公司 Multi-scale real-time monitoring video stitching device based on feature points and multi-scale real-time monitoring video stitching method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9305361B2 (en) * 2011-09-12 2016-04-05 Qualcomm Incorporated Resolving homography decomposition ambiguity based on orientation sensors
JP2015007866A (en) * 2013-06-25 2015-01-15 ローランドディー.ジー.株式会社 Projection image correction system, projection image correction method, projection image correction program, and computer-readable recording medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101281640A (en) * 2007-04-05 2008-10-08 奥多比公司 Laying out multiple images
CN101882308A (en) * 2010-07-02 2010-11-10 上海交通大学 Method for improving accuracy and stability of image mosaic
CN101984463A (en) * 2010-11-02 2011-03-09 中兴通讯股份有限公司 Method and device for synthesizing panoramic image
CN104580933A (en) * 2015-02-09 2015-04-29 上海安威士科技股份有限公司 Multi-scale real-time monitoring video stitching device based on feature points and multi-scale real-time monitoring video stitching method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Recovering Camera Field of View Lines by Using SIFT Algorithm and Homograph;Jun Yang et al.;《World Automation Congress 2012》;20121004;第1-4页 *
一种基于L_M算法的RANSAC图像拼接算法;姚佳宝等;《浙江理工大学学报(自然科学版)》;20150731;第33卷(第4期);第552-557页 *

Also Published As

Publication number Publication date
CN108846861A (en) 2018-11-20

Similar Documents

Publication Publication Date Title
CN108846861B (en) Image homography matrix calculation method and device, mobile terminal and storage medium
US20210034909A1 (en) Spatial transformer modules
CN109858445B (en) Method and apparatus for generating a model
US10885802B2 (en) System and method for validating honest test taking
CN105229703B (en) System and method for generating threedimensional model using the position data of sensing
JP2020523703A (en) Double viewing angle image calibration and image processing method, device, storage medium and electronic device
JPH10124658A (en) Method for correcting image distortion of camera by utilizing neural network
CN109754464B (en) Method and apparatus for generating information
CN105512637A (en) Image processing method and electric device
CN111429501A (en) Depth map prediction model generation method and device and depth map prediction method and device
CN114543797A (en) Pose prediction method and apparatus, device, and medium
CN110599532A (en) Depth estimation model optimization and depth estimation processing method and device for image
CN113516697A (en) Image registration method and device, electronic equipment and computer-readable storage medium
CN116597246A (en) Model training method, target detection method, electronic device and storage medium
CN115272667B (en) Farmland image segmentation model training method and device, electronic equipment and medium
CN113298098B (en) Fundamental matrix estimation method and related product
CN115527011A (en) Navigation method and device based on three-dimensional model
CN117252914A (en) Training method and device of depth estimation network, electronic equipment and storage medium
CN111145268A (en) Video registration method and device
CN110738111A (en) Multi-purpose-based matching and gesture recognition method, device and system
KR102536096B1 (en) Learning data generation method and computing device therefor
KR102551467B1 (en) Depth map image generation method and computing device therefor
US11721006B2 (en) Method and device for generating virtual reality data
US20240221200A1 (en) Method for identifying depths of images and related device
CN111062874B (en) Text image display 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