Shadow detection: keeping shadows rather than removing

hi there –

I’m doing a project at the moment where I want to just keep shadows from frames, and remove the rest of the information. I’ve been playing with the shadow frame differencing examples, and was wondering whether it was possible to extract the detected shadow outline as a binary mask, then apply it to the image?



Yes, use Canny edge filtering. Then flood fill to fill the areas. Targeting the right area is tricky however for flood fill.

thankyou! to clarify, does the canny filtering get applied directly to the shadow removal function, or to the image once the shadows have been removed? (in the latter case, won’t other edges also get picked up?)

I removed the shadow removal method. It just didn’t work well. Not supporting that anymore.

If you are trying to make some type of shadow removal system using frame differencing I recommend not to… it’s quite hard and not robust.

Use an image classifier train with TF if you can if you are trying to do detection. We’ll have bounding box support out later this year too.

Hi, thanks so much for your help! I got a PyTorch model working on my computer, but from the docs it looks like I need to port it to TF to get it to work – is that the case?

I was also wondering, is it possible to use PIL on the board? I can see some forum posts referencing it, but can’t find anything in the docs. Apologies if I’m missing something obvious!

Hi, the board doesn’t run PIL. Please remember that it’s not desktop python but MicroPython.

As for your model. We seriously recommend just using Edge Impulse. There is very little value doing the TF yourself on a PC.