gilestrolab / ethoscope

a platform from monitoring animal behaviour in real time from a raspberry pi
http://lab.gilest.ro/ethoscope/
GNU General Public License v3.0
17 stars 25 forks source link

Optomotor Module stops with the following error #122

Open budhaChowdhury opened 3 years ago

budhaChowdhury commented 3 years ago
Screen Shot 2020-07-14 at 3 11 24 PM

The Optomotor Module starts up and runs without any problems, but after overnight tracking, exits with the error message.

qgeissmann commented 3 years ago

Hi @budhaChowdhury, thanks,

Does it happen systematically? Does it happen when just tracking? It looks like this is an exception when the input image (within a region of interest) is completely black (mean = 0)... if it is transient (e.g. the camera output a few black frames to start with), we could skip the errors by changing the code to something like:

try:
    scale = 128. / mean[0]
except ZeroDivisionError:
      raise NoPositionError
budhaChowdhury commented 3 years ago

Hi Quentin, Thanks for your feedback! The problem is arising when the lights in the incubator turn back on (respective day) after tracking in the dark (respective night). I just ran the module a couple more times and every single time the tracking stops as the lights are turned back on, even with a lower intensity. Do you think I should still try out the altered code?

ggilestro commented 3 years ago

Are you positive the IR lights are working? this is the kind of error you would expect if IR lights were not functioning but in that case you would expect the error to pop up shortly after lights off. If things are as you suggest, on the other hand, I suppose what is happening is that visible lights create a strong flash of light and the camera closes the shutter as a response, resulting in some pitch black frames.

I don't think we've ever seen that error. We can work around it using the solution Quentin suggested but if you have an IR lights issue you'd still lose data.

On Tue, 14 Jul 2020, 21:22 budhaChowdhury, notifications@github.com wrote:

Hi Quentin, Thanks for your feedback! The problem is arising when the lights in the incubator turn back on (respective day) after tracking in the dark (respective night). I just ran the module a couple more times and every single time the tracking stops as the lights are turned back on, even with a lower intensity. Do you think I should still try out the altered code?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gilestrolab/ethoscope/issues/122#issuecomment-658393782, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFKERNJ7SO44WHLINPLG2TR3S5B5ANCNFSM4OZ2ENBA .

qgeissmann commented 3 years ago

Yes, I would check that the lights are working as well (maybe just take a video). But I would say the untested patch I propose should make the tracking more robust in the case this is just a spurious couple of frames... That would perhaps be smart for us to implement so that long experiments stop after several days of acquisition... That said, it is still very hard to generate completely black frames, which is why we never had this issue...

budhaChowdhury commented 3 years ago

Yep the IR lights are working - I am attaching a screenshot. I ran a couple more times again - it quits with the same error message as the lights turn back on... Quentin can you walk me through how to use the patch? Thanks! ps. Should I also try a different camera?

Screen Shot 2020-07-14 at 5 17 36 PM
qgeissmann commented 3 years ago

@ggilestro Is the update service still running on the new version? I would suggest adding the patch on a github branch so that @budhaChowdhury can update devices to this specific branch for testing...

ggilestro commented 3 years ago

Yes the update service runs as before but just commit this to dev : it's safe enough. Thanks Quentin. Good to see you on board :)

On Tue, 14 Jul 2020, 22:32 Quentin Geissmann, notifications@github.com wrote:

@ggilestro https://github.com/ggilestro Is the update service still running on the new version? I would suggest adding the patch on a github branch so that @budhaChowdhury https://github.com/budhaChowdhury can update devices to this specific branch for testing...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gilestrolab/ethoscope/issues/122#issuecomment-658424385, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFKERJOJV5ZBI5CUUM4YC3R3TFFTANCNFSM4OZ2ENBA .

qgeissmann commented 3 years ago

I don't have much infrastructure to test anything, but I am happy to help anything back-endish :). I can make a PR on dev and you can test.

qgeissmann commented 3 years ago

once the patch goes through to dev, you can update following this information. Ensure you pick the dev branch, not master. That would be very helpful if you let us know how it goes :),

budhaChowdhury commented 3 years ago

Thank you so much, will definitely keep you updated how it goes!

budhaChowdhury commented 3 years ago

Hi Quentin, in the dev branch (for ethoscope) the status says "Software broken"- should I go ahead and update it anyway? Thanks! ps. I am guessing I should update the Ethoscope, and not the node?

ggilestro commented 3 years ago

I am traveling and I have not accepted the modification request yet. Please wait 24h.

On Wed, 15 Jul 2020, 19:52 budhaChowdhury, notifications@github.com wrote:

Hi Quentin, in the dev branch (for ethoscope) the status says "Software broken"- should I go ahead and update it anyway? Thanks! ps. I am guessing I should update the Ethoscope, and not the node?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gilestrolab/ethoscope/issues/122#issuecomment-658910987, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFKEROHCXEMIATCLFBMJ6DR3XUD7ANCNFSM4OZ2ENBA .

budhaChowdhury commented 3 years ago

okay, just checking : ) Thanks a ton!