Exemplo n.º 1
0
    def __init__(self, serialport='/dev/ttyACM1',x_arm_adj=0,y_arm_adj=0):

        #Calibrate Camera XY vs. Arm coordinates XY
        #x_camera=x_arm    y_camera=y_arm
        self.x_arm_adj=2.62 #cam_x Zero Position vs. arm X zero position
        self.y_arm_adj=8.85 #cam_y Zero Position vs. arm Y zero positoin

        #initialize detection
        self.cameraXYZ=camera_realworldxyz.camera_realtimeXYZ()

        #initiate arduino
        #serialport='/dev/ttyACM1',LOW_Z=-20.5, HOVER_Z=-16.5,DROP_Z=-18.5, MID_Z=-15, HIGH_Z=-6
        self.arm_c=commands_arduino.arm_controller(serialport,-20.5,-16.5,-18.5,-15,-6)
Exemplo n.º 2
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     print("[INFO   ] [Cobot RCS   ] [Response    ] Analyzing request...")
     self.imgdir="Images/"
     self.xyzcal = camera_realtimeXYZ()
#https://docs.opencv.org/3.3.0/dc/dbb/tutorial_py_calibration.html

import numpy as np
import cv2
import glob
import camera_realworldxyz

cameraXYZ = camera_realworldxyz.camera_realtimeXYZ()

calculatefromCam = True

imgdir = "/home/pi/Desktop/Captures/"

writeValues = False

#test camera calibration against all points, calculating XYZ

#load camera calibration
savedir = "camera_data/"
cam_mtx = np.load(savedir + 'cam_mtx.npy')
dist = np.load(savedir + 'dist.npy')
newcam_mtx = np.load(savedir + 'newcam_mtx.npy')
roi = np.load(savedir + 'roi.npy')

#load center points from New Camera matrix
cx = newcam_mtx[0, 2]
cy = newcam_mtx[1, 2]
fx = newcam_mtx[0, 0]
print("cx: " + str(cx) + ",cy " + str(cy) + ",fx " + str(fx))

#MANUALLY INPUT YOUR MEASURED POINTS HERE
Exemplo n.º 4
0
    def __init__(self):

        #initialize detection
        self.cameraXYZ = camera_realworldxyz.camera_realtimeXYZ()