Would it be possible to perform the canny edge detection just inside a roi?

General discussion about topics related to OpenMV.
TurboCaca
Posts: 1
Joined: Thu May 31, 2018 12:52 pm

Would it be possible to perform the canny edge detection just inside a roi?

Postby TurboCaca » Fri Jun 01, 2018 1:38 am

I'm starting to play with the OpenMV (thanks for that great project, I'm super newbie in Python, MicroPython and also in Machine Vision).

I have noticed that if I try to run the canny edge detection example with VGA resolution the IDE shows the following message:
MemoryError: FB Alloc Collision
Is it possible to bypass this by performing the canny edge detection just in a part of the image?

Thanks
User avatar
kwagyeman
Posts: 2118
Joined: Sun May 24, 2015 2:10 pm

Re: Would it be possible to perform the canny edge detection just inside a roi?

Postby kwagyeman » Fri Jun 01, 2018 1:45 am

Technically, there's no limit for this. However, we don't have a method yet to resize/crop a part of an image (one isn't there because we've been feature creeping to basically have full blown OpenCV on the camera). Anyway, please create a feature request for this on github to make sure it makes it into the firmware.

That said, you can use sensor.set_windowing((x, y, w, h)) to set a cropped part of the VGA image. This gives you just one smaller image and will let you use the method. If that works for you... i.e. you just wanted a lot of detail then just do that. Otherwise, if you need to canny the full image it's not possible given our limited RAM.
Nyamekye,
User avatar
iabdalkader
Posts: 501
Joined: Sun May 24, 2015 3:53 pm

Re: Would it be possible to perform the canny edge detection just inside a roi?

Postby iabdalkader » Thu Jun 21, 2018 2:30 pm

Hi, there's a bug in Canny edge ROI, the code allocates the gradient array for the whole image (regardless of ROI). It's now fixed and I confirmed it works on OMV3, 4 and will be included in the next release.

Return to “General Topics”

Who is online

Users browsing this forum: Bing [Bot] and 2 guests