I am working on a object detection project, and I need to choose a camera or image sensor which can work with both raspberry pi or arduino. It needs to have SPI interface. Actually what I am wondering about is if there is any restriction on resolution when it comes to object detection or object counting. I am very new in this area and not sure how to optimize system as it is working with very low system and it can count thing at the same time. Have any ideas, any clues?
Edit: OpenCV, Keras, Tensorflow or similar algorithms or frameworks could be related with my project. It is not decided yet. Open for new tips on this and plus you can take into consideration when you answer my question.
When using the SPI interface of an Arduino board you cannot expect a transfer rate of more than 5 - 10 Mbps (Megabits per second). Let's assume the camera sensor have 8-bit pixels, then what you can "affort" (bandwidth-wise) is 0.6 - 1.2MPixels / per second. And for, say, a frame rate of 20fps that corresponds to a resolution of about 200x150 pixels.
A way to get higher resolution is to use compression, as, for example, the ArduCam module does. But then you have to spend computation time on decompressing the images before processing.
If you, on the other hand, choose to only support Raspberry Pi, you can use the readily available 8MPixel Camera Module that uses the CSI port.
So how may pixels do you need for object detection? That depends on the actual application. In the extreme you can think of a system with only one pixel where light means "no object" and dark means "object present". You could say that the more advance and complex detection algorithm you are using the more pixels you need.