Object counting with Arduino Due

Arduino DUE seems to have fairly powerful hardware to be able to process low resolution images for basic object detection and counting. Can anyone point to me vision algorithms available for Arduino DUE?

I don't want to use Pixy but only use a simple vga camera connected to Arduino DUE over UART/SPI. Then process the image in DUE SAM controller. Initial images could be black & white circles or balls in a picture or anything else.

If I can find ready made object detection and counting code for arduino due, it will be awesome! I have been browsing on internet but haven't come across anything.Thought of joining Arduino Forum and ask for help.