import cv2
from camera_calibration import *
from camera_feed import *
from app import *
#from distance_to_camera import *

def main():
    matrix, distance, newmatrix, = find_calibration_parameters()
    fixedimage = cv2.undistort("/home/pi/patniChipy2019/working_code/photo.jpg", matrix, distance, None, newmatrix)
    cv2.imwrite('/home/pi/patniChipy2019/working_code/photo.jpg', fixedimage)
    image = take_photo()
    distance = image.get_distance()

#    move_ball(distance, x)

main()
