Ejemplo n.º 1
0
hgmethod = 'sparse'  #Sparse/dense homography method
hgseed = [50000, 0.1, 5.0]  #Seeding parameters (max. pts, quality, min.
#distance)
hgtrack = [(25, 25), 1.0, 4]  #Tracking parameters (window size, backtracking
#threshold, min. number of pts)

#Set up Homography object
homog = Homography(camimgs,
                   cameraenvironment,
                   caminvmask,
                   calibFlag=True,
                   band='L',
                   equal=True)

#Calculate homography
hg = homog.calcHomographies([hgmethod, hgseed, hgtrack])
homogmatrix = [item[0] for item in hg]

#----------------------   Detect and calculate areas  -------------------------

#Define Area class initialisa
colour = False  #Define colour range?
verify = False  #Manually verify detected areas?
calibFlag = True  #Detect with corrected or uncorrected images
maxim = 0  #Image number of maximum areal extent
imband = 'R'  #Desired image band
equal = True  #Images with histogram equalisation?
threshold = 5  #Threshold for number of retained polygons
diff = 'light'  #Image enhancement parameter 1
phi = 50  #Image enhancement parameter 2
theta = 20  #Image enhancement parameter 3
Ejemplo n.º 2
0
#---------------------   Calculate homography   -------------------------------

#Set homography parameters
hmethod = 'sparse'  #Method
hgwinsize = (25, 25)  #Tracking window size
hgback = 1.0  #Back-tracking threshold
hgmax = 50000  #Maximum number of points to seed
hgqual = 0.1  #Corner quality for seeding
hgmind = 5.0  #Minimum distance between seeded points
hgminf = 4  #Minimum number of seeded points to track

#Set up Homography object
homog = Homography(camimgs, cam, invmask, calibFlag=True, band='L', equal=True)

#Calculate homography
hg = homog.calcHomographies(
    [hmethod, [hgmax, hgqual, hgmind], [hgwinsize, hgback, hgminf]])

homogmatrix = [item[0] for item in hg]

#-----------------------   Calculate/import lines   ---------------------------

#Set up line object
terminus = Line(camimgs, cam, homogmatrix)

#Manually define terminus lines
lines = terminus.calcManualLines()

##Import lines from textfiles
#xyzfile=destination+'line_realcoords.txt'
#pxfile=destination+'line_pxcoords.txt'
#lines=importLineData(xyzfile, pxfile)