Beispiel #1
0
def myMain2():

    camera = cv2.VideoCapture(0)
    camera.set(3, 3264)
    camera.set(4, 2448)

    #frame = cv2.imread('Photo-Test/Frames/Picture 500.jpg')
    geometricalImage = WorldImage()
    #ret, frame = camera.read()
    frame = cv2.imread('Photo-Test/Frames/Picture 501.jpg')
    frame = cv2.resize(frame, (960, 720))
    # copyF = copy.copy(frame)
    geometricalImage.buildMap(frame)
    geometricalImage.updateRobotPosition(frame)
    geometricalImage.defineTreasures([88, 30])
    #geometricalImage.findBestTresor()
    geometricalImage.addLabels(frame)
    myTarget = ShapeTarget("pentagone")
    geometricalImage.getIslandPositioning(myTarget)

    geometricalImage.drawMapOnFrame(frame)
    cv2.imshow("resized", frame)
    cv2.waitKey(0)
Beispiel #2
0
def myMain():
    #frame = cv2.imread('Photo-Test/Frames/Picture 500.jpg')
    geometricalImage = WorldImage()

    camera = cv2.VideoCapture(1)

    while(True):

        ret, frame = camera.read()
        #frame = cv2.imread('Photo-Test/Frames/Picture 500.jpg')
        frame = cv2.resize(frame, (960, 720))
        copyF = copy.copy(frame)

        geometricalImage.buildMap(frame)
        geometricalImage.updateRobotPosition(frame)
        geometricalImage.addLabels(frame)
        worldImage = geometricalImage.drawMapOnFrame(frame)
        cv2.imshow("resized", worldImage)

        if cv2.waitKey(1) & 0xFF == ord('q'):
            break
Beispiel #3
0
        # x = np.arange(0, 1200)
        # y = line(x).astype(np.uint)
        #
        # cv2.line(frame, (x[0], y[0]), (x[-1], y[-1]), (0,0,0))
        # cv2.imshow("foo",frame)
        # cv2.waitKey()

    while (True):
        ret, frame = camera.read()
        #frame = cv2.imread('Photos/3105/table 5/Jour/rideau ferme/Picture 1.jpg')
        cv2.resize(frame, (960, 720))
        geometricalImage = WorldImage()
        geometricalImage.buildMap(frame)
        geometricalImage.updateRobotPosition(frame)
        geometricalImage.addLabels(frame)
        # worldV = worldVision()
        # map = worldV.getCurrentImage()
        worldImage = geometricalImage.drawMapOnFrame(frame)
        #print(geometricalImage.getMap().robot.findCenterOfMass())

        cv2.imshow('Picture ' + str(x), worldImage)

        # geometricalImage = WorldImage(frame)
        # geometricalImage.setMap()
        # geometricalImage.addLabels()
        # worldImage = geometricalImage.drawMapOnImage()

        if cv2.waitKey(1) & 0xFF == ord('q'):
            break
    #cap.release()
        # cv2.imshow("foo",frame)
        # cv2.waitKey()



    while(True):
        ret, frame = camera.read()
        #frame = cv2.imread('Photos/3105/table 5/Jour/rideau ferme/Picture 1.jpg')
        cv2.resize(frame, (960,720))
        geometricalImage = WorldImage()
        geometricalImage.buildMap(frame)
        geometricalImage.updateRobotPosition(frame)
        geometricalImage.addLabels(frame)
        # worldV = worldVision()
        # map = worldV.getCurrentImage()
        worldImage = geometricalImage.drawMapOnFrame(frame)
        #print(geometricalImage.getMap().robot.findCenterOfMass())

        cv2.imshow('Picture ' + str(x), worldImage)


        # geometricalImage = WorldImage(frame)
        # geometricalImage.setMap()
        # geometricalImage.addLabels()
        # worldImage = geometricalImage.drawMapOnImage()

        if cv2.waitKey(1) & 0xFF == ord('q'):
            break
    #cap.release()