Pratiksha
Pratiksha

Reputation: 56

ArUco markers for primesense caramine 1.09 in python

Did anyone use primesense caramine 1.09 with ArUco marker detector in python? I had tried to run commands of aruco detector for webcamera , it is working fine. But when I tried to run this commands with primesense I am not able to detect markers. I had passed the single frame.

This is the code

frame = np.load("rgb_primesense.npy")
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
aruco_dict = aruco.Dictionary_get(aruco.DICT_6X6_1000)
parameters = aruco.DetectorParameters_create()
corners, ids, rejectedImgPoints = aruco.detectMarkers(gray, aruco_dict,    parameters=parameters)

font = cv2.FONT_HERSHEY_SIMPLEX #font for displaying text (below)
if np.all(ids != None):
   rvec, tvec,_ = aruco.estimatePoseSingleMarkers(corners[0], 0.05, mtx, dist) 

   aruco.drawAxis(frame, mtx, dist, rvec[0], tvec[0], 0.1) #Draw Axis
   aruco.drawDetectedMarkers(frame, corners) #Draw A square around the markers
   cv2.putText(frame, "Id: " + str(ids), (0,64), font, 1, (0,255,0),2,cv2.LINE_AA)

   np.save("rvec", rvec)
   np.save("tvec", tvec)

Thanks in advance.

Upvotes: 0

Views: 82

Answers (1)

Pratiksha
Pratiksha

Reputation: 56

The issue was with the image quality. It was very poor to get

gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY).

Upvotes: 1

Related Questions