Advanced Iris Tracking Software

Thank you. So, I have everything all connected via pins 4 and 5, and my system has two connecting ground pins. Then I have one of the cameras plugged into the IDE while the other is disconnected. However, I still am not reading any data on my receiving camera. Do you have any ideas of what could be wrong?

Thanks

The code only prints to the IDE. If you want to send data over the UART you have to call the usrt.write() method. Print sends data back to the PC over USB.

So I replace all the example code you gave me with usrt?

If you want I can send you examples of my sending code. The code that’s receiving the data is the code that you provided for me.

Okay, I’ll take a look.

So for my sending code I have,

uart = pyb.UART(3, 115200)

while (True):
    clock.tick()
    # Capture snapshot
    img = sensor.snapshot()
    # Find eyes !
    # Note: Lower scale factor scales-down the image more and detects smaller objects.
    # Higher threshold results in a higher detection rate, with more false positives.
    eyes = img.find_features(eyes_cascade, threshold=0.5, scale=1.5)

    # Find iris
    for e in eyes:
        iris = img.find_eye(e)
        img.draw_rectangle(e)
        img.draw_cross(iris[0], iris[1])
        uart.write("!EYE x:%d, y:%d, w:%d, h:%d" % e)
        uart.write("!IRIS x:%d, y:%d" % iris)

Then for my receiving code I have

uart = UART(3, 19200, timeout_char = 1000)

#LED
blue_led = LED(3)

while(True):
    count = uart.any()
    if count:
        print(uart.read(count))
        blue_led.on()
        time.sleep(1000)

The pins are then setup as I described before.

Thanks

Never mind I got it working. However, I was wondering if you could tell me how to pull a string out of a string. MY data is currently being transmitted in the format of

uart.write("!EYE x:%d, y:%d, w:%d, h:%d" % e)
        uart.write("!IRIS x:%d, y:%d" % iris)

I want to have just the x and y data values at the end, and I am curious as how to go about it. Thank you.

Hi, that would be a general purpose python question. You should Google about how to do that in Python and there’s likely a lot of examples.

Are you using VSCode to debug OpenMV code?