spoonsso / dannce

MIT License
210 stars 30 forks source link

Low quality cameras for dannce? #93

Closed SEONGGAP closed 2 years ago

SEONGGAP commented 2 years ago

Hi, I'm a newbie here,currently trying to set-up dannce for my new project. I figured out it takes extremely long to receive machine-vision cameras such as Flea3 here in Korea (several months at least!). I'm wondering whether I can use Rasberry Pie cameras for the dannce. Or any recommendations?

diegoaldarondo commented 2 years ago

Hello!

I'm wondering whether I can use Rasberry Pie cameras for the dannce.

Yeah, we've used Raspberry Pi High Quality Cameras before. From what I remember of older versions of the cam, the main things to consider are 1. the tradeoff between fps and image size and 2. syncing the cameras. Setting the right fps/image size will depend on your experiment, but generally you want the largest image size compatible with your minimum required fps. Syncing the cameras can be done either with an external pulse that triggers the cameras simultaneously, or post-hoc by saving timestamps for all frames and stitching them together. We've used the second method in the past with RPi Cams.

additional question) can I use a set of 5 cameras consisting of different models? (e.g., one flea3, one blackfly etc...)

Yes, as long as you save them in the same video format and handle the syncing appropriately. I believe that everything should be compatible with variable image sizes. @spoonsso Is this still the case?

I'm not sure whether campy will handle different FLIR cameras, so you might need to adjust the acquisition code or write your own in that case. @ksseverson57 Any thoughts on this?

SEONGGAP commented 2 years ago

Thank you for your detailed reply.

We will try setting up the Dannce with Raspberry Pi High Quality Cameras following your advice.

Thanks.

SEONGGAP commented 2 years ago

@diegoaldarondo , could you specify what lens did you use for the RPi HQ camera? I found there are some issue #88 with the wide-angle lens (center distortion), not sure whether I can use it or should use the telephoto lens (distortion-free). In the case of the telephoto lens, how far the camera should be located from the behavior arena?

diegoaldarondo commented 2 years ago

All lenses have some degree of optical distortion. Dannce supports the standard lens distortion models in Matlab and OpenCV. You should be able to use any non-fisheye lens if appropriately calibrated. I'm not sure which lens was used in the rpis.

I can't give a useful distance recommendation for either lens because I don't know what you are trying to image. You can find focal length calculators online that can help you find the optimal distance given the lens, desired image, and subject statistics. Omni focal length calulator is an example.