Exemple #1
0
def rectify(camera_matrix,dist_coefs,Size,R,T,gray,displacement):

    canvasMD = gray[displacement:,:]
    (w,h,q) = canvasMD.shape

    R1,R2,P1,P2,Q,qw,qw2 = cv2.stereoRectify(camera_matrix,dist_coefs,
                      camera_matrix,dist_coefs,
                      (w,h),
                      R,
                      T)

    mapx1,mapy1 = cv2.initUndistortRectifyMap(camera_matrix,dist_coefs,R1,P1[:,0:3],(w,h),cv2.CV_32FC1)

    img1 = cv2.remap(canvasMD,mapx1,mapy1,cv2.INTER_LINEAR)

    canvasMU = gray[:displacement,:]
    (w,h,q) = canvasMU.shape

    browse.browse(canvasMU)

    mapx2,mapy2 = cv2.initUndistortRectifyMap(camera_matrix,dist_coefs,R2,P2[:,0:3],(w,h),cv2.CV_32FC1)
    img2 = cv2.remap(canvasMU,mapx2,mapy2,cv2.INTER_LINEAR)

    return img1,img2
Exemple #2
0
 def generateBrowsePage(self):  
    #hianyzo hetek potlasa
    for w in range(1, self.currentweek):
       if not w in self.photos:
          p = Photo()
          p.small_url = 'thumb_unknown.jpg'
          p.week = w
          p.width = 500
          p.height = 333
          p.normal_url = 'small_unknown.jpg'
          p.imagetime = '???'
          self.generatePhotoPage(p)
          self.photos[w] = p   
          
    tpl = browse()
    tpl.photos = self.sortDict(self.photos)
    out = open("browse.html",'w')
    out.write(tpl.respond())
    out.close() 
Exemple #3
0
def main_layout():
	global frame2, p2
	p2=tk.Tk()
	p2.title('Main')
	p2.config(bg='white')	

	RWidth=p2.winfo_screenwidth()
	RHeight=p2.winfo_screenheight()
	SCR_SIZE=[RWidth-15,RHeight-80]

	p2.geometry(("%dx%d+%d+%d")%(SCR_SIZE[0],SCR_SIZE[1],5,5))	
	p2.resizable(0,0)

	frame1=tk.Frame(p2, bg='#000', width=SCR_SIZE[0], height=SCR_SIZE[1]*0.05)
	frame1.pack()
	frame1.place(y=0, relwidth=1, relheight=0.05)

	frame2=tk.Frame(p2, bg=cns.var_color['MAIN_TAB_ACT'], width=SCR_SIZE[0], height=SCR_SIZE[1]*0.8)	
	frame2.pack()
	frame2.place(y=SCR_SIZE[1]*0.05, relwidth=1, relheight=0.8)	

	but1=tk.Button(frame1, text='Files!!!', bg=cns.var_color['MAIN_TAB_INACT'], bd=0, fg='white', command= lambda: browse.browse(1,p2))
	but1.pack()
	but1.place(x=0, y=0.2*frame1.cget('height'), relwidth=0.2, relheight=0.8)

	but2=tk.Button(frame1, text='Other!!!', bg=cns.var_color['MAIN_TAB_ACT'], bd=0, fg='white', command= lambda: browse.browse(2,p2))
	but2.pack()
	but2.place(x=0.2*frame1.cget('width'), y=0.2*frame1.cget('height'), relwidth=0.2, relheight=0.8)
Exemple #4
0
from browse import browse
a = browse()
images = {}
img = {}
img['landscape'] = True
img['url'] = 'x'
img['week'] = 1
images[1] = img
a.images = images
print a