Skip to content
Snippets Groups Projects
Commit 9b5d541a authored by Zhiying Li's avatar Zhiying Li
Browse files

c

parent 03a2fcca
No related merge requests found
No preview for this file type
...@@ -21,12 +21,13 @@ def get_AT_6DOF_info(url, detectFlag = True): ...@@ -21,12 +21,13 @@ def get_AT_6DOF_info(url, detectFlag = True):
header = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36."} header = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36."}
try: req = Request(url, headers=header)
req = Request(url, headers=header) img_resp = urlopen(req, timeout=60)
img_resp = urlopen(req, timeout=60) # try:
except: #
print ("April Tag Camera ERR",err) # except:
return tid,tx,ty,tz,rx,ry,rz # print ("April Tag Camera ERR",err)
# return tid,tx,ty,tz,rx,ry,rz
imgnp = np.array(bytearray(img_resp.read()), dtype=np.uint8) imgnp = np.array(bytearray(img_resp.read()), dtype=np.uint8)
......
No preview for this file type
No preview for this file type
No preview for this file type
...@@ -99,15 +99,15 @@ def detectLive(url , model, minDetectionScore = 0.90, showSight = True): ...@@ -99,15 +99,15 @@ def detectLive(url , model, minDetectionScore = 0.90, showSight = True):
dist = -1 dist = -1
header = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36."} header = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36."}
req = Request(url, headers = header)
try: img_resp = urlopen(req, timeout = 60)
req = Request(url, headers = header) imgnp = np.array(bytearray(img_resp.read()), dtype = np.uint8)
img_resp = urlopen(req, timeout = 60) frame = cv2.imdecode(imgnp, -1)
imgnp = np.array(bytearray(img_resp.read()), dtype = np.uint8) # try:
frame = cv2.imdecode(imgnp, -1) #
except: # except:
print ("Green Ball Camera ERR ",err) # print ("Green Ball Camera ERR ",err)
return gbx, gby, dist # return gbx, gby, dist
labels, boxes, scores = model.predict(frame) labels, boxes, scores = model.predict(frame)
for i in range(boxes.shape[0]): for i in range(boxes.shape[0]):
......
No preview for this file type
No preview for this file type
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment