예제 #1
0
    cam.closeCamera()
    sys.exit(1)

print("sucessful open")

while count<=10:
    count = count + 1
    #这里有个摄像头获取图片
    #frame = cv.imread("/home/domistic/ssd_pytorch/pic/00000.png")
    frame = cam.transColorImg()
    cv.imwrite("/home/domistic/Vision/Frame/frame_all.jpg",frame)
    frame = cv.imread("/home/domistic/Vision/Frame/frame_all.jpg")
    frame_path = "/home/domistic/Vision/Frame/frame_all.jpg"
    processor.passMat(frame,frame_path)

    detect_name = processor.getAllObject()
    obj_num = len(detect_name)
    print("the number of objects detected is " + str(obj_num))
    cam.Awaken()

cam.closeCamera()
result_name = processor.object_sort()
print("Result:")
print(result_name)

outfile_path = "/home/domistic/Vision/Result/out_all.txt"
with open(outfile_path,'w') as outfile:
    for name in result_name:
        outfile.write(name)
        outfile.write('\n')
processor.drawObjectAll()