CN108537782A - A method of building images match based on contours extract with merge - Google Patents
A method of building images match based on contours extract with merge Download PDFInfo
- Publication number
- CN108537782A CN108537782A CN201810280577.0A CN201810280577A CN108537782A CN 108537782 A CN108537782 A CN 108537782A CN 201810280577 A CN201810280577 A CN 201810280577A CN 108537782 A CN108537782 A CN 108537782A
- Authority
- CN
- China
- Prior art keywords
- straight line
- historical photograph
- image
- historical
- photograph
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/90—Determination of colour characteristics
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20212—Image combination
- G06T2207/20221—Image fusion; Image merging
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30181—Earth observation
- G06T2207/30184—Infrastructure
Abstract
The building images match that the invention discloses a kind of based on contours extract and the method merged, including:Historical photograph is pre-processed;Contours extract is carried out to previewing photos and pretreated historical photograph, obtains the profile diagram of historical photograph and previewing photos;Lines detection is carried out to the profile diagram of two photos, and uses matching line segments algorithm, the straight line of historical photograph and previewing photos is matched according to linear feature, obtains Optimum Matching team set;Angle calculates gathering interior straight line to Optimum Matching team, obtains two angle matrixes, and carry out similarity calculation to angle matrix, obtains the similarity of historical photograph and previewing photos;Image co-registration processing is carried out to previewing photos and historical photograph, so that similar photo is simultaneously displayed on historical photograph in a photo, historical building can be matched in real time with existing previewing photos, judge the matching degree of two building object images so that build the comparison of photo more accurately and quickly.
Description
Technical field
The present invention relates to image processing field more particularly to a kind of building images match based on contours extract with merge
Method.
Background technology
With the fast development in city, space-variant when building and surrounding scene positioned at same place occur huge
Change.Urban historic buildings protection becomes social concern outstanding.Wherein it is difficult to which building present situation is in parallel with historical situation comparison
System gets up, and is the main reason for hindering public participation historical building protection.With the hair of computer vision and mobile calculation technique
Exhibition, mobile device are analyzed and understand that the ability of image greatly enhances, and build novel image processing application on the mobile apparatus, promote
It participates in being a kind of feasible scheme into user.
But a urban architecture, while including the historical photograph of various years and the new photo of user's shooting.Although
New photo shoots the similar angle in same building with historical photograph, and due to age difference, ambient background has occurred huge
Variation, causing historical photograph, there are a variety of different feature differences, including color, texture, foreground, background etc. from new photo.
Existing image similarity computational algorithm such as color histogram, perceptual hash etc., considers the global feature of image, does not have
There is the linear feature for extracting building, therefore in the image similarity computational problem of building historical photograph and new photo,
There are places to be improved.
Invention content
It is in view of the foregoing drawbacks or insufficient, the purpose of the present invention is to provide a kind of building object image based on contours extract
With with the method that merges, historical building photo can be merged with the photo of the same building newly shot object.
To achieve the above objectives, the technical scheme is that:
A method of building images match based on contours extract with merge, including:
1) historical photograph for, obtaining building, pre-processes historical photograph;
2) contours extract, is carried out to previewing photos and pretreated historical photograph, obtains historical photograph and previewing photos
Profile diagram;
3) lines detection, is carried out to the profile diagram of historical photograph and previewing photos respectively using LSD Straight Line Extractions, and
Using matching line segments algorithm, the straight line of historical photograph and previewing photos is carried out according to the length of straight line, slope and position feature
Pairing obtains Optimum Matching to set;
4) two angle matrixes, are obtained, and to angle to angle calculates straight line two-by-two in set to Optimum Matching
Matrix carries out similarity calculation, obtains the similarity of historical photograph and previewing photos, is clapped building according to similarity auxiliary
According to or photo comparison, obtain the high similar photo of similarity;
5) image co-registration processing, is carried out to similar photo and historical photograph so that similar photo is shown simultaneously with historical photograph
Show in a photo.
It is described to historical photograph carry out pretreatment include:Dimension scale adjustment is carried out to historical photograph, then shines history
Piece is converted into gray-scale map, finally, smoothing processing is filtered to gray-scale map.
The step 2) specifically includes:
2.1, historical photograph is labeled as F, previewing photos is labeled as G;
2.2, edge detection is carried out respectively to historical photograph F, previewing photos G using edge detection algorithm, obtains history photograph
Piece profile diagram F ', previewing photos profile diagram G '.
The step 3) specifically includes:
3.1, it is extracted using LSD Straight Line Extractions straight in historical photograph profile diagram F ' and previewing photos profile diagram G '
Line, and it is stored to historical photograph straight line set L respectivelyAWith previewing photos straight line set LBIn;
3.2, using greedy algorithm, by historical photograph straight line set LAStraight line, according to geometric properties and previewing photos straight line
Set LBCathetus is matched, and Optimum Matching team set S is obtained;Wherein, the geometric properties include the slope of straight line, length
The position and.
Further include respectively to historical photograph straight line set L after the step 3.1AWith previewing photos straight line set LBIn it is straight
Line is polymerize, and is reduced edge and is repeated.
The step 3.2 specifically includes:
A, it is followed successively by historical photograph straight line set LAIn each linear scanning previewing photos straight line set LBIn it is straight
Whether line finds all feasible solutions, by threshold decision straight line to matching;
B, for meeting matched solution, the gap between two straight lines is calculated, the solution diff of gap minimum between straight line is found:
In above formula, l1, l2Historical photograph straight line set L is indicated respectivelyAWith previewing photos straight line set LBThe length of cathetus
Degree;k1, k2The slope of straight line is indicated respectively;
C, according to the solution diff of gap minimum between straight line, the straight line for choosing minimum value is matched.
It is described by threshold decision straight line to whether matching specially:Calculate historical photograph straight line set LAIt is shone with preview
Piece straight line set LBThe adaptive threshold T of cathetusaAnd Tb, the TaAnd TbSlope threshold value and length threshold are indicated respectively;When two
The approximate straight line of relative position meets adaptive threshold T simultaneouslyaAnd TbWhen, then two straight lines have approximate slope and length
Degree, defines this two straight lines and meets matched solution.
The step 4 specifically includes:
4.1, the angle in Optimum Matching team set S between each straight line is calculated, two angle matrix As and B, angle are obtained
Each row and column all represent the angle between two straight lines in matrix A and B, are indicated using upper triangular matrix;
4.2, the similarity r of angle matrix A and B is calculated:
Wherein, m, n indicate angle matrix A, the line number of B matrixes and columns respectively;Indicate the mean value of A matrixes,Indicate B
The mean value of matrixIndicate weighting coefficient, i.e., the straight line ratio of number of two image zooming-outs.
The step 5) specifically includes:
5.1, image preprocessing:
The scaling coefficient of rotary matrix for reading the preservation of contours extract stage, becomes historical photograph according to coefficient matrix
It changes, the blank left by scaling is filled up using the method for transparent pixels in transformation, it is final so that the scene before fusion and shooting
When it is consistent;
5.2, mask code matrix is created:
Mask code matrix M is created, the mask code matrix M is identical as similar photo size, and every bit is corresponding on mask code matrix M
Pixel value is the numerical value from 0 to 255, and black 0, white is 255;
5.3, intensity-weighted:
Using mask code matrix as template, using the transparency of pixel in mask code matrix as the weights of each pixel, with
Weighted average is done to the transparency of similar photo to historical photograph on the basis of the weights, obtains new matrix:
H (i, j)=wfF(i,j)+wgG(i,j)
wf+wg=1
Wherein, F indicates that historical photograph image, G indicate that similar photograph image, H indicate that the image after synthesis, i, j indicate figure
The pixel arranged as matrix the i-th row jth;wfAnd wgIt is weighting coefficient, wherein w respectivelyfIt is obtained by bit arithmetic by M, wfAnd wgIt
Be 1;
5.4, image is generated:
It converts new matrix to image, and is shown on client end interface.
It further include step 5.5 after step 5.4:
The change of global feature is carried out to generating image, including the color of image and style are modified, and are obtained and are melted to the end
Close figure.
Compared with the prior art, beneficial effects of the present invention are:
The building images match that the present invention provides a kind of based on contours extract and the method merged, to contours extract with
Matching and Image Fusion, which are made, to be suitably modified, and the extraction effect of detail edges is optimized;Can by historical building with it is existing
Previewing photos matched in real time, judge two building object image matching degrees so that build the comparison of photo more
Accurately and quickly;And by fusion method, amount photo is merged, is shone by the current building scene of real-time matching and history
Piece, comparison exhibition building change details, and synthesis includes the blending image of new and old two kinds of scenes, promote user and using interest and increase
User's viscosity attracts people to participate in urban architecture protection.
Description of the drawings
Fig. 1 is that the present invention is based on the building images match of contours extract and the method flow diagram that merges
Fig. 2 is that the present invention is based on the building images match of contours extract to be illustrated with the directions the 4- Scharr operators merged
Figure;
Fig. 3 is that the present invention is based on the building images match of contours extract and the schematic diagram that merges.
Specific implementation mode
The present invention is described in detail below in conjunction with attached drawing, it is clear that described embodiment is only the present invention one
Divide embodiment, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not making
The every other embodiment obtained under the premise of creative work, belongs to protection scope of the present invention.
As shown in Figure 1, the building images match that the present invention provides a kind of based on contours extract and the method merged, packet
It includes:
1) historical photograph for, obtaining building, pre-processes historical photograph;
It is described to historical photograph carry out pretreatment include:Dimension scale adjustment is carried out to historical photograph, then shines history
Piece is converted into gray-scale map, finally, smoothing processing is filtered to gray-scale map.
2) contours extract, is carried out to previewing photos and pretreated historical photograph, obtains historical photograph and previewing photos
Profile diagram;
It should be noted that previewing photos include magazine preview shooting photo, the new building for further including and shooting
Photo.
The step 2) specifically includes:
2.1, historical photograph is labeled as F, previewing photos is labeled as G;
2.2, edge detection is carried out respectively to historical photograph F, previewing photos G using edge detection algorithm, obtains history photograph
Piece profile diagram F ', previewing photos profile diagram G '.
The present invention on the basis of Canny edge detection algorithms, is made for the purpose of extracting the long straight line in contour of building
Sobel operators are substituted with the Scharr operators in 4 directions, while increasing local threshold Tuning function, improve existing edge
Detection algorithm so that improved algorithm is capable of detecting when subtle edge, and product is played to the line detection algorithm in next step
Pole acts on.
Traditional Canny edge detection algorithms acquiescence calculates gradient using the Sobel operators of 3*3, its advantage is that calculating letter
It is single quick, but will also result in the low problem of edge precision.Since Sobel operators are only to horizontal and vertical directions
Graded is sensitive, and therefore, it is insensitive to the graded in other directions.In addition, the convolution kernel weight of Sobel operators compared with
It is small, it is easy to be influenced by noise spot, reduces edge detection precision.In order to detect complete, continuous contour of building.The present invention
Sobel operators are replaced with into Scharr operators, Scharr operators are equally fast with Sobel operators in efficiency, but precision higher.
On the basis of traditional Scharr operators, increases by 45 °, 135 ° of both directions herein, use the calculating gradient in 4 directions, such as Fig. 3
It is shown, certain sensibility is kept to the edge of multiple directions, is avoided only to horizontal sensitive with vertical both direction, promotion edge
The accuracy rate of positioning.
Improved image gradient calculation formula is defined as:
G=(| G45|-|G135|)/2+(|G45|+|G135|)/2+|Gx|+|Gy|
Convolution operator is G (x, y) (0<i<N,0<j<N), N is the rank of G (x, y).This method for calculating image gradient, is examined
The diagonally opposed of pixel is considered, has been introduced into Difference Calculation, improved the accuracy of edge positioning, for extracting subtle side
Edge is helpful.
Traditional Canny edge detection algorithms cannot be adaptively adjusted threshold value by the way of threshold value artificial settings, reduce
The edge locating accuracies of variety classes images.A kind of improvement strategy is to choose global threshold automatically using Ostu algorithms.
Ostu algorithms calculate the histogram of image first, and image is divided into different sections, count the number of each section pixel.Then
Selected pixels t divides foreground pixel and background pixel according to t, corresponding when the variance maximum of foreground pixel and background pixel
Pixel t be set to threshold value.Although Ostu algorithms can be according to the automatic selected threshold of different images, there is also certain
Problem.First, the calculation amount of algorithm is larger, is required for searching for the pixel in entire histogram to each image.Secondly,
Although can obtain a threshold value for capableing of maximum differentiation foreground and background using the algorithm, this threshold value is examined at entire edge
No longer change during surveying:When the average gradient value in image in some region is relatively low, possible marginal point Grad
It is relatively low, it, can many detail edges of missing inspection if threshold value setting at this time is higher;On the contrary, the average gradient in some region in the image
When value is higher, if threshold value setting at this time is relatively low, it be easy to cause the flase drop at edge.Therefore, Ostu algorithms are suitable for use in simply
In image, for building object image it is this there are the images of complex background noise, just seem not applicable.
To solve the above-mentioned problems, the complexity and efficiency of algorithm are taken into account, the present invention devises the plan of adjust automatically threshold value
Slightly.The initial value of Low threshold is Tl, the core concept of algorithm is the Grad T according to neighborhood δδAppropriate adjustment present threshold value:Work as Tδ
<TlWhen, illustrate that the average gradient magnitude in δ is relatively low, reduces T at this timelSo that the lower pixel of gradient magnitude is detected as edge
Possibility increases;Work as Tδ>TlWhen, illustrate that the average gradient magnitude in δ is higher, increases T at this timelMake the lower picture of gradient magnitude
The possibility that element is detected as edge reduces.Due to being directed to detail edges, it need to only change Low threshold and high threshold is kept not
Become, does not influence the judgement of thick edges.Above-mentioned strategy is summarized as:
Wherein, Tl 1For the threshold value after adjustment;N is the width and height of δ, N2For the number of pixels in δ;Gradient (i, j) is
Grad at point (i, j), calculated by Scharr operators from;P is weights, and value range is -1 or+1, Tδ<=TlWhen p take-
1, Tδ>TlWhen p take+1.
By local threshold adjust automatically strategy, the marginal point missing inspection and mistake that setting global threshold is brought effectively are alleviated
Inspection problem also protects low intensity edges details while suppressing noise.
The gradient magnitude of pixel is very big, can not illustrate that the pixel is exactly marginal point.Due to the picture on image border
Vegetarian refreshments, the often maximum point of neighborhood pixels gradient magnitude, therefore maximum detection is carried out for possible marginal point, it is to sentence
Whether the disconnected point determines it is one of steps necessary of marginal point.Canny edge detection algorithms use a kind of Greedy strategy, in pixel
8 neighborhoods in carry out non-maxima suppression.Its step is:Using current pixel as coordinate origin, first quartile is divided into [0,
22.5), [22.5,67.5), [67.5,90] three regions, one graded direction of each Regional Representative.If current pixel
Gradient direction is less than 22.5, then search for [0,22.5) whole pixels in this region, if the gradient width of current pixel point
Value is the maximum of these pixel gradient magnitudes, then retains current pixel point, otherwise rejects current pixel point.Similarly, if working as
The gradient direction of preceding pixel is fallen in other two region, also takes same computational methods.
3) lines detection, is carried out to the profile diagram of historical photograph and previewing photos respectively using LSD Straight Line Extractions, and
Using matching line segments algorithm, the straight line of historical photograph and previewing photos is carried out according to the length of straight line, slope and position feature
Pairing obtains Optimum Matching to set;
3.1, it is extracted using LSD Straight Line Extractions straight in historical photograph profile diagram F ' and previewing photos profile diagram G '
Line, and it is stored to historical photograph straight line set L respectivelyAWith previewing photos straight line set LBIn;
Respectively to historical photograph straight line set LAWith previewing photos straight line set LBIn line straightening machine polymerize, reduce side
Edge repeats.
The present invention is divided into two types by straight line polymerizable in object image is built:Combination type and connecting-type.Combination type with
Connecting-type all results from the edge replication problem of edge detection stage, this is unavoidable in edge detection, thus is caused
The straight line of both types is produced in the lines detection stage.The common trait of combination type and connecting-type is between two straight lines
Slope approximately equal, while the spacing of two straight lines is very close.Judge two by setting slope threshold value and spacing threshold
Whether straight line can cluster.
Straight line polymerization is carried out according to following three principle:
First, the straight line to be polymerize must be short and small straight line, by given threshold, filter out those longer straight lines, remain
Remaining straight line seeks to the straight line of polymerization.
Next, if two short and small straight line slope having the same, while the spacing of straight line is closer, then can consider two
Person belongs to straight line, can be polymerize, and longer straight line in the two is retained.Relative length:Between straight line and image
Relative length.
If two straight line slopes having the same, while end to end or distance is in a certain range, it is believed that
The two belongs to a long straight line.
In conclusion herein after lines detection, straight line polymerization procedure is added, it is short straight to fall those by length filtration first
Then line is attached connecting-type straight line, the short and small straight line with same characteristic features is polymerize.
3.2, using greedy algorithm, by historical photograph straight line set LAStraight line, according to geometric properties and previewing photos straight line
Set LBCathetus is matched, and Optimum Matching team set S is obtained;Wherein, the geometric properties include the slope of straight line, length
The position and.
The step 3.2 specifically includes:
A, it is followed successively by historical photograph straight line set LAIn each linear scanning previewing photos straight line set LBIn it is straight
Whether line finds all feasible solutions, by threshold decision straight line to matching;When two approximate straight lines of relative position meet simultaneously
When the two threshold values, illustrate that this two straight lines have approximate slope and length, it is believed that this two straight lines presence were mutually matched
It may.
It is described by threshold decision straight line to whether matching specially:Calculate historical photograph straight line set LAIt is shone with preview
Piece straight line set LBThe adaptive threshold T of cathetusaAnd Tb, the TaAnd TbSlope threshold value and length threshold are indicated respectively;When two
The approximate straight line of relative position meets adaptive threshold T simultaneouslyaAnd TbWhen, then two straight lines have approximate slope and length
Degree, defines this two straight lines and meets matched solution.
B, for meeting matched solution, the gap between two straight lines is calculated, the solution diff of gap minimum between straight line is found:
In above formula, l1, l2Historical photograph straight line set L is indicated respectivelyAWith previewing photos straight line set LBThe length of cathetus
Degree;k1, k2The slope of straight line is indicated respectively.
C, according to the solution diff of gap minimum between straight line, the straight line for choosing minimum value carries out energy pairing.
4), between angle calculates straight line two-by-two in Optimum Matching team set, two angle matrixes are obtained, and to angle
Matrix carries out similarity calculation, obtains the similarity of historical photograph and previewing photos, is clapped building according to similarity auxiliary
According to or photo comparison, obtain the high similar photo of similarity;
The step 4 specifically includes:
4.1, the angle in Optimum Matching team set S between each straight line is calculated, two angle matrix As and B, angle are obtained
Each row and column all represent the angle between two straight lines in matrix A and B, are indicated using upper triangular matrix;
4.2, the similarity r of angle matrix A and B is calculated:
Wherein, m, n indicate angle matrix A, the line number of B matrixes and columns respectively;Indicate the mean value of A matrixes,Indicate B
The mean value of matrix,Indicate weighting coefficient, i.e., the straight line ratio of number of two image zooming-outs.
The numerical value of r is bigger to illustrate matrix A, and the similarity of B is higher, and the matching degree between straight line is bigger.It should be noted that public
The denominator of formula, if each element in A, B matrix is all equal, denominator term 0, thus above-mentioned formula requires in A, B matrix
Each element cannot be all equal.In addition, if the calculated result on the multiplication left side is equal to 1, illustrate that A, B are identical squares
Battle array, need not be multiplied with matching rate again.
5) image co-registration processing, is carried out to similar photo and historical photograph so that similar photo is shown simultaneously with historical photograph
Show in a photo.
The step 5) specifically includes:
5.1, image preprocessing:
The scaling coefficient of rotary matrix for reading the preservation of contours extract stage, becomes historical photograph according to coefficient matrix
It changes, the blank left by scaling is filled up using the method for transparent pixels in transformation, it is final so that the scene before fusion and shooting
When it is consistent;
5.2, mask code matrix is created:
Mask code matrix M is created, the mask code matrix M is identical as similar photo size, and every bit is corresponding on mask code matrix M
Pixel value is the numerical value from 0 to 255, and black 0, white is 255;
5.3, intensity-weighted:
Using mask code matrix as template, using the transparency of pixel in mask code matrix as the weights of each pixel, with
Weighted average is done to the transparency of similar photo to historical photograph on the basis of the weights, obtains new matrix:
H (i, j)=wfF(i,j)+wgG(i,j)
wf+wg=1
Wherein, F indicates that historical photograph image, G indicate that similar photograph image, H indicate that the image after synthesis, i, j indicate figure
The pixel arranged as matrix the i-th row jth;wfAnd wgIt is weighting coefficient, wherein w respectivelyfIt is obtained by bit arithmetic by M, wfAnd wgIt
Be 1;
5.4, image is generated:
It converts new matrix to image, and is shown on client end interface.
The weights of historical photograph are more than new photo, so image herein is based on the pixel in historical photograph.In order to protect
The nucleus of card historical photograph, which can show that, to be come, so the weights of historical photograph are more than new photo under initial situation.With
The weights of the variation of regional location, historical photograph pixel are gradually reduced, and the weights of new photo pixel gradually increase, as shown in figure 3,
In (x1, x) and in region, the weights of new photo are more than historical photograph, so image herein is based on the pixel in new photo.Newly
The transparency transition of photo and historical photograph corresponding position pixel is dexterously realized on the basis of not dividing image, semantic
Image co-registration function.
5.5, the change of global feature is carried out to generating image, including the color of image and style are modified, and are obtained most
Fusion figure afterwards.
The fusion of Pixel-level fundamentally changes the semanteme of image, different, and the other fusion of feature level is then from image
Image is changed on whole style.Characteristics of image also includes semantic feature and style other than comprising color, texture, shape
Feature.For the color characteristic of image, using the method for image filters, change the color of image on the whole.For image
Style and features are separated the style and features of image and semantic feature using convolutional neural networks (CNN) and deep learning tool
Come so that the fusion of image rises to whole style rank from simple pixel scale.
Color of image feature:
Image filters are a kind of simple and easy methods changing image integral color feature.In order to realize the pseudo-classic of building object image
Effect such as devises high saturation, black and white, misses old times or old friends at the filters.Since image is RGBA four-ways, a 4*5 rank is devised
Component Matrices of the color matrix as four-way, be denoted as A.The component of wherein the first row to fourth line indicates red respectively, green
Color, the component of blue and transparency.Any one pixel in image is all made of RGBA four-ways, uses 5*1's
Column vector indicates, is denoted as C, it will be able to represent each channel pixel value of pixel.Conversion can be calculated using matrix multiplication
Image R afterwards, i.e. R=A*C, such as lower section formula:
R'=a*R+b*G+c*B+d*A+e*1
G'=f*R+g*G+h*B+i*A+j*1
B'=k*R+l*G+m*B+n*A+o*1
A'=p*R+q*G+r*B+s*A+t*1
Wherein, the 5th row e, j, o, t of Component Matrices A indicates the offset of RGBA respectively.Changing offset can be not
Under the premise of influencing other channel components, the pixel value of corresponding channel is changed.
Image style is converted:
The pixel level fusing method of image modifies to image low level information just with the operator in iconology, to figure
As based on the control on whole style, thus it is poor to the processing capacity of details.And based on the image interfusion method of style conversion
It is then to learn semantic and style advanced features in image using CNN, and the result of study is applied in new image, from
And create the image artifacts with different content and style.The two principle has essential distinction.It is actually being answered to improve system
With ease for use and interactivity in the process, the method by the conversion of image style as image co-registration.
It is obvious to a person skilled in the art that will appreciate that above-mentioned Concrete facts example is the preferred side of the present invention
Case, therefore improvement, the variation that those skilled in the art may make certain parts in the present invention, embodiment is still this
The principle of invention, realization is still the purpose of the present invention, belongs to the range that the present invention is protected.
Claims (10)
1. a kind of building images match based on contours extract and the method merged, which is characterized in that including:
1) historical photograph for, obtaining building, pre-processes historical photograph;
2) contours extract, is carried out to previewing photos and pretreated historical photograph, obtains the wheel of historical photograph and previewing photos
Exterior feature figure;
3) lines detection, is carried out to the profile diagram of historical photograph and previewing photos respectively using LSD Straight Line Extractions, and is used
Matching line segments algorithm matches the straight line of historical photograph and previewing photos according to the length of straight line, slope and position feature,
Optimum Matching is obtained to set;
4) two angle matrixes, are obtained, and to angle matrix to angle calculates straight line two-by-two in set to Optimum Matching
Carry out similarity calculation, obtain the similarity of historical photograph and previewing photos, according to similarity auxiliary to building taken pictures or
Photo comparison obtains the high similar photo of similarity;
5) image co-registration processing, is carried out to similar photo and historical photograph so that similar photo is simultaneously displayed on historical photograph
In one photo.
2. the building images match according to claim 1 based on contours extract and the method merged, which is characterized in that
It is described to historical photograph carry out pretreatment include:Dimension scale adjustment is carried out to historical photograph, then converts historical photograph to
Gray-scale map is finally filtered smoothing processing to gray-scale map.
3. the building images match according to claim 1 based on contours extract and the method merged, which is characterized in that
The step 2) specifically includes:
2.1, historical photograph is labeled as F, previewing photos is labeled as G;
2.2, edge detection is carried out to historical photograph F, previewing photos G based on the edge detection algorithm for improving Canny respectively, obtained
Historical photograph profile diagram F ', previewing photos profile diagram G '.
4. the building images match according to claim 3 based on contours extract and the method merged, which is characterized in that
The step 3) specifically includes:
3.1, the straight line in historical photograph profile diagram F ' and previewing photos profile diagram G ' is extracted using LSD Straight Line Extractions, and
It is stored to historical photograph straight line set L respectivelyAWith previewing photos straight line set LBIn;
3.2, using greedy algorithm, by historical photograph straight line set LAStraight line, according to geometric properties and previewing photos straight line set LB
Cathetus is matched, and Optimum Matching team set S is obtained;Wherein, the geometric properties include slope, length and the position of straight line
It sets.
5. the building images match according to claim 4 based on contours extract and the method merged, which is characterized in that
Further include respectively to historical photograph straight line set L after the step 3.1AWith previewing photos straight line set LBIn straight line gathered
It closes, reduces edge and repeat.
6. the building images match according to claim 4 based on contours extract and the method merged, which is characterized in that
The step 3.2 specifically includes:
A, it is followed successively by historical photograph straight line set LAIn each linear scanning previewing photos straight line set LBIn straight line, look for
To all feasible solutions, by threshold decision straight line to whether matching;
B, for meeting matched solution, the gap between two straight lines is calculated, the solution diff of gap minimum between straight line is found:
In above formula, l1, l2Historical photograph straight line set L is indicated respectivelyAWith previewing photos straight line set LBThe length of cathetus;k1,
k2The slope of straight line is indicated respectively;
C, according to the solution diff of gap minimum between straight line, the straight line for choosing minimum value is matched.
7. the building images match according to claim 6 based on contours extract and the method merged, which is characterized in that
It is described by threshold decision straight line to whether matching specially:Calculate historical photograph straight line set LAWith previewing photos straight line collection
Close LBThe adaptive threshold T of cathetusaAnd Tb, the TaAnd TbSlope threshold value and length threshold are indicated respectively;When two opposite positions
It sets approximate straight line while meeting adaptive threshold TaAnd TbWhen, then two straight lines have approximate slope and length, define this
Two straight lines meet matched solution.
8. the building images match according to claim 4 based on contours extract and the method merged, which is characterized in that
The step 4 specifically includes:
4.1, the angle in Optimum Matching team set S between each straight line is calculated, two angle matrix As and B, angle matrix are obtained
Each row and column all represent the angle between two straight lines in A and B, are indicated using upper triangular matrix;
4.2, the similarity r of angle matrix A and B is calculated:
Wherein, m, n indicate angle matrix A, the line number of B matrixes and columns respectively;Indicate the mean value of A matrixes,Indicate B matrixes
Mean value,Indicate weighting coefficient, i.e., the straight line ratio of number of two image zooming-outs.
9. the building images match according to claim 8 based on contours extract and the method merged, which is characterized in that
The step 5) specifically includes:
5.1, image preprocessing:
The scaling coefficient of rotary matrix for reading the preservation of contours extract stage, converts historical photograph according to coefficient matrix,
The blank left by scaling is filled up when transformation using the method for transparent pixels, the final scene and when shooting one made before fusion
It causes;
5.2, mask code matrix is created:
Mask code matrix M is created, the mask code matrix M is identical as similar photo size, the corresponding pixel of every bit on mask code matrix M
Value is the numerical value from 0 to 255, and black 0, white is 255;
5.3, intensity-weighted:
Using mask code matrix as template, using the transparency of pixel in mask code matrix as the weights of each pixel, with the power
Weighted average is done to the transparency of similar photo to historical photograph on the basis of value, obtains new matrix:
H (i, j)=wfF(i,j)+wgG(i,j)
wf+wg=1
Wherein, F indicates that historical photograph image, G indicate that similar photograph image, H indicate that the image after synthesis, i, j indicate image moment
The pixel of battle array the i-th row jth row;wfAnd wgIt is weighting coefficient, wherein w respectivelyfIt is obtained by bit arithmetic by M, wfAnd wgThe sum of be
1;
5.4, image is generated:
It converts new matrix to image, and is shown on client end interface.
10. the building images match according to claim 9 based on contours extract exists with the method merged, feature
In further including step 5.5 after step 5.4:
The change of global feature is carried out to generating image, including the color of image and style are modified, and fusion figure to the end is obtained.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810280577.0A CN108537782B (en) | 2018-04-02 | 2018-04-02 | Building image matching and fusing method based on contour extraction |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810280577.0A CN108537782B (en) | 2018-04-02 | 2018-04-02 | Building image matching and fusing method based on contour extraction |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108537782A true CN108537782A (en) | 2018-09-14 |
CN108537782B CN108537782B (en) | 2021-08-31 |
Family
ID=63482169
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810280577.0A Active CN108537782B (en) | 2018-04-02 | 2018-04-02 | Building image matching and fusing method based on contour extraction |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108537782B (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109308716A (en) * | 2018-09-20 | 2019-02-05 | 珠海市君天电子科技有限公司 | A kind of image matching method, device, electronic equipment and storage medium |
CN109325497A (en) * | 2018-09-20 | 2019-02-12 | 珠海市君天电子科技有限公司 | A kind of image binaryzation method, device, electronic equipment and storage medium |
CN110503108A (en) * | 2019-07-11 | 2019-11-26 | 平安科技(深圳)有限公司 | Architecture against regulations recognition methods and device, storage medium, computer equipment |
CN110544386A (en) * | 2019-09-18 | 2019-12-06 | 奇瑞汽车股份有限公司 | parking space identification method and device and storage medium |
CN111091146A (en) * | 2019-12-10 | 2020-05-01 | 广州品唯软件有限公司 | Image similarity obtaining method and device, computer equipment and storage medium |
CN111652297A (en) * | 2020-05-25 | 2020-09-11 | 哈尔滨市科佳通用机电股份有限公司 | Fault picture generation method for image detection model training |
CN113298726A (en) * | 2021-05-14 | 2021-08-24 | 漳州万利达科技有限公司 | Image display adjusting method and device, display equipment and storage medium |
CN113313101A (en) * | 2021-08-02 | 2021-08-27 | 杭州安恒信息技术股份有限公司 | Building contour automatic aggregation method, device, equipment and storage medium |
CN113362290A (en) * | 2021-05-25 | 2021-09-07 | 同济大学 | Method, storage device and device for quickly identifying collinear features of random target particle planes |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102073995A (en) * | 2010-12-30 | 2011-05-25 | 上海交通大学 | Color constancy method based on texture pyramid and regularized local regression |
CN105354866A (en) * | 2015-10-21 | 2016-02-24 | 郑州航空工业管理学院 | Polygon contour similarity detection method |
CN105957007A (en) * | 2016-05-05 | 2016-09-21 | 电子科技大学 | Image stitching method based on characteristic point plane similarity |
CN107680054A (en) * | 2017-09-26 | 2018-02-09 | 长春理工大学 | Multisource image anastomosing method under haze environment |
-
2018
- 2018-04-02 CN CN201810280577.0A patent/CN108537782B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102073995A (en) * | 2010-12-30 | 2011-05-25 | 上海交通大学 | Color constancy method based on texture pyramid and regularized local regression |
CN105354866A (en) * | 2015-10-21 | 2016-02-24 | 郑州航空工业管理学院 | Polygon contour similarity detection method |
CN105957007A (en) * | 2016-05-05 | 2016-09-21 | 电子科技大学 | Image stitching method based on characteristic point plane similarity |
CN107680054A (en) * | 2017-09-26 | 2018-02-09 | 长春理工大学 | Multisource image anastomosing method under haze environment |
Non-Patent Citations (5)
Title |
---|
QIANG ZHANG ET AL.: "Similarity-based multimodality image fusion with shiftable complex", 《PATTERN RECOGNITION LETTERS》 * |
XIAOYAN LUO ET AL.: "A regional image fusion based on similarity characteristics", 《SIGNAL PROCESSING》 * |
任克强等: "基于改进 SURF 算子的彩色图像配准算法", 《电子测量与仪器学报》 * |
李英杰等: "一种多波段红外图像联合配准和融合方法", 《电子与信息学报》 * |
陈木生: "结合 NSCT 和压缩感知的红外与可见光图像融合", 《中国图象图形学报》 * |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109308716A (en) * | 2018-09-20 | 2019-02-05 | 珠海市君天电子科技有限公司 | A kind of image matching method, device, electronic equipment and storage medium |
CN109325497A (en) * | 2018-09-20 | 2019-02-12 | 珠海市君天电子科技有限公司 | A kind of image binaryzation method, device, electronic equipment and storage medium |
CN110503108A (en) * | 2019-07-11 | 2019-11-26 | 平安科技(深圳)有限公司 | Architecture against regulations recognition methods and device, storage medium, computer equipment |
CN110544386A (en) * | 2019-09-18 | 2019-12-06 | 奇瑞汽车股份有限公司 | parking space identification method and device and storage medium |
CN111091146A (en) * | 2019-12-10 | 2020-05-01 | 广州品唯软件有限公司 | Image similarity obtaining method and device, computer equipment and storage medium |
CN111091146B (en) * | 2019-12-10 | 2024-02-02 | 广州品唯软件有限公司 | Picture similarity obtaining method and device, computer equipment and storage medium |
CN111652297B (en) * | 2020-05-25 | 2021-05-25 | 哈尔滨市科佳通用机电股份有限公司 | Fault picture generation method for image detection model training |
CN111652297A (en) * | 2020-05-25 | 2020-09-11 | 哈尔滨市科佳通用机电股份有限公司 | Fault picture generation method for image detection model training |
CN113298726A (en) * | 2021-05-14 | 2021-08-24 | 漳州万利达科技有限公司 | Image display adjusting method and device, display equipment and storage medium |
CN113362290A (en) * | 2021-05-25 | 2021-09-07 | 同济大学 | Method, storage device and device for quickly identifying collinear features of random target particle planes |
CN113362290B (en) * | 2021-05-25 | 2023-02-10 | 同济大学 | Method, storage device and device for quickly identifying collinear features of dot matrix planes |
CN113313101A (en) * | 2021-08-02 | 2021-08-27 | 杭州安恒信息技术股份有限公司 | Building contour automatic aggregation method, device, equipment and storage medium |
CN113313101B (en) * | 2021-08-02 | 2021-10-29 | 杭州安恒信息技术股份有限公司 | Building contour automatic aggregation method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN108537782B (en) | 2021-08-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108537782A (en) | A method of building images match based on contours extract with merge | |
Changzhen et al. | A traffic sign detection algorithm based on deep convolutional neural network | |
CN104834898B (en) | A kind of quality classification method of personage's photographs | |
Lu et al. | Salient object detection using concavity context | |
CN109903331B (en) | Convolutional neural network target detection method based on RGB-D camera | |
CN103116896B (en) | Visual saliency model based automatic detecting and tracking method | |
CN105894484B (en) | A kind of HDR algorithm for reconstructing normalized based on histogram with super-pixel segmentation | |
CN106651872A (en) | Prewitt operator-based pavement crack recognition method and system | |
CN109508710A (en) | Based on the unmanned vehicle night-environment cognitive method for improving YOLOv3 network | |
CN107092871B (en) | Remote sensing image building detection method based on multiple dimensioned multiple features fusion | |
CN107392929A (en) | A kind of intelligent target detection and dimension measurement method based on human vision model | |
CN104517095B (en) | A kind of number of people dividing method based on depth image | |
CN107705254B (en) | City environment assessment method based on street view | |
CN109657612B (en) | Quality sorting system based on facial image features and application method thereof | |
CN107944437B (en) | A kind of Face detection method based on neural network and integral image | |
CN107944459A (en) | A kind of RGB D object identification methods | |
CN110110682A (en) | The semantic stereo reconstruction method of remote sensing images | |
CN107679470A (en) | A kind of traffic mark board detection and recognition methods based on HDR technologies | |
CN104751407A (en) | Method and device used for blurring image | |
CN105809673A (en) | SURF (Speeded-Up Robust Features) algorithm and maximal similarity region merging based video foreground segmentation method | |
CN107689157A (en) | Traffic intersection based on deep learning can passing road planing method | |
CN104751406A (en) | Method and device used for blurring image | |
CN109886170A (en) | A kind of identification of oncomelania intelligent measurement and statistical system | |
CN109447117A (en) | The double-deck licence plate recognition method, device, computer equipment and storage medium | |
CN103743750A (en) | Method for generating distribution diagram of surface damage of heavy calibre optical element |
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 |