WO2020052068A1 - 用于确定图像间的几何变换关系的方法和装置 - Google Patents
用于确定图像间的几何变换关系的方法和装置 Download PDFInfo
- Publication number
- WO2020052068A1 WO2020052068A1 PCT/CN2018/116344 CN2018116344W WO2020052068A1 WO 2020052068 A1 WO2020052068 A1 WO 2020052068A1 CN 2018116344 W CN2018116344 W CN 2018116344W WO 2020052068 A1 WO2020052068 A1 WO 2020052068A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- row
- value
- image
- coordinates
- coordinate
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/30—Determination of transform parameters for the alignment of images, i.e. image registration
- G06T7/37—Determination of transform parameters for the alignment of images, i.e. image registration using transform domain methods
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/30—Determination of transform parameters for the alignment of images, i.e. image registration
- G06T7/33—Determination of transform parameters for the alignment of images, i.e. image registration using feature-based methods
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
Definitions
- Embodiments of the present application relate to the field of computer technology, and in particular, to a method and an apparatus for determining a geometric transformation relationship between images.
- the embodiments of the present application provide a method and a device for determining a geometric transformation relationship between images.
- an embodiment of the present application provides a method for determining a geometric transformation relationship between images.
- the method includes: acquiring a first image and acquiring a second image set, where the second image set includes at least two A second image; obtaining the coordinates of three non-collinear pixels in the first image to obtain a coordinate set; generating a target matrix according to the coordinate set; obtaining the second image for the second image in the second image set The coordinates of the pixel points corresponding to the pixels indicated by the coordinates in the coordinate set to obtain the corresponding coordinate set; according to the corresponding coordinate set, generate a target column vector that matches the number of columns of the target matrix; multiply the target matrix by the target column vector Transforming a column vector; determining a geometric transformation relationship between the first image and the second image according to the transformed column vector.
- obtaining the coordinates of three non-collinear pixel points in the first image includes: obtaining the coordinates of three non-collinear feature points in the first image.
- the method further includes: obtaining coordinates of feature points of the first image to obtain a first coordinate set; and for a second image in the second image set, obtaining the second image and the first coordinate set The coordinates of the feature points matched by the feature points indicated by the first coordinates in the second coordinate set are obtained; and based on the determined geometric transformation relationship between the first image and the second image and the first coordinate set, the second coordinate set is determined.
- the second coordinate serves as the target second coordinate, wherein the feature point indicated by the target second coordinate is a feature point that is mismatched.
- generating the target matrix according to the coordinate set includes generating a first matrix according to the coordinate set, and determining an inverse matrix of the first matrix as the target matrix.
- the corresponding coordinates in the corresponding coordinate set respectively indicate the first corresponding pixel point, the second corresponding pixel point, and the third corresponding pixel point; and the values of the elements in the target column vector are as follows: the elements of the first row The value of is the first coordinate of the first corresponding pixel, the value of the element in the second row is the second coordinate of the first corresponding pixel, and the value of the element in the third row is The coordinates of the first direction, the values of the elements in the fourth row are the second direction coordinates of the second corresponding pixels, the values of the elements in the fifth row are the first direction coordinates of the third corresponding pixels, and the values of the elements in the sixth row are The value is the second direction coordinate of the third corresponding pixel point.
- determining the geometric transformation relationship between the first image and the second image according to the transformed column vector includes: generating the geometric transformation relationship between the first image and the second image according to the transformed column vector.
- the value of the third element is the value of the element in the sixth row of the transformed column vector, the value of the first and second elements in the third row is zero, and the value of the third element in the third row is For
- the coordinates in the coordinate set respectively indicate the first pixel point, the second pixel point, and the third pixel point; and the values of the elements in the first matrix are as follows: the first element and the first element of the first row
- the value of the fourth element of the second line is the first direction coordinate of the first pixel
- the value of the second element of the first line and the fifth element of the second line is the second direction of the first pixel. Coordinates.
- the value of the third element of the first row and the sixth element of the second row is one.
- the value of the fourth element, the fifth element, and the sixth element of the first row is zero.
- the value of the first element, the second element, and the third element of the second row is zero, and the value of the first element of the third row and the fourth element of the fourth row are the first One direction coordinate, the second element of the third row and the fifth element of the fourth row are the second direction coordinates of the second pixel, the third element of the third row and the sixth of the fourth row
- the value of each element is one.
- the value of the fourth element, the fifth element, and the sixth element of the third row are zero.
- the value of the fourth element is zero.
- the value of one element, the second element, the third element is zero, the value of the first element of the fifth row and the fourth element of the sixth row are the first direction coordinates of the third pixel, and the fifth row
- the value of the second element of the sixth element and the fifth element of the sixth row are the coordinates in the second direction of the third pixel, and the value of the third element of the fifth row and the sixth element of the sixth row are one.
- the value of the fourth element, the fifth element, and the sixth element in the fifth row is zero, and the value of the first element, the second element, and the third element in the sixth row is zero.
- an embodiment of the present application provides an apparatus for determining a geometric transformation relationship between images.
- the apparatus includes: an obtaining unit configured to obtain a first image and a second image set, wherein the second image The set includes at least two second images; the above-mentioned obtaining unit is further configured to obtain the coordinates of three non-collinear pixel points in the first image to obtain a coordinate set; and the generating unit is configured to be based on the coordinate set, Generating a target matrix; a determining unit configured to obtain, for a second image in the second image set, the coordinates of the pixel points corresponding to the pixel points indicated by the coordinates in the coordinate set to obtain the corresponding coordinate set; Corresponding to the coordinate set, a target column vector matching the number of columns of the target matrix is generated; the target matrix is multiplied by the target column vector to obtain a transformed column vector; and the geometric transformation relationship between the first image and the second image is determined according to the transformed column vector.
- the acquisition unit is further configured to acquire coordinates of three non-collinear feature points of the first image.
- the above-mentioned obtaining unit is further configured to obtain coordinates of feature points of the first image to obtain a first coordinate set; and the above-mentioned determining unit is further configured to: for the second image in the second image set To obtain the coordinates of the feature points of the second image that match the feature points indicated by the first coordinates in the first coordinate set to obtain a second coordinate set; according to the determined geometric transformation relationship between the first image and the second image And the first coordinate set, determining the second coordinate from the second coordinate set as the target second coordinate, wherein the feature point indicated by the target second coordinate is a feature point that is mismatched.
- the generating unit is further configured to generate a first matrix according to the coordinate set, and determine an inverse matrix of the first matrix as a target matrix.
- the corresponding coordinates in the corresponding coordinate set respectively indicate the first corresponding pixel point, the second corresponding pixel point, and the third corresponding pixel point; and the values of the elements in the target column vector are as follows: the elements of the first row The value of is the first coordinate of the first corresponding pixel, the value of the element in the second row is the second coordinate of the first corresponding pixel, and the value of the element in the third row is The coordinates of the first direction, the values of the elements in the fourth row are the second direction coordinates of the second corresponding pixel, the values of the elements in the fifth row are the first direction coordinates of the third corresponding pixel, and the The value is the second direction coordinate of the third corresponding pixel point.
- the determining unit is further configured to generate a transformation matrix of three rows and three columns for representing a geometric transformation relationship between the first image and the second image according to the transformed column vector, wherein
- the value of the element of is as follows: the value of the first element of the first row is the value of the first row of the transformed column vector, and the value of the second element of the first row is the second of the transformed column vector.
- the value of the element of the row, the value of the third element of the first row is the value of the third row of the transformed column vector, and the value of the first element of the second row is the fourth of the transformed column vector.
- the value of the element of the row, the value of the second element of the second row is the value of the fifth row of the transformed column vector, and the value of the third element of the second row is the sixth row of the transformed column vector.
- the value of the element of, the first and second elements of the third row are zero, and the third element of the third row is one.
- the coordinates in the coordinate set respectively indicate the first pixel point, the second pixel point, and the third pixel point; and the values of the elements in the first matrix are as follows: the first element and the first element of the first row
- the value of the fourth element of the second line is the first direction coordinate of the first pixel
- the value of the second element of the first line and the fifth element of the second line is the second direction of the first pixel. Coordinates.
- the value of the third element of the first row and the sixth element of the second row is one.
- the value of the fourth element, the fifth element, and the sixth element of the first row is zero.
- the value of the first element, the second element, and the third element of the second row is zero, and the value of the first element of the third row and the fourth element of the fourth row are the first One direction coordinate, the second element of the third row and the fifth element of the fourth row are the second direction coordinates of the second pixel, the third element of the third row and the sixth of the fourth row
- the value of each element is one.
- the value of the fourth element, the fifth element, and the sixth element of the third row are zero.
- the value of the fourth element is zero.
- the values of the first element, the second element, and the third element are zero, and the values of the first element in the fifth row and the fourth element in the sixth row are the first direction coordinates of the third pixel.
- the value of the second element of the fifth row and the fifth element of the sixth row are the second direction coordinates of the third pixel, and the value of the third element of the fifth row and the sixth element of the sixth row are 1.
- the value of the fourth element, the fifth element, and the sixth element in the fifth row is zero, and the value of the first element, the second element, and the third element in the sixth row is zero.
- an embodiment of the present application provides an electronic device.
- the electronic device includes: one or more processors; a storage device configured to store one or more programs;
- the processor executes such that one or more processors implement the method as described in any implementation of the first aspect.
- an embodiment of the present application provides a computer-readable medium having stored thereon a computer program that, when executed by a processor, implements the method as described in any implementation manner of the first aspect.
- the method and device for determining a geometric transformation relationship between images provided in the embodiments of the present application are obtained by acquiring a first image and a second image set, where the second image set includes at least two second images; and acquiring the first
- the coordinates of the three non-collinear pixel points in the image are used to obtain the coordinate set;
- the target matrix is generated according to the coordinate set;
- the coordinates in the second image and the coordinate set are obtained
- the coordinates of the pixel corresponding to the indicated pixel point are used to obtain the corresponding coordinate set; according to the corresponding coordinate set, a target column vector matching the number of columns of the target matrix is generated; the target matrix is multiplied by the target column vector to obtain a transformed column vector;
- the vector determines the geometric transformation relationship between the first image and the second image, so that in the scene where the first image corresponds to a plurality of second images, by first generating a target matrix, the first image and each second image are solved.
- FIG. 1 is an exemplary system architecture diagram to which an embodiment of the present application can be applied;
- FIG. 1 is an exemplary system architecture diagram to which an embodiment of the present application can be applied;
- FIG. 2 is a flowchart of an embodiment of a method for determining a geometric transformation relationship between images according to the present application
- FIG. 3 is a flowchart of another embodiment of a method for determining a geometric transformation relationship between images according to the present application
- FIG. 4 is a schematic diagram of an application scenario of a method for determining a geometric transformation relationship between images according to an embodiment of the present application
- FIG. 5 is a schematic structural diagram of an embodiment of an apparatus for determining a geometric transformation relationship between images according to the present application
- FIG. 6 is a schematic structural diagram of a computer system suitable for implementing an electronic device according to an embodiment of the present application.
- Fig. 1 shows an exemplary architecture 100 of an embodiment of the method for determining the geometric transformation relationship between images or the apparatus for determining the geometric transformation relationship between images to which the present application can be applied.
- the system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105.
- the network 104 is a medium for providing a communication link between the terminal devices 101, 102, 103 and the server 105.
- the network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, and so on.
- the terminal devices 101, 102, 103 interact with the server 105 through the network 104 to receive or send messages and the like.
- Various client applications such as web browser applications, search applications, and image processing applications, can be installed on the terminal devices 101, 102, and 103.
- the terminal devices 101, 102, and 103 may be hardware or software.
- the terminal devices 101, 102, and 103 can be various electronic devices that support image storage and transmission, including but not limited to smartphones, tablets, e-book readers, laptop computers, and desktop computers.
- the terminal devices 101, 102, and 103 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (such as multiple software or software modules used to provide distributed services), or it can be implemented as a single software or software module. It is not specifically limited here.
- the server 105 may be a server that provides various services, such as an image processing server that processes images sent by the terminal devices 101, 102, and 103.
- the image processing server may process the received first image and at least two second images, and respectively solve the geometric transformation relationship between the first image and each second image, and may further feedback the result of the solution to the terminal device.
- first image and at least one second image may also be directly stored locally on the server 105, and the server 105 may directly extract and process the first image and at least two second images stored locally.
- the terminal devices 101, 102, 103 and the network 104 may not exist.
- the method for determining a geometric transformation relationship between images is generally executed by the server 105. Accordingly, a device for determining a geometric transformation relationship between images is generally provided in the server 105.
- the terminal devices 101, 102, 103 may also have image processing applications installed, and the terminal devices 101, 102, 103 may also process the first image and at least one second image based on the image processing applications.
- the method for determining the geometric transformation relationship between the images may also be executed by the terminal devices 101, 102, and 103.
- the apparatus for determining the geometric transformation relationship between the images may also be set on the terminal devices 101, 102. , 103 in.
- the exemplary system architecture 100 may be absent from the server 105 and the network 104.
- the server may be hardware or software.
- the server can be implemented as a distributed server cluster consisting of multiple servers or as a single server.
- the server can be implemented as multiple software or software modules (for example, to provide distributed services), or it can be implemented as a single software or software module. It is not specifically limited here.
- terminal devices, networks, and servers in FIG. 1 are merely exemplary. According to implementation needs, there can be any number of terminal devices, networks, and servers.
- a flowchart 200 of an embodiment of a method for determining a geometric transformation relationship between images according to the present application includes the following steps:
- Step 201 Acquire a first image and acquire a second image set.
- an execution subject (such as the server 105 in FIG. 1) for determining a geometric transformation relationship between images may first obtain a first image and a second image set from a local or other storage device.
- the second image set includes at least two second images. It should be understood that the above-mentioned execution body may also obtain the first image from a local, obtain a second image set from another storage device, or obtain the first image from another storage device, and obtain the second image set from the local.
- Step 202 Obtain the coordinates of three non-collinear pixel points in the first image to obtain a coordinate set.
- the three non-collinear pixels may be three non-collinear pixels arbitrarily selected from the first image, or may be three non-collinear pixels specified by a technician.
- Step 203 Generate a target matrix according to the coordinate set.
- the number of rows and columns of the target matrix, and the relationship between the value of each element in the target matrix and the coordinate set can be set in advance by a technician. Then, according to the specific coordinate set, the target matrix is obtained using various generation methods.
- the first matrix may be generated first according to the coordinate set. After that, the inverse matrix of the first matrix is determined as the target matrix. The number of rows and columns of the first matrix, and the relationship between the value of each element in the first matrix and the coordinate set can be set in advance by a technician. After that, the first matrix is obtained according to the specific coordinate set.
- the first matrix may be a square matrix with six rows and six columns.
- the values of the elements in the first matrix can be set as follows:
- the value of the first element of the first row and the fourth element of the second row are the coordinates of the first direction of the first pixel, and the second element of the first row and the fifth element of the second row are taken.
- the value is the second direction coordinate of the first pixel.
- the value of the third element of the first row and the sixth element of the second row is one.
- the fourth element, the fifth element, the Six elements have a value of zero, and the first, second, and third elements of the second row have a value of zero.
- the value of the first element of the third row and the fourth element of the fourth row are the first direction coordinates of the second pixel, and the second element of the third row and the fifth element of the fourth row are taken.
- the value is the second direction coordinate of the second pixel.
- the value of the third element of the third row and the sixth element of the fourth row is one.
- the fourth element, the fifth element, the third element of the third row Six elements have a value of zero, and the first, second, and third elements of the fourth row have a value of zero.
- the value of the first element of the fifth row and the fourth element of the sixth row are the coordinates of the first direction of the third pixel, and the value of the second element of the fifth row and the fifth element of the sixth row are The coordinates of the second direction of the third pixel point.
- the value of the third element of the fifth row and the sixth element of the sixth row are 1.
- the fourth element, the fifth element, and the sixth element of the fifth row have a value of 1.
- the value is zero, and the first, second, and third elements of the sixth row are zero.
- the following takes the coordinates of the first pixel as (X1, Y1), the coordinates of the second pixel as (X2, Y2), and the coordinates of the third pixel as (X3, Y3) as examples.
- the first matrix is constructed according to the above method. as follows:
- the inverse matrix of the first matrix can be used as the target matrix. That is, the target matrix is:
- the target matrix may also be a series of other matrices obtained by transforming the matrix of six rows and six columns by means of the identity matrix.
- a target matrix may also be generated based on a pre-trained target matrix generation model.
- the target matrix generation model can be used to represent the correspondence between the coordinate set and the target matrix.
- the target matrix generation model can be trained by the following steps:
- Step 1) obtain a large number of training samples.
- Each training sample includes a coordinate set composed of three coordinates, and a target matrix corresponding to the coordinate set.
- Step 2) Obtain an initial target matrix generation model.
- the initial target matrix generation model may be an untrained convolutional neural network or an untrained convolutional neural network.
- the parameters of the initial target matrix generation model (such as the initial parameters of each layer) can be continuously adjusted during the training process.
- Step 3 The coordinate set in the training sample is used as the input of the initialized target matrix generation model, and the target matrix corresponding to the input coordinate set is used as the expected output, and the target matrix generation model is trained.
- Step 204 For the second image in the second image set, determine the geometric transformation relationship between the first image and the second image through the following steps:
- Step 2041 Acquire the coordinates of the pixel points corresponding to the pixel points indicated by the coordinates in the coordinate set in the second image to obtain the corresponding coordinate set.
- the coordinates of the pixel points in the second image corresponding to the pixels in the first image indicated by the respective coordinates in the above-mentioned coordinate set may be obtained in advance, and various existing image matching may also be used.
- the algorithm obtains the coordinates of the pixel points in the second image corresponding to the pixel points indicated by the coordinates in the coordinate set.
- Step 2042 Generate a target column vector matching the number of columns of the target matrix according to the corresponding coordinate set.
- the target column vector matches the number of columns of the target matrix. Taking the target matrix of six rows and six columns in the above example as an example, correspondingly, the number of rows of the target column vector should be six rows.
- the relationship between the value of each element in the target column vector and the corresponding coordinate set can be set in advance by a technician. After that, the target column vector is obtained according to the specific corresponding coordinate set.
- the values of the elements in the target column vector are as follows: the values of the elements of the first row are the first direction coordinates of the first corresponding pixel, and the values of the elements of the second row are the second direction coordinates of the first corresponding pixel.
- the value of the element in the third row is the first direction coordinate of the second corresponding pixel, the value of the element in the fourth row is the second direction coordinate of the second corresponding pixel, and the value of the element in the fifth row is the first
- the coordinates of the first direction of the three corresponding pixel points, and the value of the element of the sixth row is the coordinates of the second direction of the third corresponding pixel point.
- the target column vector can be constructed as follows:
- the target column vector may also be a series of other column vectors obtained by transforming the target column vector of the six rows by means of the identity matrix.
- step 2043 the target matrix is multiplied by the target column vector to obtain a transformed column vector.
- Step 2044 Determine a geometric transformation relationship between the first image and the second image according to the transformed column vector.
- the elements in the transformed column vector can be used as geometric transformation parameters representing the geometric transformation relationship between the first image and the second image.
- the elements in the transformed column vector can be used as the geometric transformation parameters of the first image and the second image, and some existing applications that can implement geometric transformation can be used to determine the geometry between the first image and the second image. Transformation relationship.
- a transformation matrix may also be directly generated according to the transformed column vector, and the generated transformation matrix is used to represent the geometric transformation relationship between the first image and the second image.
- the obtained transformed column vector is a column vector of six rows.
- a transformation matrix of three rows and three columns can be constructed by using the six elements in the obtained transformed column vector.
- the values of the elements in the transformation matrix can be as follows:
- the value of the first element in the first row is the value of the element in the first row of the transformed column vector
- the value of the second element in the first row is the value of the element in the second row of the transformed column vector
- the value of the third element in the first row is the value of the element in the third row of the transformed column vector.
- the value of the first element in the second row is the value of the element in the fourth row of the transformed column vector
- the value of the second element in the second row is the value of the element in the fifth row of the transformed column vector
- the value of the third element in the second row is the value of the element in the sixth row of the transformed column vector.
- the first and second elements of the third line have a value of zero, and the third element of the third line have a value of one.
- the method for determining a geometric transformation relationship between images provided by the foregoing embodiments of the present application generates a target matrix according to the coordinates of three non-collinear pixel points in the first image, so that the first image and other multiple
- the geometric transformation of the first image and each second image can be directly determined according to the product of the target matrix and the target column vector constructed using the coordinates of the matched pixel points in the second image.
- the relationship enables the process of determining the target matrix in the process of solving the geometric transformation relationship between the first image and each second image, thereby speeding up the solution.
- FIG. 3 illustrates a flow 300 of still another embodiment of a method for determining a geometric transformation relationship between images.
- the process 300 of the method for determining a geometric transformation relationship between images includes the following steps:
- Step 301 Obtain a first image and a second image set.
- step 201 For the specific execution process of this step, reference may be made to the related description of step 201 in the embodiment corresponding to FIG. 2, and details are not described herein again.
- Step 302 Acquire the coordinates of three non-collinear feature points in the first image to obtain a coordinate set.
- various existing feature point extraction algorithms for images can be used to extract feature points in the first image. Then, three non-collinear feature points are selected from the feature points of the first image, and the coordinates of the selected three feature points are used to form a coordinate set.
- the three feature points may be three feature points of the first image arbitrarily selected, may also be selected by a preset feature point selection rule, or three feature points designated by a technician.
- Step 303 Generate a target matrix according to the coordinate set.
- Step 304 For the second image in the second image set, obtain the coordinates of the pixel points corresponding to the pixel points indicated by the coordinates in the coordinate set in the second image set to obtain the corresponding coordinate set; and generate a target corresponding to the target according to the corresponding coordinate set.
- a target column vector matching the number of columns of the matrix; multiplying the target matrix by the target column vector to obtain a transformed column vector; and determining a geometric transformation relationship between the first image and the second image according to the transformed column vector.
- steps 303 and 304 For specific implementation processes of the foregoing steps 303 and 304, reference may be made to the related description of steps 203 and 204 in the embodiment corresponding to FIG. 2, and details are not described herein again.
- Step 305 Acquire the coordinates of the feature points of the first image to obtain a first coordinate set.
- step 302 the execution process of step 302 described above may be specifically referred to, and the feature point extraction algorithm is used to obtain the coordinates of each feature point of the first image.
- Step 306 For the second image in the second image set, obtain the coordinates of the feature points of the second image that match the feature points indicated by the first coordinates in the first coordinate set, and obtain a second coordinate set; The geometric transformation relationship between the first image and the second image and the first coordinate set, and the second coordinate is determined from the second coordinate set as the target second coordinate.
- the second coordinate set may be collected and determined in advance, or may be directly obtained by using an image matching method.
- the feature point indicated by the target second coordinate may be a feature point that is mismatched.
- the target second coordinates can be determined from the second coordinate set by the following steps:
- Step 1) For each feature point in the first image, each feature point can be mapped to each second image by using the determined geometric transformation relationship with each second image, and each feature point can be mapped to the second image correspondingly.
- the coordinates in the image For each feature point in the first image, each feature point can be mapped to each second image by using the determined geometric transformation relationship with each second image, and each feature point can be mapped to the second image correspondingly. The coordinates in the image.
- Step 2) For each second image, obtain the coordinates corresponding to each feature point in the first image in the second image through step 1) above. After that, each feature point can be verified separately.
- the coordinates corresponding to the feature point in the second image determined according to the geometric transformation relationship may be compared with the obtained second coordinates that match the feature point, and the result may be determined through the comparison result. Whether the second coordinate matched by the feature points is a feature point that is mismatched, that is, whether it is a target feature point.
- the distance between the coordinate corresponding to the feature point in the second image and the obtained second coordinate that matches the feature point determined according to the geometric transformation relationship is less than a preset distance threshold, it can be considered as being related to the feature
- the second coordinate of the point match is a feature point that is correctly matched.
- the distance between the coordinate corresponding to the feature point in the second image determined according to the geometric transformation relationship and the obtained second coordinate that matches the feature point is greater than a preset distance threshold, it can be considered to be related to the
- the second coordinates of the feature point matches are the feature points that are mismatched.
- the feature points of the first image may be mapped to each second image according to the determined geometric transformation relationship.
- the second coordinate matching the feature point may be regarded as a feature point that is correctly matched.
- the second coordinate matching the feature point may be considered as a feature point that is mismatched.
- FIG. 4 is a schematic diagram of an application scenario of a method for determining a geometric transformation relationship between images according to this embodiment.
- the coordinates of three non-collinear feature points in the first image 401 are shown as reference numeral 403 in the figure, which are (X1, Y1), (X2, Y2), (X3, Y3). ).
- the second image set 402 includes multiple second images, and one of the second images 4021 is used as an example for description below.
- the target matrix 404 generated from the three non-collinear feature points in the first image 401 is as follows:
- the three feature points in the second image 4021 corresponding to the three feature points (X1, Y1), (X2, Y2), and (X3, Y3) in the first image 401 are shown as reference numeral 405 in the figure. They are: (X1 ⁇ , Y1 ⁇ ), (X2 ⁇ , Y2 ⁇ ), (X3 ⁇ , Y3 ⁇ ).
- the target column vector 406 can be generated as shown below:
- the target matrix 404 can be multiplied by the target column vector 406 to obtain a transformed column vector 407.
- the transformed column vector 407 is as follows:
- a transformation matrix 408 may be constructed according to the transformation column vector 407 to represent the geometric transformation relationship of the first image 401 and the second image 4021.
- the transformation matrix 408 is as follows:
- each first coordinate in the first coordinate set 409 may be transformed by using the above-mentioned transformation matrix 408 and mapped into the second image 4021 to obtain a mapped coordinate set 410.
- each coordinate in the second image 4021 that matches the first coordinate in the first coordinate set can be acquired to obtain a second coordinate set 411.
- the coordinates in the mapping coordinate set 410 and the second coordinate set 411 can be compared one by one. For example, the distance between the first coordinate in the mapping coordinate set 410 and the first coordinate in the second coordinate set 411 may be calculated. If the distance is greater than a preset threshold, the first coordinate in the second coordinate set 411 indicates The feature point of is a mismatched feature point corresponding to the feature point indicated by the first coordinate, and the feature point indicated by the first coordinate in the second coordinate set 411 may be determined as a target feature point.
- the mapped coordinate set 410 and the second coordinate set 411 can be compared in the same method, so as to determine the coordinate set 412 of the target feature point.
- the determined geometric transformation relationship may be used to find the feature points in the first image mapped to the feature points in the second image. Then, the feature points mapped in the second image may be compared with the feature points in the obtained second image that match the feature points of the first image, so as to filter out feature points that may be mismatched. Therefore, when there are a large number of second images, the above method not only speeds up the determination of the geometric transformation relationship between the first image and each second image, but also can further use the geometric transformation relationship to perform matching feature points in the second image. Geometric verification, which also speeds up the speed of geometric verification.
- this application provides an embodiment of an apparatus for determining a geometric transformation relationship between images.
- This apparatus embodiment is similar to the method embodiment shown in FIG. 2.
- the device can be specifically applied to various electronic devices.
- the apparatus 500 for determining a geometric transformation relationship between images includes an obtaining unit 501, a generating unit 502, and a determining unit 503.
- the obtaining unit 501 is configured to obtain a first image and a second image set, where the second image set includes at least two second images; the obtaining unit 501 is further configured to obtain three, three The coordinates of the non-collinear pixels to obtain a coordinate set; the generating unit 502 is configured to generate a target matrix according to the coordinate set; the determining unit 503 is configured to obtain the second image for the second image in the second image set The coordinates of the pixel points corresponding to the pixels indicated by the coordinates in the coordinate set to obtain the corresponding coordinate set; according to the corresponding coordinate set, generate a target column vector that matches the number of columns of the target matrix; multiply the target matrix by the target column vector Transforming a column vector; determining a geometric transformation relationship between the first image and the second image according to the transformed column vector.
- the apparatus 500 for determining a geometric transformation relationship between images the specific processing of the obtaining unit 501, the generating unit 502, and the determining unit 503 and the technical effects brought by them can be referred to the corresponding embodiment in FIG. 2, respectively. Relevant descriptions of step 201, step 202, step 203, and step 204 in the description are not repeated here.
- the foregoing obtaining unit 501 is further configured to: obtain coordinates of three non-collinear feature points of the first image.
- the above-mentioned obtaining unit 501 is further configured to: obtain coordinates of feature points of the first image to obtain a first coordinate set; and the above-mentioned determining unit 503 is further configured to be directed to a second The second image in the image set, obtains the coordinates of the feature points of the second image that match the feature points indicated by the first coordinates in the first coordinate set, and obtains a second coordinate set; according to the determined first image and the The geometric transformation relationship of the second image and the first coordinate set, and the second coordinate is determined from the second coordinate set as the target second coordinate, wherein the feature point indicated by the target second coordinate is a feature point that is mismatched.
- the generating unit 502 is further configured to generate a first matrix according to a coordinate set, and determine an inverse matrix of the first matrix as a target matrix.
- the corresponding coordinates in the corresponding coordinate set respectively indicate the first corresponding pixel point, the second corresponding pixel point, and the third corresponding pixel point; and the value of the element in the target column vector.
- the values of the elements in the first row are the coordinates of the first direction of the first corresponding pixel
- the values of the elements in the second row are the coordinates of the second direction of the first corresponding pixel
- the values of the elements in the third row are Is the first direction coordinate of the second corresponding pixel
- the value of the element in the fourth row is the second direction coordinate of the second corresponding pixel
- the value of the element in the fifth row is the first direction coordinate of the third corresponding pixel
- the value of the element in the sixth row is the second direction coordinate of the third corresponding pixel.
- the determining unit 503 is further configured to generate a three-row, three-column, three-row, three-column representation of a geometric transformation relationship between the first image and the second image according to the transformed column vector. Transformation matrix, where the values of the elements in the transformation matrix are as follows: the value of the first element of the first row is the value of the element in the first row of the transformed column vector, and the value of the second element in the first row is The value of the element of the second row of the transformed column vector, the value of the third element of the first row is the value of the element of the third row of the transformed column vector, and the value of the first element of the second row The value is the value of the element in the fourth row of the transformed column vector, the value of the second element in the second row is the value of the element in the fifth row of the transformed column vector, and the value of the third element in the second row To transform the values of the elements in the sixth row of the column vector, the values of the first and second elements in the third row are zero
- the coordinates in the coordinate set respectively indicate the first pixel point, the second pixel point, and the third pixel point; and the values of the elements in the first matrix are as follows: the first row
- the value of the first element and the fourth element of the second row are the coordinates of the first direction of the first pixel
- the value of the second element of the first row and the fifth element of the second row are The coordinates of the second direction of a pixel.
- the value of the third element of the first row and the sixth element of the second row is 1.
- the fourth element, the fifth element, and the sixth element of the first row is 1.
- the value of is zero, the value of the first element, the second element, and the third element of the second row is zero, and the value of the first element of the third row and the fourth element of the fourth row are Is the first direction coordinate of the second pixel, the second element of the third row and the fifth element of the fourth row are the second direction coordinate of the second pixel, and the third element of the third row
- the sixth element of the fourth row has a value of one, and the fourth element, the fifth element, and the sixth element of the third row
- the value is zero, the first element, the second element, and the third element of the fourth row have a value of zero, and the first element of the fifth row and the fourth element of the sixth row have a value of third
- the coordinates of the first direction of the pixel, the value of the second element of the fifth row and the value of the fifth element of the sixth row are the coordinates of the second direction of the third pixel, the third element of the fifth row, and the The value of the sixth element is one, the value of the fourth element,
- the apparatus obtains a first image and a second image set through an acquisition unit, where the second image set includes at least two second images; and three, out of the first images, are not shared.
- the coordinates of the pixel points of the line are used to obtain the coordinate set; the generating element eye generates the target matrix according to the coordinate set; and the determining unit obtains the coordinate indication in the second image and the coordinate set for the second image in the second image set.
- the coordinates of the pixel points corresponding to the pixel points of the corresponding pixel set to obtain the corresponding coordinate set; according to the corresponding coordinate set, a target column vector matching the number of columns of the target matrix is generated; the target matrix is multiplied by the target column vector to obtain a transformed column vector; according to the transformed column vector
- the geometric transformation relationship between the first image and the second image is determined, so that in a scene where the first image corresponds to a plurality of second images, by first generating a target matrix, the first image and each second image are solved.
- FIG. 6 illustrates a schematic structural diagram of a computer system 600 suitable for implementing an electronic device according to an embodiment of the present application.
- the electronic device shown in FIG. 6 is only an example, and should not impose any limitation on the functions and scope of use of the embodiments of the present application.
- the computer system 600 includes a central processing unit (CPU) 601, which can be loaded into a random access memory (RAM) 603 according to a program stored in a read-only memory (ROM) 602 or from a storage portion 608. Instead, perform various appropriate actions and processes.
- RAM random access memory
- ROM read-only memory
- various programs and data required for the operation of the system 600 are also stored.
- the CPU 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604.
- An input / output (I / O) interface 605 is also connected to the bus 604.
- the following components are connected to the I / O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), and the speaker; a storage portion 608 including a hard disk and the like; a communication section 609 including a network interface card such as a LAN card, a modem, and the like.
- the communication section 609 performs communication processing via a network such as the Internet.
- the driver 610 is also connected to the I / O interface 605 as necessary.
- a removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.
- the process described above with reference to the flowchart may be implemented as a computer software program.
- embodiments of the present disclosure include a computer program product including a computer program carried on a computer-readable medium, the computer program containing program code for performing a method shown in a flowchart.
- the computer program may be downloaded and installed from a network through the communication portion 609, and / or installed from a removable medium 611.
- CPU central processing unit
- the computer-readable medium of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the foregoing.
- the computer-readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programming read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the foregoing.
- a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in combination with an instruction execution system, apparatus, or device.
- a computer-readable signal medium may include a data signal that is included in baseband or propagated as part of a carrier wave, and which carries computer-readable program code. Such a propagated data signal may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
- the computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, and the computer-readable medium may send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device .
- Program code embodied on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
- each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, which contains one or more functions to implement a specified logical function Executable instructions.
- the functions noted in the blocks may also occur in a different order than those marked in the drawings. For example, two successively represented boxes may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved.
- each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts can be implemented by a dedicated hardware-based system that performs the specified function or operation , Or it can be implemented with a combination of dedicated hardware and computer instructions.
- the units described in the embodiments of the present application can be implemented by software or hardware.
- the described unit may also be provided in a processor, for example, it may be described as: a processor including an obtaining unit, a generating unit, and a determining unit. Among them, the names of these units do not constitute a limitation on the unit itself in some cases.
- the obtaining unit may also be described as a “unit for obtaining a first image and obtaining a second image set”.
- the present application also provides a computer-readable medium, which may be included in the electronic device described in the foregoing embodiments; or may exist alone without being assembled into the electronic device in.
- the computer-readable medium carries one or more programs.
- the electronic device is configured to obtain a first image and a second image set, where the second image set includes Including at least two second images; obtaining coordinates of three non-collinear pixel points in the first image to obtain a coordinate set; generating a target matrix according to the coordinate set; and obtaining for the second image in the second image set
- the coordinates of the pixel points corresponding to the pixels indicated by the coordinates in the coordinate set in the second image are used to obtain the corresponding coordinate set; according to the corresponding coordinate set, a target column vector matching the number of columns of the target matrix is generated; the target matrix is multiplied left
- the target column vector obtains a transformed column vector; and a geometric transformation relationship between the first image and the second image is determined according to the transformed column vector
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Image Analysis (AREA)
Abstract
用于确定图像间的几何变换关系的方法和装置。该方法包括:获取第一图像和包括至少两个第二图像的第二图像集合;根据获取的第一图像中的三个不共线的像素点的坐标,生成目标矩阵;针对第二图像集合中的第二图像,获取该第二图像中与坐标集合中的坐标指示的像素点对应的像素点的坐标,得到对应坐标集合;根据对应坐标集合,生成与目标矩阵的列数匹配的目标列向量;将目标矩阵左乘目标列向量得到变换列向量;根据变换列向量确定第一图像和该第二图像的几何变换关系。该方法实现了在第一图像对应多个第二图像的场景下,通过预先生成目标矩阵,以加快求解第一图像与各个第二图像的几何变换关系的运算速度。
Description
本专利申请要求于2018年9月12日提交的、申请号为201811060837.X、申请人为北京字节跳动网络技术有限公司、发明名称为“用于确定图像间的几何变换关系的方法和装置”的中国专利申请的优先权,该申请的全文以引用的方式并入本申请中。
本申请实施例涉及计算机技术领域,具体涉及用于确定图像间的几何变换关系的方法和装置。
在求解两幅图像间的几何变换关系时,一般是先在一副图像上确定不共线的三个像素点,以及在另一幅图像上确定相匹配的三个像素点,然后求解两幅图像间的变换矩阵。
在一对多的图像处理的场景下,即需要求解一副目标图像分别与多幅图像间的几何变换关系时,一般也是按照上述两幅图像间的几何变换关系求解过程分别求解目标图像与各个图像间的变换矩阵。
发明内容
本申请实施例提出了用于确定图像间的几何变换关系的方法和装置。
第一方面,本申请实施例提供了一种用于确定图像间的几何变换关系的方法,该方法包括:获取第一图像和获取第二图像集合,其中,第二图像集合中包括至少两个第二图像;获取第一图像中的、三个不共线的像素点的坐标,得到坐标集合;根据坐标集合,生成目标矩阵;针对第二图像集合中的第二图像,获取该第二图像中与坐标集合中的坐标指示的像素点对应的像素点的坐标,得到对应坐标集合;根据对 应坐标集合,生成与目标矩阵的列数匹配的目标列向量;将目标矩阵左乘目标列向量得到变换列向量;根据变换列向量确定第一图像和该第二图像的几何变换关系。
在一些实施例中,获取第一图像中的、三个不共线的像素点的坐标,包括:获取第一图像的、三个不共线的特征点的坐标。
在一些实施例中,上述方法还包括:获取第一图像的特征点的坐标,得到第一坐标集合;针对第二图像集合中的第二图像,获取该第二图像的、与第一坐标集合中的第一坐标指示的特征点匹配的特征点的坐标,得到第二坐标集合;根据确定的第一图像和该第二图像的几何变换关系和第一坐标集合,从第二坐标集合中确定第二坐标作为目标第二坐标,其中,目标第二坐标指示的特征点是错误匹配的特征点。
在一些实施例中,根据坐标集合,生成目标矩阵,包括:根据坐标集合,生成第一矩阵,以及将第一矩阵的逆矩阵确定为目标矩阵。
在一些实施例中,对应坐标集合中的对应坐标分别指示第一对应像素点、第二对应像素点、第三对应像素点;以及目标列向量中的元素的取值如下:第一行的元素的取值为第一对应像素点的第一方向坐标,第二行的元素的取值为第一对应像素点的第二方向坐标,第三行的元素的取值为第二对应像素点的第一方向坐标,第四行的元素的取值为第二对应像素点的第二方向坐标,第五行的元素的取值为第三对应像素点的第一方向坐标,第六行的元素的取值为第三对应像素点的第二方向坐标。
在一些实施例中,根据变换列向量确定第一图像和该第二图像之间的几何变换关系,包括:根据变换列向量生成用于表示第一图像和该第二图像之间的几何变换关系的、三行三列的变换矩阵,其中,变换矩阵中的元素的取值如下:第一行的第一个元素的取值为变换列向量的第一行的元素的取值,第一行的第二个元素的取值为变换列向量的第二行的元素的取值,第一行的第三个元素的取值为变换列向量的第三行的元素的取值,第二行的第一个元素的取值为变换列向量的第四行的元素的取值,第二行的第二个元素的取值为变换列向量的第五行的元素的取值,第二行的第三个元素的取值为变换列向量的第六行 的元素的取值,第三行的第一个元素和第二元素的取值为零,第三行的第三个元素的取值为一。
在一些实施例中,坐标集合中的坐标分别指示第一像素点、第二像素点、第三像素点;以及第一矩阵中的元素的取值如下:第一行的第一个元素和第二行的第四个元素的取值为第一像素点的第一方向坐标,第一行的第二个元素和第二行的第五个元素的取值为第一像素点的第二方向坐标,第一行的第三个元素和第二行的第六个元素的取值为一,第一行的第四个元素、第五个元素、第六个元素的取值为零,第二行的第一个元素、第二个元素、第三个元素的取值为零,第三行的第一个元素和第四行的第四个元素的取值为第二像素点的第一方向坐标,第三行的第二个元素和第四行的第五个元素的取值为第二像素点的第二方向坐标,第三行的第三个元素和第四行的第六个元素的取值为一,第三行的第四个元素、第五个元素、第六个元素的取值为零,第四行的第一个元素、第二个元素、第三个元素的取值为零,第五行的第一个元素和第六行的第四个元素的取值为第三像素点的第一方向坐标,第五行的第二个元素和第六行的第五个元素的取值为第三像素点的第二方向坐标,第五行的第三个元素和第六行的第六个元素的取值为一,第五行的第四个元素、第五个元素、第六个元素的取值为零,第六行的第一个元素、第二个元素、第三个元素的取值为零。
第二方面,本申请实施例提供了一种用于确定图像间的几何变换关系的装置,该装置包括:获取单元,被配置成获取第一图像和获取第二图像集合,其中,第二图像集合中包括至少两个第二图像;上述获取单元,进一步被配置成获取第一图像中的、三个不共线的像素点的坐标,得到坐标集合;生成单元,被配置成根据坐标集合,生成目标矩阵;确定单元,被配置成针对第二图像集合中的第二图像,获取该第二图像中与坐标集合中的坐标指示的像素点对应的像素点的坐标,得到对应坐标集合;根据对应坐标集合,生成与目标矩阵的列数匹配的目标列向量;将目标矩阵左乘目标列向量得到变换列向量;根据变换列向量确定第一图像和该第二图像的几何变换关系。
在一些实施例中,上述获取单元进一步被配置成:获取第一图像 的、三个不共线的特征点的坐标。
在一些实施例中,上述获取单元进一步被配置成:获取第一图像的特征点的坐标,得到第一坐标集合;以及上述确定单元,进一步被配置成:针对第二图像集合中的第二图像,获取该第二图像的、与第一坐标集合中的第一坐标指示的特征点匹配的特征点的坐标,得到第二坐标集合;根据确定的第一图像和该第二图像的几何变换关系和第一坐标集合,从第二坐标集合中确定第二坐标作为目标第二坐标,其中,目标第二坐标指示的特征点是错误匹配的特征点。
在一些实施例中,上述生成单元进一步被配置成:根据坐标集合,生成第一矩阵,以及将第一矩阵的逆矩阵确定为目标矩阵。
在一些实施例中,对应坐标集合中的对应坐标分别指示第一对应像素点、第二对应像素点、第三对应像素点;以及目标列向量中的元素的取值如下:第一行的元素的取值为第一对应像素点的第一方向坐标,第二行的元素的取值为第一对应像素点的第二方向坐标,第三行的元素的取值为第二对应像素点的第一方向坐标,第四行的元素的取值为第二对应像素点的第二方向坐标,第五行的元素的取值为第三对应像素点的第一方向坐标,第六行的元素的取值为第三对应像素点的第二方向坐标。
在一些实施例中,确定单元进一步被配置成:根据变换列向量生成用于表示第一图像和该第二图像之间的几何变换关系的、三行三列的变换矩阵,其中,变换矩阵中的元素的取值如下:第一行的第一个元素的取值为变换列向量的第一行的元素的取值,第一行的第二个元素的取值为变换列向量的第二行的元素的取值,第一行的第三个元素的取值为变换列向量的第三行的元素的取值,第二行的第一个元素的取值为变换列向量的第四行的元素的取值,第二行的第二个元素的取值为变换列向量的第五行的元素的取值,第二行的第三个元素的取值为变换列向量的第六行的元素的取值,第三行的第一个元素和第二元素的取值为零,第三行的第三个元素的取值为一。
在一些实施例中,坐标集合中的坐标分别指示第一像素点、第二像素点、第三像素点;以及第一矩阵中的元素的取值如下:第一行的 第一个元素和第二行的第四个元素的取值为第一像素点的第一方向坐标,第一行的第二个元素和第二行的第五个元素的取值为第一像素点的第二方向坐标,第一行的第三个元素和第二行的第六个元素的取值为一,第一行的第四个元素、第五个元素、第六个元素的取值为零,第二行的第一个元素、第二个元素、第三个元素的取值为零,第三行的第一个元素和第四行的第四个元素的取值为第二像素点的第一方向坐标,第三行的第二个元素和第四行的第五个元素的取值为第二像素点的第二方向坐标,第三行的第三个元素和第四行的第六个元素的取值为一,第三行的第四个元素、第五个元素、第六个元素的取值为零,第四行的第一个元素、第二个元素、第三个元素的取值为零,第五行的第一个元素和第六行的第四个元素的取值为第三像素点的第一方向坐标,第五行的第二个元素和第六行的第五个元素的取值为第三像素点的第二方向坐标,第五行的第三个元素和第六行的第六个元素的取值为一,第五行的第四个元素、第五个元素、第六个元素的取值为零,第六行的第一个元素、第二个元素、第三个元素的取值为零。
第三方面,本申请实施例提供了一种电子设备,该电子设备包括:一个或多个处理器;存储装置,用于存储一个或多个程序;当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现如第一方面中任一实现方式描述的方法。
第四方面,本申请实施例提供了一种计算机可读介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如第一方面中任一实现方式描述的方法。
本申请实施例提供的用于确定图像间的几何变换关系的方法和装置,通过获取第一图像和获取第二图像集合,其中,第二图像集合中包括至少两个第二图像;获取第一图像中的、三个不共线的像素点的坐标,得到坐标集合;根据坐标集合,生成目标矩阵;针对第二图像集合中的第二图像,获取该第二图像中与坐标集合中的坐标指示的像素点对应的像素点的坐标,得到对应坐标集合;根据对应坐标集合,生成与目标矩阵的列数匹配的目标列向量;将目标矩阵左乘目标列向量得到变换列向量;根据变换列向量确定第一图像和该第二图像的几 何变换关系,从而实现了在第一图像对应多个第二图像的场景下,通过先生成目标矩阵的方式,使得在求解第一图像与各个第二图像的几何变换关系时,只需要利用目标矩阵进行矩阵乘法即可完成求解过程,加快了求解过程的运算速度。
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:
图1是本申请的一个实施例可以应用于其中的示例性系统架构图;
图2是根据本申请的用于确定图像间的几何变换关系的方法的一个实施例的流程图;
图3是根据本申请的用于确定图像间的几何变换关系的方法的又一个实施例的流程图;
图4是根据本申请实施例的用于确定图像间的几何变换关系的方法的一个应用场景的示意图;
图5是根据本申请的用于确定图像间的几何变换关系的装置的一个实施例的结构示意图;
图6是适于用来实现本申请实施例的电子设备的计算机系统的结构示意图。
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关发明相关的部分。
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。
图1示出了可以应用本申请的用于确定图像间的几何变换关系的 方法或用于确定图像间的几何变换关系的装置的实施例的示例性架构100。
如图1所示,系统架构100可以包括终端设备101、102、103,网络104和服务器105。网络104用以在终端设备101、102、103和服务器105之间提供通信链路的介质。网络104可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。
终端设备101、102、103通过网络104与服务器105交互,以接收或发送消息等。终端设备101、102、103上可以安装有各种客户端应用,例如网页浏览器应用、搜索类应用、图像处理类应用等。
终端设备101、102、103可以是硬件,也可以是软件。当终端设备101、102、103为硬件时,可以是支持图像存储和传输的各种电子设备,包括但不限于智能手机、平板电脑、电子书阅读器、膝上型便携计算机和台式计算机等等。当终端设备101、102、103为软件时,可以安装在上述所列举的电子设备中。其可以实现成多个软件或软件模块(例如用来提供分布式服务的多个软件或软件模块),也可以实现成单个软件或软件模块。在此不做具体限定。
服务器105可以是提供各种服务的服务器,例如为终端设备101、102、103发送的图像进行处理的图像处理服务器。图像处理服务器可以对接收到的第一图像和至少两个第二图像进行处理,分别求解第一图像和各个第二图像的几何变换关系,进一步还可以将求解的结果反馈给终端设备。
需要说明的是,上述第一图像和至少连个第二图像也可以直接存储在服务器105的本地,服务器105可以直接提取本地所存储的第一图像和至少连个第二图像并进行处理,此时,可以不存在终端设备101、102、103和网络104。
需要说明的是,本申请实施例所提供的用于确定图像间的几何变换关系的方法一般由服务器105执行,相应地,用于确定图像间的几何变换关系的装置一般设置于服务器105中。
还需要指出的是,终端设备101、102、103中也可以安装有图像处理类应用,终端设备101、102、103也可以基于图像处理类应用对 第一图像和至少连个第二图像进行处理,此时,用于确定图像间的几何变换关系的方法也可以由终端设备101、102、103执行,相应地,用于确定图像间的几何变换关系的装置也可以设置于终端设备101、102、103中。此时,示例性系统架构100可以不存在服务器105和网络104。
需要说明的是,服务器可以是硬件,也可以是软件。当服务器为硬件时,可以实现成多个服务器组成的分布式服务器集群,也可以实现成单个服务器。当服务器为软件时,可以实现成多个软件或软件模块(例如用来提供分布式服务),也可以实现成单个软件或软件模块。在此不做具体限定。
应该理解,图1中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。
继续参考图2,其示出了根据本申请的用于确定图像间的几何变换关系的方法的一个实施例的流程200。该用于确定图像间的几何变换关系的方法包括以下步骤:
步骤201,获取第一图像和获取第二图像集合。
在本实施例中,用于确定图像间的几何变换关系的执行主体(如图1中的服务器105)可以先从本地或者其它存储设备获取第一图像和第二图像集合。其中,第二图像集合中包括至少两个第二图像。应当可以理解,上述执行主体也可以从本地获取第一图像,从其它存储设备获取第二图像集合,或者从其它存储设备获取第一图像,从本地获取第二图像集合。
步骤202,获取第一图像中的、三个不共线的像素点的坐标,得到坐标集合。
在本实施例中,三个不共线的像素点可以是从第一图像中任意选取的三个不共线的像素点,也可以是由技术人员所指定的三个不共线的像素点,还可以是根据预设的像素点选取方法(如先将第一图像划分为三部分图像区域,然后分别从三个图像区域中选一个像素点等)所选取的三个不共线的像素点的坐标。
步骤203,根据坐标集合,生成目标矩阵。
在本实施例中,目标矩阵的行数、列数以及目标矩阵中的各个元素的取值与坐标集合的关系可以预先由技术人员设置。之后,根据具体的坐标集合,利用各种生成方法得到目标矩阵。
可选地,可以根据坐标集合,先生成第一矩阵。之后,将第一矩阵的逆矩阵确定为目标矩阵。其中,第一矩阵的行数、列数以及第一矩阵中的各个元素的取值与坐标集合的关系可以预先由技术人员设置。之后,再根据具体的坐标集合,得到第一矩阵。
例如,以坐标集合中的坐标分别指示第一图像中的第一像素点、第二像素点和第三像素点为例,第一矩阵可以是六行六列的方阵。第一矩阵中的元素的取值可以设置如下:
第一行的第一个元素和第二行的第四个元素的取值为第一像素点的第一方向坐标,第一行的第二个元素和第二行的第五个元素的取值为第一像素点的第二方向坐标,第一行的第三个元素和第二行的第六个元素的取值为一,第一行的第四个元素、第五个元素、第六个元素的取值为零,第二行的第一个元素、第二个元素、第三个元素的取值为零。
第三行的第一个元素和第四行的第四个元素的取值为第二像素点的第一方向坐标,第三行的第二个元素和第四行的第五个元素的取值为第二像素点的第二方向坐标,第三行的第三个元素和第四行的第六个元素的取值为一,第三行的第四个元素、第五个元素、第六个元素的取值为零,第四行的第一个元素、第二个元素、第三个元素的取值为零。
第五行的第一个元素和第六行的第四个元素的取值为第三像素点的第一方向坐标,第五行的第二个元素和第六行的第五个元素的取值为第三像素点的第二方向坐标,第五行的第三个元素和第六行的第六个元素的取值为一,第五行的第四个元素、第五个元素、第六个元素的取值为零,第六行的第一个元素、第二个元素、第三个元素的取值为零。
下面以第一像素点的坐标为(X1,Y1),第二像素点的坐标为(X2, Y2),第三像素点的坐标为(X3,Y3)为例,按照上述方法构造第一矩阵如下:
之后,可以将第一矩阵的逆矩阵作为目标矩阵。即目标矩阵为:
应当可以理解,以上述六行六列的目标矩阵为例,目标矩阵也可以是在该六行六列的矩阵的基础上,借助单位矩阵进行变形得到的一系列其他矩阵。
可选地,还可以根据预先训练的目标矩阵生成模型来得到目标矩阵。其中,目标矩阵生成模型可以用于表征坐标集合与目标矩阵的对应关系。具体地,可以通过如下步骤训练得到目标矩阵生成模型:
步骤1),获取大量的训练样本。其中,每个训练样本包括三个坐标组成的坐标集合,以及该坐标集合对应的目标矩阵。
步骤2)获取初始化的目标矩阵生成模型。其中,初始化的目标矩阵生成模型可以是未经训练的卷积神经网络或未训练完成的卷积神经网络等。初始化的目标矩阵生成模型的参数(如各层的初始参数)可以在训练过程中不断地调整。
步骤3)将训练样本中的坐标集合作为初始化的目标矩阵生成模型的输入,将与输入的坐标集合对应的目标矩阵作为期望输出,训练得到目标矩阵生成模型。
步骤204,针对第二图像集合中的第二图像,通过如下步骤确定第一图像和该第二图像的几何变换关系:
步骤2041,获取该第二图像中与坐标集合中的坐标指示的像素点对应的像素点的坐标,得到对应坐标集合。
在本步骤中,可以获取预先设置的与上述坐标集合中的各个坐标指示的第一图像中的像素点对应的、第二图像中的像素点的坐标,也可以利用现有的各种图像匹配算法得到与坐标集合中的坐标指示的像素点对应的、第二图像中的像素点的坐标。
步骤2042,根据对应坐标集合,生成与目标矩阵的列数匹配的目标列向量。
在本步骤中,目标列向量与上述目标矩阵的列数相匹配。以上述示例中的六行六列的目标矩阵为例,对应地,目标列向量的行数应该为六行。目标列向量中的各个元素的取值与对应坐标集合的关系可以预先由技术人员设置。之后,再根据具体的对应坐标集合,得到目标列向量。
以对应坐标集合中的对应坐标分别指示第二图像中的第一对应像素点、第二对应像素点、第三对应像素点为例。目标列向量中的元素的取值如下:第一行的元素的取值为第一对应像素点的第一方向坐标,第二行的元素的取值为第一对应像素点的第二方向坐标,第三行的元素的取值为第二对应像素点的第一方向坐标,第四行的元素的取值为第二对应像素点的第二方向坐标,第五行的元素的取值为第三对应像素点的第一方向坐标,第六行的元素的取值为第三对应像素点的第二方向坐标。
下面以第一对应像素点的坐标为(X1`,Y1`),第二像素点的坐标为(X2`,Y2`),第三像素点的坐标为(X3`,Y3`)为例,按照上述方法可以构造目标列向量如下:
应当可以理解,以上述六行的目标列向量为例,目标列向量也可以是在该六行的目标列向量的基础上,借助单位矩阵进行变形得到的一系列其他的列向量。
步骤2043,将目标矩阵左乘目标列向量得到变换列向量。
步骤2044,根据变换列向量确定第一图像和该第二图像的几何变换关系。
在本实施例中,变换列向量中的元素即可作为表示第一图像和该第二图像的几何变换关系的几何变换参数。
可选地,可以将变换列向量中的元素作为第一图像和该第二图像的几何变换参数,利用现有的一些可以实现几何变换的应用来确定第一图像和第二图像之间的几何变换关系。
可选地,还可以直接根据变换列向量生成变换矩阵,以生成的变换矩阵来表示第一图像和该第二图像的几何变换关系。
以上述六行六列的目标矩阵和六行的目标列向量为示例,得到的变换列向量为六行的列向量。其中,以得到的变换列向量中的六个元素可以构造一个三行三列的变换矩阵。具体地,变换矩阵中的元素的取值可以如下:
第一行的第一个元素的取值为变换列向量的第一行的元素的取值,第一行的第二个元素的取值为变换列向量的第二行的元素的取值,第一行的第三个元素的取值为变换列向量的第三行的元素的取值。
第二行的第一个元素的取值为变换列向量的第四行的元素的取值,第二行的第二个元素的取值为变换列向量的第五行的元素的取值,第二行的第三个元素的取值为变换列向量的第六行的元素的取值。
第三行的第一个元素和第二元素的取值为零,第三行的第三个元 素的取值为一。
下面以变换列向量中的六个元素分别为“a”、“b”、“c”、“d”、“e”、“f”为示例,对应的变换矩阵可以为:
本申请的上述实施例提供的用于确定图像间的几何变换关系的方法通过预先根据第一图像中的三个不共线的像素点的坐标生成目标矩阵,从而在第一图像与其它多个第二图像的几何变换关系的确定过程中,可以直接根据目标矩阵与利用第二图像中的匹配的像素点的坐标构造的目标列向量的乘积确定出第一图像和各个第二图像的几何变换关系,使得第一图像和各个第二图像的几何变换关系的求解过程中,省去了确定目标矩阵的过程,从而加快了求解速度。
进一步参考图3,其示出了用于确定图像间的几何变换关系的方法的又一个实施例的流程300。该用于确定图像间的几何变换关系的方法的流程300,包括以下步骤:
步骤301,获取第一图像和获取第二图像集合。
本步骤的具体的执行过程可参考图2对应实施例中的步骤201的相关说明,在此不再赘述。
步骤302,获取第一图像中的、三个不共线的特征点的坐标,得到坐标集合。
在本实施例中,可以先利用现有的各种用于图像的特征点提取算法提取第一图像中的特征点。然后,从第一图像的特征点中选取三个不共线的特征点,并将选取的三个特征点的坐标组成坐标集合。
其中,三个特征点可以是任意选取的第一图像的三个特征点,也可以是预设的特征点选取规则选取的,还可以是由技术人员指定的三个特征点。
步骤303,根据坐标集合,生成目标矩阵。
步骤304,针对第二图像集合中的第二图像,获取该第二图像中 与坐标集合中的坐标指示的像素点对应的像素点的坐标,得到对应坐标集合;根据对应坐标集合,生成与目标矩阵的列数匹配的目标列向量;将目标矩阵左乘目标列向量得到变换列向量;根据变换列向量确定第一图像和该第二图像的几何变换关系。
上述步骤303和304的具体的执行过程可参考图2对应实施例中的步骤203和204的相关说明,在此不再赘述。
步骤305,获取第一图像的特征点的坐标,得到第一坐标集合。
在本实施例中,具体可以参考上述步骤302的执行过程,利用特征点提取算法得到第一图像的各个特征点的坐标。
步骤306,针对第二图像集合中的第二图像,获取该第二图像的、与第一坐标集合中的第一坐标指示的特征点匹配的特征点的坐标,得到第二坐标集合;根据确定的第一图像和该第二图像的几何变换关系和第一坐标集合,从第二坐标集合中确定第二坐标作为目标第二坐标。
在本实施例中,第二坐标集合可以是预先采集并确定的,也可以是直接利用图像匹配方法匹配得到的。其中,目标第二坐标指示的特征点可以是错误匹配的特征点。
可选地,可以通过如下步骤从第二坐标集合中确定目标第二坐标:
步骤1),针对第一图像中的各个特征点,可以利用确定的与各个第二图像的几何变换关系,将各个特征点分别映射到各个第二图像中,得到各个特征点对应映射在第二图像中的坐标。
步骤2),针对每个第二图像,通过上面步骤1)得到第一图像中的各个特征点对应在该第二图像中的坐标。之后,可以对每个特征点进行分别校验。
具体地,针对每个特征点,可以将根据几何变换关系确定的该特征点对应在第二图像中的坐标与获取到的、与该特征点匹配的第二坐标进行比较,通过比较结果确定该特征点匹配的第二坐标是否是错误匹配的特征点,即是否是目标特征点。
例如,若根据几何变换关系确定的该特征点对应在第二图像中的坐标与获取到的、与该特征点匹配的第二坐标之间的距离小于预设的距离阈值,可以认为与该特征点匹配的第二坐标为正确匹配的特征点。 相反地,若根据几何变换关系确定的该特征点对应在第二图像中的坐标与获取到的、与该特征点匹配的第二坐标之间的距离大于预设的距离阈值,可以认为与该特征点匹配的第二坐标为错误匹配的特征点。
可选地,还可以先根据确定的几何变换关系,将第一图像的特征点分别映射到各个第二图像中。针对第一图像的各个特征点,若该特征点映射到第二图像中的坐标指示的位置在预设的图像区域中,可以认为与该特征点匹配的第二坐标为正确匹配的特征点。相反地,若该特征点映射到第二图像中的坐标指示的位置不在预设的图像区域中,可以认为与该特征点匹配的第二坐标为错误匹配的特征点。
继续参见图4,图4是根据本实施例的用于确定图像间的几何变换关系的方法的应用场景的一个示意图。在图4的应用场景中,第一图像401中的三个不共线的特征点的坐标如图中标号403所示,分别为(X1,Y1)、(X2,Y2),(X3,Y3)。第二图像集合402中包括多张第二图像,下面以其中的一张第二图像4021为例来说明。根据第一图像401中的三个不共线的特征点生成目标矩阵404如下所示:
获取第二图像4021中与上述第一图像401中的(X1,Y1)、(X2,Y2),(X3,Y3)三个特征点分别对应的三个特征点如图中标号405所示,分别为:(X1`,Y1`)、(X2`,Y2`),(X3`,Y3`)。之后,可以生成目标列向量406如下所示:
之后,可以将目标矩阵404左乘目标列向量406,得到变换列向量407。其中,变换列向量407如下所示:
然后,可以根据变换列向量407,构造变换矩阵408来表示第一图像401和第二图像4021的几何变换关系。其中,变换矩阵408如下所示:
之后,可以获取第一图像401的特征点的坐标,得到第一坐标集合409。然后,可以将第一坐标集合409中的各个第一坐标,利用上述变换矩阵408进行转换,映射到第二图像4021中,得到映射坐标集合410。接着,可以获取第二图像4021中的与第一坐标集合中的第一坐标匹配的各个坐标,得到第二坐标集合411。
之后,可以将映射坐标集合410和第二坐标集合411中的坐标一一比对。例如,可以计算映射坐标集合410中的第一个坐标和第二坐标集合411中的第一个坐标的距离,若距离大于预设的阈值,那么第二坐标集合411中的第一个坐标指示的特征点是对应的第一坐标指示的特征点的错误匹配的特征点,可以将第二坐标集合411中的第一个坐标指示的特征点确定为一个目标特征点。
类似地,可以用同样的方法比较映射坐标集合410和第二坐标集合411,从而确定出目标特征点的坐标集合412。
本申请的上述实施例提供的用于确定图像间的几何变换关系的方法在确定出第一图像分别与第二图像集合中的各个第二图像的几何变换关系之后,对于每个第二图像,可以进一步地利用确定出的几何变换关系,求出第一图像中的特征点映射在第二图像中的特征点。之后,可以根据映射在第二图像中的特征点与获取到的第二图像中与第一图像的特征点匹配的特征点进行比较,从而筛选出可能是错误匹配的特征点。因此,在有大量第二图像时,通过上述方法不仅加快了确定第一图像与各个第二图像的几何变换关系的速度,而且可以进一步利用几何变换关系对第二图像中的匹配的特征点进行几何校验,从而也加快了几何校验的速度。
进一步参考图5,作为对上述各图所示方法的实现,本申请提供了用于确定图像间的几何变换关系的装置的一个实施例,该装置实施例与图2所示的方法实施例相对应,该装置具体可以应用于各种电子设备中。
如图5所示,本实施例提供的用于确定图像间的几何变换关系的装置500包括获取单元501、生成单元502和确定单元503。其中,获取单元501被配置成获取第一图像和获取第二图像集合,其中,第二图像集合中包括至少两个第二图像;上述获取单元501进一步被配置成获取第一图像中的、三个不共线的像素点的坐标,得到坐标集合;生成单元502被配置成根据坐标集合,生成目标矩阵;确定单元503被配置成针对第二图像集合中的第二图像,获取该第二图像中与坐标集合中的坐标指示的像素点对应的像素点的坐标,得到对应坐标集合;根据对应坐标集合,生成与目标矩阵的列数匹配的目标列向量;将目标矩阵左乘目标列向量得到变换列向量;根据变换列向量确定第一图像和该第二图像的几何变换关系。
在本实施例中,用于确定图像间的几何变换关系的装置500中:获取单元501、生成单元502和确定单元503的具体处理及其所带来 的技术效果可分别参考图2对应实施例中的步骤201、步骤202、步骤203和步骤204的相关说明,在此不再赘述。
在本实施例的一些可选的实现方式中,上述获取单元501进一步被配置成:获取第一图像的、三个不共线的特征点的坐标。
在本实施例的一些可选的实现方式中,上述获取单元501进一步被配置成:获取第一图像的特征点的坐标,得到第一坐标集合;以及上述确定单元503进一步被配置成针对第二图像集合中的第二图像,获取该第二图像的、与第一坐标集合中的第一坐标指示的特征点匹配的特征点的坐标,得到第二坐标集合;根据确定的第一图像和该第二图像的几何变换关系和第一坐标集合,从第二坐标集合中确定第二坐标作为目标第二坐标,其中,目标第二坐标指示的特征点是错误匹配的特征点。
在本实施例的一些可选的实现方式中,生成单元502进一步被配置成:根据坐标集合,生成第一矩阵,以及将第一矩阵的逆矩阵确定为目标矩阵。
在本实施例的一些可选的实现方式中,对应坐标集合中的对应坐标分别指示第一对应像素点、第二对应像素点、第三对应像素点;以及目标列向量中的元素的取值如下:第一行的元素的取值为第一对应像素点的第一方向坐标,第二行的元素的取值为第一对应像素点的第二方向坐标,第三行的元素的取值为第二对应像素点的第一方向坐标,第四行的元素的取值为第二对应像素点的第二方向坐标,第五行的元素的取值为第三对应像素点的第一方向坐标,第六行的元素的取值为第三对应像素点的第二方向坐标。
在本实施例的一些可选的实现方式中,确定单元503进一步被配置成:根据变换列向量生成用于表示第一图像和该第二图像之间的几何变换关系的、三行三列的变换矩阵,其中,变换矩阵中的元素的取值如下:第一行的第一个元素的取值为变换列向量的第一行的元素的取值,第一行的第二个元素的取值为变换列向量的第二行的元素的取值,第一行的第三个元素的取值为变换列向量的第三行的元素的取值,第二行的第一个元素的取值为变换列向量的第四行的元素的取值,第 二行的第二个元素的取值为变换列向量的第五行的元素的取值,第二行的第三个元素的取值为变换列向量的第六行的元素的取值,第三行的第一个元素和第二元素的取值为零,第三行的第三个元素的取值为一。
在本实施例的一些可选的实现方式中,坐标集合中的坐标分别指示第一像素点、第二像素点、第三像素点;以及第一矩阵中的元素的取值如下:第一行的第一个元素和第二行的第四个元素的取值为第一像素点的第一方向坐标,第一行的第二个元素和第二行的第五个元素的取值为第一像素点的第二方向坐标,第一行的第三个元素和第二行的第六个元素的取值为一,第一行的第四个元素、第五个元素、第六个元素的取值为零,第二行的第一个元素、第二个元素、第三个元素的取值为零,第三行的第一个元素和第四行的第四个元素的取值为第二像素点的第一方向坐标,第三行的第二个元素和第四行的第五个元素的取值为第二像素点的第二方向坐标,第三行的第三个元素和第四行的第六个元素的取值为一,第三行的第四个元素、第五个元素、第六个元素的取值为零,第四行的第一个元素、第二个元素、第三个元素的取值为零,第五行的第一个元素和第六行的第四个元素的取值为第三像素点的第一方向坐标,第五行的第二个元素和第六行的第五个元素的取值为第三像素点的第二方向坐标,第五行的第三个元素和第六行的第六个元素的取值为一,第五行的第四个元素、第五个元素、第六个元素的取值为零,第六行的第一个元素、第二个元素、第三个元素的取值为零。
本申请的上述实施例提供的装置,通过获取单元获取第一图像和获取第二图像集合,其中,第二图像集合中包括至少两个第二图像;获取第一图像中的、三个不共线的像素点的坐标,得到坐标集合;由生成元眼根据坐标集合,生成目标矩阵;由确定单元针对第二图像集合中的第二图像,获取该第二图像中与坐标集合中的坐标指示的像素点对应的像素点的坐标,得到对应坐标集合;根据对应坐标集合,生成与目标矩阵的列数匹配的目标列向量;将目标矩阵左乘目标列向量得到变换列向量;根据变换列向量确定第一图像和该第二图像的几何 变换关系,从而实现了在第一图像对应多个第二图像的场景下,通过先生成目标矩阵的方式,使得在求解第一图像与各个第二图像的几何变换关系时,只需要利用目标矩阵进行矩阵乘法即可完成求解过程,加快了求解过程的运算速度。
下面参考图6,其示出了适于用来实现本申请实施例的电子设备的计算机系统600的结构示意图。图6示出的电子设备仅仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。
如图6所示,计算机系统600包括中央处理单元(CPU)601,其可以根据存储在只读存储器(ROM)602中的程序或者从存储部分608加载到随机访问存储器(RAM)603中的程序而执行各种适当的动作和处理。在RAM 603中,还存储有系统600操作所需的各种程序和数据。CPU 601、ROM 602以及RAM 603通过总线604彼此相连。输入/输出(I/O)接口605也连接至总线604。
以下部件连接至I/O接口605:包括键盘、鼠标等的输入部分606;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分607;包括硬盘等的存储部分608;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分609。通信部分609经由诸如因特网的网络执行通信处理。驱动器610也根据需要连接至I/O接口605。可拆卸介质611,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器610上,以便于从其上读出的计算机程序根据需要被安装入存储部分608。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分609从网络上被下载和安装,和/或从可拆卸介质611被安装。在该计算机程序被中央处理单元(CPU)601执行时,执行本申请的方法中限定的上述功能。
需要说明的是,本申请的计算机可读介质可以是计算机可读信号 介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本申请中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本申请中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。
附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本申请实施例中所涉及到的单元可以通过软件的方式实 现,也可以通过硬件的方式来实现。所描述的单元也可以设置在处理器中,例如,可以描述为:一种处理器,包括获取单元、生成单元和确定单元。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定,例如,获取单元还可以被描述为“获取第一图像和获取第二图像集合的单元”。
作为另一方面,本申请还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:获取第一图像和获取第二图像集合,其中,第二图像集合中包括至少两个第二图像;获取第一图像中的、三个不共线的像素点的坐标,得到坐标集合;根据坐标集合,生成目标矩阵;针对第二图像集合中的第二图像,获取该第二图像中与坐标集合中的坐标指示的像素点对应的像素点的坐标,得到对应坐标集合;根据对应坐标集合,生成与目标矩阵的列数匹配的目标列向量;将目标矩阵左乘目标列向量得到变换列向量;根据变换列向量确定第一图像和该第二图像的几何变换关系。
以上描述仅为本申请的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本申请中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本申请中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。
Claims (16)
- 一种用于确定图像间的几何变换关系的方法,包括:获取第一图像和获取第二图像集合,其中,所述第二图像集合中包括至少两个第二图像;获取所述第一图像中的、三个不共线的像素点的坐标,得到坐标集合;根据所述坐标集合,生成目标矩阵;针对所述第二图像集合中的第二图像,获取该第二图像中与所述坐标集合中的坐标指示的像素点对应的像素点的坐标,得到对应坐标集合;根据所述对应坐标集合,生成与所述目标矩阵的列数匹配的目标列向量;将所述目标矩阵左乘所述目标列向量得到变换列向量;根据所述变换列向量确定所述第一图像和该第二图像的几何变换关系。
- 根据权利要求1所述的方法,其中,所述获取所述第一图像中的、三个不共线的像素点的坐标,包括:获取所述第一图像的、三个不共线的特征点的坐标。
- 根据权利要求2所述的方法,其中,所述方法还包括:获取所述第一图像的特征点的坐标,得到第一坐标集合;针对所述第二图像集合中的第二图像,获取该第二图像的、与所述第一坐标集合中的第一坐标指示的特征点匹配的特征点的坐标,得到第二坐标集合;根据确定的所述第一图像和该第二图像的几何变换关系和所述第一坐标集合,从所述第二坐标集合中确定第二坐标作为目标第二坐标,其中,所述目标第二坐标指示的特征点是错误匹配的特征点。
- 根据权利要求1所述的方法,其中,所述根据所述坐标集合,生成目标矩阵,包括:根据所述坐标集合,生成第一矩阵,以及将所述第一矩阵的逆矩 阵确定为所述目标矩阵。
- 根据权利要求1所述的方法,其中,所述对应坐标集合中的对应坐标分别指示第一对应像素点、第二对应像素点、第三对应像素点;以及所述目标列向量中的元素的取值如下:第一行的元素的取值为所述第一对应像素点的第一方向坐标,第二行的元素的取值为所述第一对应像素点的第二方向坐标,第三行的元素的取值为所述第二对应像素点的第一方向坐标,第四行的元素的取值为所述第二对应像素点的第二方向坐标,第五行的元素的取值为所述第三对应像素点的第一方向坐标,第六行的元素的取值为所述第三对应像素点的第二方向坐标。
- 根据权利要求1所述的方法,其中,所述根据所述变换列向量确定所述第一图像和该第二图像之间的几何变换关系,包括:根据所述变换列向量生成用于表示所述第一图像和该第二图像之间的几何变换关系的、三行三列的变换矩阵,其中,所述变换矩阵中的元素的取值如下:第一行的第一个元素的取值为所述变换列向量的第一行的元素的取值,第一行的第二个元素的取值为所述变换列向量的第二行的元素的取值,第一行的第三个元素的取值为所述变换列向量的第三行的元素的取值,第二行的第一个元素的取值为所述变换列向量的第四行的元素的取值,第二行的第二个元素的取值为所述变换列向量的第五行的元素的取值,第二行的第三个元素的取值为所述变换列向量的第六行的元素的取值,第三行的第一个元素和第二元素的取值为零,第三行的第三个元素的取值为一。
- 根据权利要求4所述的方法,其中,所述坐标集合中的坐标分别指示第一像素点、第二像素点、第三像素点;以及所述第一矩阵中的元素的取值如下:第一行的第一个元素和第二行的第四个元素的取值为所述第一像素点的第一方向坐标,第一行的第二个元素和第二行的第五个元素的取值为所述第一像素点的第二方 向坐标,第一行的第三个元素和第二行的第六个元素的取值为一,第一行的第四个元素、第五个元素、第六个元素的取值为零,第二行的第一个元素、第二个元素、第三个元素的取值为零,第三行的第一个元素和第四行的第四个元素的取值为所述第二像素点的第一方向坐标,第三行的第二个元素和第四行的第五个元素的取值为所述第二像素点的第二方向坐标,第三行的第三个元素和第四行的第六个元素的取值为一,第三行的第四个元素、第五个元素、第六个元素的取值为零,第四行的第一个元素、第二个元素、第三个元素的取值为零,第五行的第一个元素和第六行的第四个元素的取值为所述第三像素点的第一方向坐标,第五行的第二个元素和第六行的第五个元素的取值为所述第三像素点的第二方向坐标,第五行的第三个元素和第六行的第六个元素的取值为一,第五行的第四个元素、第五个元素、第六个元素的取值为零,第六行的第一个元素、第二个元素、第三个元素的取值为零。
- 一种用于确定图像间的几何变换关系的装置,包括:获取单元,被配置成获取第一图像和获取第二图像集合,其中,所述第二图像集合中包括至少两个第二图像;所述获取单元,进一步被配置成获取所述第一图像中的、三个不共线的像素点的坐标,得到坐标集合;生成单元,被配置成根据所述坐标集合,生成目标矩阵;确定单元,被配置成针对所述第二图像集合中的第二图像,获取该第二图像中与所述坐标集合中的坐标指示的像素点对应的像素点的坐标,得到对应坐标集合;根据所述对应坐标集合,生成与所述目标矩阵的列数匹配的目标列向量;将所述目标矩阵左乘所述目标列向量得到变换列向量;根据所述变换列向量确定所述第一图像和该第二图像的几何变换关系。
- 根据权利要求8所述的装置,其中,所述获取单元进一步被配置成:获取所述第一图像的、三个不共线的特征点的坐标。
- 根据权利要求9所述的装置,其中,所述获取单元进一步被配置成:获取所述第一图像的特征点的坐标,得到第一坐标集合;以及所述确定单元,进一步被配置成:针对所述第二图像集合中的第二图像,获取该第二图像的、与所述第一坐标集合中的第一坐标指示的特征点匹配的特征点的坐标,得到第二坐标集合;根据确定的所述第一图像和该第二图像的几何变换关系和所述第一坐标集合,从所述第二坐标集合中确定第二坐标作为目标第二坐标,其中,所述目标第二坐标指示的特征点是错误匹配的特征点。
- 根据权利要求8所述的装置,其中,所述生成单元进一步被配置成:根据所述坐标集合,生成第一矩阵,以及将所述第一矩阵的逆矩阵确定为所述目标矩阵。
- 根据权利要求8所述的装置,其中,所述对应坐标集合中的对应坐标分别指示第一对应像素点、第二对应像素点、第三对应像素点;以及所述目标列向量中的元素的取值如下:第一行的元素的取值为所述第一对应像素点的第一方向坐标,第二行的元素的取值为所述第一对应像素点的第二方向坐标,第三行的元素的取值为所述第二对应像素点的第一方向坐标,第四行的元素的取值为所述第二对应像素点的第二方向坐标,第五行的元素的取值为所述第三对应像素点的第一方向坐标,第六行的元素的取值为所述第三对应像素点的第二方向坐标。
- 根据权利要求8所述的装置,其中,所述确定单元进一步被配置成:根据所述变换列向量生成用于表示所述第一图像和该第二图像之间的几何变换关系的、三行三列的变换矩阵,其中,所述变换矩阵中 的元素的取值如下:第一行的第一个元素的取值为所述变换列向量的第一行的元素的取值,第一行的第二个元素的取值为所述变换列向量的第二行的元素的取值,第一行的第三个元素的取值为所述变换列向量的第三行的元素的取值,第二行的第一个元素的取值为所述变换列向量的第四行的元素的取值,第二行的第二个元素的取值为所述变换列向量的第五行的元素的取值,第二行的第三个元素的取值为所述变换列向量的第六行的元素的取值,第三行的第一个元素和第二元素的取值为零,第三行的第三个元素的取值为一。
- 根据权利要求11所述的装置,其中,所述坐标集合中的坐标分别指示第一像素点、第二像素点、第三像素点;以及所述第一矩阵中的元素的取值如下:第一行的第一个元素和第二行的第四个元素的取值为所述第一像素点的第一方向坐标,第一行的第二个元素和第二行的第五个元素的取值为所述第一像素点的第二方向坐标,第一行的第三个元素和第二行的第六个元素的取值为一,第一行的第四个元素、第五个元素、第六个元素的取值为零,第二行的第一个元素、第二个元素、第三个元素的取值为零,第三行的第一个元素和第四行的第四个元素的取值为所述第二像素点的第一方向坐标,第三行的第二个元素和第四行的第五个元素的取值为所述第二像素点的第二方向坐标,第三行的第三个元素和第四行的第六个元素的取值为一,第三行的第四个元素、第五个元素、第六个元素的取值为零,第四行的第一个元素、第二个元素、第三个元素的取值为零,第五行的第一个元素和第六行的第四个元素的取值为所述第三像素点的第一方向坐标,第五行的第二个元素和第六行的第五个元素的取值为所述第三像素点的第二方向坐标,第五行的第三个元素和第六行的第六个元素的取值为一,第五行的第四个元素、第五个元素、第六个元素的取值为零,第六行的第一个元素、第二个元素、第三个元素的取值为零。
- 一种电子设备,包括:一个或多个处理器;存储装置,其上存储有一个或多个程序;当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-7中任一所述的方法。
- 一种计算机可读介质,其上存储有计算机程序,其中,该程序被处理器执行时实现如权利要求1-7中任一所述的方法。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US16/981,240 US10984542B2 (en) | 2018-09-12 | 2018-11-20 | Method and device for determining geometric transformation relation for images |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201811060837.X | 2018-09-12 | ||
| CN201811060837.XA CN109242892B (zh) | 2018-09-12 | 2018-09-12 | 用于确定图像间的几何变换关系的方法和装置 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020052068A1 true WO2020052068A1 (zh) | 2020-03-19 |
Family
ID=65060999
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2018/116344 Ceased WO2020052068A1 (zh) | 2018-09-12 | 2018-11-20 | 用于确定图像间的几何变换关系的方法和装置 |
Country Status (3)
| Country | Link |
|---|---|
| US (1) | US10984542B2 (zh) |
| CN (1) | CN109242892B (zh) |
| WO (1) | WO2020052068A1 (zh) |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112837391B (zh) * | 2021-03-04 | 2022-02-18 | 北京柏惠维康科技有限公司 | 坐标转换关系获取方法、装置、电子设备及存储介质 |
| CN114494413B (zh) * | 2021-12-28 | 2025-09-09 | 广州极飞科技股份有限公司 | 图像中位置点的坐标确定方法、装置、设备和存储介质 |
| CN116993637B (zh) * | 2023-07-14 | 2024-03-12 | 禾多科技(北京)有限公司 | 用于车道线检测的图像数据处理方法、装置、设备和介质 |
| CN120070153B (zh) * | 2023-11-28 | 2025-12-12 | 成都华为技术有限公司 | 一种对数字图像进行几何变换的加速系统 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US4989142A (en) * | 1988-10-24 | 1991-01-29 | General Electric Company | Three-dimensional images obtained from tomographic slices with gantry tilt |
| CN101500172A (zh) * | 2009-02-20 | 2009-08-05 | 四川华控图形科技有限公司 | 基于光传感器的投影自动几何校正方法 |
| CN102194215A (zh) * | 2010-03-19 | 2011-09-21 | 索尼公司 | 图像处理设备、方法以及程序 |
| CN106500669A (zh) * | 2016-09-22 | 2017-03-15 | 浙江工业大学 | 一种基于四旋翼imu参数的航拍图像矫正方法 |
| CN106910210A (zh) * | 2017-03-03 | 2017-06-30 | 百度在线网络技术(北京)有限公司 | 用于生成图像信息的方法和装置 |
Family Cites Families (22)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH03241973A (ja) * | 1990-02-20 | 1991-10-29 | Nippon Telegr & Teleph Corp <Ntt> | 直交変換による解像度変換方式 |
| US7302033B2 (en) * | 2005-06-29 | 2007-11-27 | Accuray Incorporated | Imaging geometry for image-guided radiosurgery |
| US8396268B2 (en) * | 2010-03-31 | 2013-03-12 | Isis Innovation Limited | System and method for image sequence processing |
| CN102540139B (zh) * | 2011-11-23 | 2014-07-09 | 电子科技大学 | 一种采用多站点对多目标的定位方法 |
| AU2013337279B2 (en) * | 2012-11-05 | 2018-05-24 | Sea Street Technologies, Inc. | Systems and methods for provisioning and managing an elastic computing infrastructure |
| GB201222361D0 (en) * | 2012-12-12 | 2013-01-23 | Univ Birmingham | Surface geometry imaging |
| CN103679735B (zh) * | 2013-12-26 | 2017-02-15 | 苏州盛景空间信息技术有限公司 | 一种基于三视图几何中三点线性关系的任意点匹配方法 |
| WO2015134665A1 (en) * | 2014-03-04 | 2015-09-11 | SignalSense, Inc. | Classifying data with deep learning neural records incrementally refined through expert input |
| US9311558B2 (en) * | 2014-04-16 | 2016-04-12 | I.R.I.S. | Pattern recognition system |
| US10366346B2 (en) * | 2014-05-23 | 2019-07-30 | DataRobot, Inc. | Systems and techniques for determining the predictive value of a feature |
| US9953425B2 (en) * | 2014-07-30 | 2018-04-24 | Adobe Systems Incorporated | Learning image categorization using related attributes |
| CN104504723B (zh) * | 2015-01-14 | 2017-05-17 | 西安电子科技大学 | 基于视觉显著特征的图像配准方法 |
| GB2536493B (en) * | 2015-03-20 | 2020-11-18 | Toshiba Europe Ltd | Object pose recognition |
| CN104766084B (zh) * | 2015-04-10 | 2017-12-05 | 南京大学 | 一种多目标匹配的近复制图像检测方法 |
| CN105488754B (zh) * | 2015-11-19 | 2018-09-21 | 武汉大学 | 基于局部线性迁移和仿射变换的图像特征匹配方法及系统 |
| CN105551022B (zh) * | 2015-12-07 | 2018-03-30 | 北京大学 | 一种基于形状交互矩阵的图像错误匹配检验方法 |
| CN105931237A (zh) * | 2016-04-19 | 2016-09-07 | 北京理工大学 | 一种图像校准方法和系统 |
| CN106296714B (zh) * | 2016-08-23 | 2019-05-03 | 东方网力科技股份有限公司 | 一种图像配准方法和装置 |
| US10013644B2 (en) * | 2016-11-08 | 2018-07-03 | International Business Machines Corporation | Statistical max pooling with deep learning |
| CN107358244B (zh) * | 2017-07-17 | 2019-08-20 | 湖南优象科技有限公司 | 一种快速局部不变特征提取与描述方法 |
| CN107958236B (zh) * | 2017-12-28 | 2021-03-19 | 深圳市金立通信设备有限公司 | 人脸识别样本图像的生成方法及终端 |
| CN108305281B (zh) * | 2018-02-09 | 2020-08-11 | 深圳市商汤科技有限公司 | 图像的校准方法、装置、存储介质、程序产品和电子设备 |
-
2018
- 2018-09-12 CN CN201811060837.XA patent/CN109242892B/zh active Active
- 2018-11-20 US US16/981,240 patent/US10984542B2/en active Active
- 2018-11-20 WO PCT/CN2018/116344 patent/WO2020052068A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US4989142A (en) * | 1988-10-24 | 1991-01-29 | General Electric Company | Three-dimensional images obtained from tomographic slices with gantry tilt |
| CN101500172A (zh) * | 2009-02-20 | 2009-08-05 | 四川华控图形科技有限公司 | 基于光传感器的投影自动几何校正方法 |
| CN102194215A (zh) * | 2010-03-19 | 2011-09-21 | 索尼公司 | 图像处理设备、方法以及程序 |
| CN106500669A (zh) * | 2016-09-22 | 2017-03-15 | 浙江工业大学 | 一种基于四旋翼imu参数的航拍图像矫正方法 |
| CN106910210A (zh) * | 2017-03-03 | 2017-06-30 | 百度在线网络技术(北京)有限公司 | 用于生成图像信息的方法和装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| US20210027478A1 (en) | 2021-01-28 |
| US10984542B2 (en) | 2021-04-20 |
| CN109242892B (zh) | 2019-11-12 |
| CN109242892A (zh) | 2019-01-18 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2020006961A1 (zh) | 用于提取图像的方法和装置 | |
| CN109191514B (zh) | 用于生成深度检测模型的方法和装置 | |
| CN108492364B (zh) | 用于生成图像生成模型的方法和装置 | |
| CN108038469A (zh) | 用于检测人体的方法和装置 | |
| CN108027885A (zh) | 空间变换器模块 | |
| WO2019184657A1 (zh) | 图像识别方法、装置、电子设备及存储介质 | |
| WO2020052068A1 (zh) | 用于确定图像间的几何变换关系的方法和装置 | |
| WO2020062493A1 (zh) | 图像处理方法和装置 | |
| CN115578515B (zh) | 三维重建模型的训练方法、三维场景渲染方法及装置 | |
| CN113297973B (zh) | 关键点检测方法、装置、设备和计算机可读介质 | |
| US12493976B2 (en) | Method for training depth estimation model, training apparatus, and electronic device applying the method | |
| CN108470328A (zh) | 用于处理图像的方法和装置 | |
| US20200410213A1 (en) | Method and apparatus for processing mouth image | |
| CN118097157B (zh) | 基于模糊聚类算法的图像分割方法及系统 | |
| WO2020056901A1 (zh) | 用于处理图像的方法和装置 | |
| WO2020029467A1 (zh) | 视频帧处理方法和装置 | |
| WO2022012179A1 (zh) | 生成特征提取网络的方法、装置、设备和计算机可读介质 | |
| WO2021258882A1 (zh) | 基于循环神经网络的数据处理方法、装置、设备及介质 | |
| CN109977905A (zh) | 用于处理眼底图像的方法和装置 | |
| CN114399589A (zh) | 三维车道线生成方法、装置、电子设备和计算机可读介质 | |
| CN109688086A (zh) | 用于终端设备的权限控制方法和装置 | |
| CN110069195A (zh) | 图像拖拽变形方法和装置 | |
| WO2020052120A1 (zh) | 用于处理图像的特征点的方法和装置 | |
| CN112101258A (zh) | 图像处理方法、装置、电子设备和计算机可读介质 | |
| CN109034085B (zh) | 用于生成信息的方法和装置 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18933565 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 17.06.2021) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 18933565 Country of ref document: EP Kind code of ref document: A1 |






