Hi there, I am fairly new to OpenMV,
I want to track a black line using ROIS, which works fine. However, I also want to detect green rectangles along the line, this is where the problem lies. It detects green rectangles but it counts too many as you can see below. I save the c-coordinates of every green blob in a list and want to get the amount of green blobs in the picture (which should be three in the picture below). The output always says there are 8 green blobs.
I already tried to adjust the green Threshold (currently: green = [(15, 45, -50, -10, 0, 40)] ) but no matter what I choose, it either sees no green or too many.
I hope someone can help me!
Please update your firmware because that behavior shouldn’t happen with the newest code. Then set the “merge=True” flag for find_blobs. This will merge overlapping blobs. If you’re still having issues increase the merge “margin=”.
Thank your for your answer. Updating the firmware helped, thank you very much! I wonder why the firmware was outdated, I didn’t buy the Cam that long ago…
The firmware that ships with the M4 is from last year. It got programmed once during production.
Oh, this makes sense. I now get an
"Uncaught exception in ExtInt interrupt handler line[...]"
. Has this to do with the new firmware, because it worked fine before? Is there something I need to change compared to before?
spi = pyb.SPI(2, pyb.SPI.SLAVE, polarity=0, phase=0)
spi.send_recv(send=spiSendData, recv=spiRecData ,timeout=10)
except OSError as err:
except NameError as err:
extIntCs = ExtInt(Pin('P3'), ExtInt.IRQ_FALLING, Pin.PULL_NONE, spi_cs_interrupt_callback)
Mmm, not sure, but, from my own testing I know trying to handle SPI data via a CS interrupt callback doesn’t really work. The CS line and clocked data starts too quickly. See the Arduino SPI example. I put a lot of notes together on this.
Thank you. I was confused, because it worked before that way, and after updating it didn’t. I managed to get it working again, thank you.