Changeset - 386837ecb39c
[Not reviewed]
default
0 1 1
Laman - 6 years ago 2019-04-03 00:05:48

option of running non-interactively
2 files changed with 20 insertions and 3 deletions:
0 comments (0 inline, 0 general)
exp/config.py
Show inline comments
 
new file 100644
 
import os
 

	
 

	
 
INTERACTIVE=False
 
imgDir="/tmp/oneEye"
 
i=1
 

	
 
if not os.path.exists(imgDir):
 
	os.mkdir(imgDir)
exp/hough.py
Show inline comments
 
@@ -3,6 +3,7 @@ sys.path.append("../src")
 

	
 
import math
 
from datetime import datetime
 
import os.path
 
import logging as log
 

	
 
import numpy as np
 
@@ -10,6 +11,7 @@ import scipy.optimize
 
import scipy.signal
 
import cv2 as cv
 

	
 
import config as cfg
 
from geometry import EPoint,Line
 

	
 
DEBUG=True
 
@@ -167,9 +169,15 @@ class HoughTransform:
 

	
 

	
 
def show(img,filename="x"):
 
	cv.imshow(filename,img)
 
	cv.waitKey(0)
 
	cv.destroyAllWindows()
 
	if cfg.INTERACTIVE:
 
		cv.imshow(filename,img)
 
		cv.waitKey(0)
 
		cv.destroyAllWindows()
 
	else:
 
		d=int(datetime.now().timestamp())
 
		path=os.path.join(cfg.imgDir,"{0} {1:03} {2}.png".format(d,cfg.i,filename))
 
		cfg.i+=1
 
		cv.imwrite(path,img)
 

	
 

	
 
def filterVert(edges):
0 comments (0 inline, 0 general)