Changeset - 9c78e6f2e2ea
[Not reviewed]
default
0 2 0
Laman - 6 years ago 2019-05-14 10:28:31

fixed data generation, color sampler showing filename
2 files changed with 5 insertions and 4 deletions:
0 comments (0 inline, 0 general)
exp/color_sampler.py
Show inline comments
 
@@ -48,7 +48,9 @@ class Sampler:
 
		print("\t".join(map(str, (self.filenames[self.k],*self.pos,self.letter,*self.hsv))))
 

	
 
	def showImage(self):
 
		self.img=Image.open(os.path.join(self.dirname,self.filenames[self.k]))
 
		filename=self.filenames[self.k]
 
		self.img=Image.open(os.path.join(self.dirname,filename))
 
		self.root.title(filename)
 
		(w,h)=self.img.size
 
		self.photo=ImageTk.PhotoImage(self.img)
 
		self.canvas.delete("all")
 
@@ -110,7 +112,7 @@ class Sampler:
 
		self.annotations[self.filename]=[b for b in self._boards if not b.isEmpty()]
 

	
 
	def _createGUI(self):
 
		root=tk.Tk()
 
		self.root=root=tk.Tk()
 
		frame=tk.Frame(root)
 
		frame.grid(column=0,row=0,sticky=(N,S,E,W))
 

	
exp/kerokero/prepare_data.py
Show inline comments
 
@@ -2,7 +2,6 @@ import os
 
import sys
 
import re
 
import random
 
import itertools
 

	
 
import numpy as np
 
import cv2 as cv
 
@@ -40,7 +39,7 @@ class Sample:
 
		img=cv.warpPerspective(self.img,m,(self.SIDE,self.SIDE))
 
		img=np.float32(img)/128-1
 
		grid=Corners(c.transform(m) for c in self.grid)
 
		grid=list(map(lambda p: 2*p/self.SIDE-EPoint(1,1), grid))
 
		grid=list(map(lambda p: list(2*p/self.SIDE-EPoint(1,1)), grid))
 
		return (img,grid)
 

	
 
	def _getCenter(self):
0 comments (0 inline, 0 general)