Пример #1
0
def update_rotation_with_cam():
    global rotation
    cap = capture.capture()
    cam = camera.CamAnalysis()
    while URwC_flag == 1:
        stream = cap.cap()
        cam.morphology_extract(stream)
        cam.save_all_outputs()
        coord = cam.contour_find()

        conX = ((coord[0] - width / 2) / (width / 2)) / math.sqrt(3)
        rotation_lock.acquire()
        rotation = math.degrees(math.atan(-conX))
        rotation_lock.release()
        print(coord[0], rotation)
import lib.capture as capture
import lib.config as config

# set preview to False to disable picamera preview
preview = True

print("What do you want to do?")
print("[1] Capture training images from webcam")
print("[2] Convert '*.jpg' pictures from other cameras to training images")
choice = raw_input("--> ")
print("")
print("Enter the name of the person you want to capture or convert images for.")
capture.CAPTURE_DIR = raw_input("--> ")
print("Images will be placed in " + config.TRAINING_DIR + capture.CAPTURE_DIR)

if choice == "1":
    print("")
    print('-' * 20)
    print("Starting process...")
    print("")
    capture.capture(preview)
else:
    print("")
    print("Please enter path to images or drag and drop folder into terminal")
    capture.RAW_DIR = raw_input("--> ")
    print("")
    print('-' * 20)
    print("Starting process...")
    print("")
    capture.convert()
Пример #3
0
import lib.capture as capture
import lib.config as config

print "What do you want to do?"
print "[1] Capture training images from webcam"
print "[2] Convert '*.jpg' pictures from other cameras to training images"
choice = raw_input("--> ")
print
print "Enter the name of the person you want to capture or convert images for."
capture.CAPTURE_DIR = raw_input("--> ")
print "Images will be placed in " + config.TRAINING_DIR + capture.CAPTURE_DIR

if choice == "1":
	print
	print '-' *20
	print "Starting process..."
	print 
	capture.capture()
else:
	print
	print "Please enter path to images or drag and drop folder into terminal"
	capture.RAW_DIR = raw_input("--> ")
	print
	print '-' *20
	print "Starting process..."
	print 
	capture.convert()
Пример #4
0
from lib import camera 
from lib import capture
import time

try:
    cap = capture.capture()
    cam = camera.CamAnalysis()
    time.sleep(2)
    while True:
        stream = cap.cap()
        cam.morphology_extract(stream)
        coord = cam.contour_find()
        cam.save_all_outputs()
        row = [time.time()]
        row.extend(coord)
        print(row)

finally:
    del cap