AdaptiveMotorControlLab / Camera_Control

a Python API to record video & system timestamps from Imaging Source USB cameras
MIT License
62 stars 13 forks source link

camera freeze and unequal length of videos #1

Closed cgutierrez-Ibanez closed 4 years ago

cgutierrez-Ibanez commented 4 years ago

Hi

I am using camera control with two Imaging Source USB3 cameras. I have two issues.

one: while recording one of the cameras randomly freezes. I get no error, so is hard to know what the issue is but wonder if you had any problem like this.

second, i recorded a behaving animal with the 2 cameras, analyzed with deeplabcut, and then got the 3d pose. all works but when attempting to create a 3d labeled video, I get the error,

could not broadcast input array from shape (112464) into shape (112773)

which let me to look at the length of the 2d pose csv files and I see the number above are the number of frames, which means that camera control is giving me slight different length for the two videos. This is true for other pairs of recordings.

any idea why this may be happening? I am recording at 500 fps by the way.

Thank you for your time.

Cristian

MMathisLab commented 4 years ago

For issue 1, I haven't seen this behavior, sorry!

It may be that at 500 FPS the memory is filling up, and you are getting dropped frames. You do get the timestamps that you could postdoc align and then interpolate, but you first might want to check if at a lower frame rate you get the same issue. Typically I only have a frame or two difference, and then looking at the timestamps file it's at the end of the acquisition, one frame might be grabbed vs. the other camera.

gkane26 commented 4 years ago

For 1, reinstall the latest driver for the cameras: https://www.theimagingsource.com/support/downloads-for-windows/ . I’ve run into this issue previously and updating the drivers has solved the problem.

For 2, I’m not sure the software can keep up with a 500 FPS frame rate on two cameras. One of the cameras probably lagged for a bit causing the discrepancy. Can you double check the difference in the frame time stamps to confirm? In any case, it’s important to make sure the 2D poses used for 3D pose estimation are aligned - interpolation can solve the problem.

On Thu, Dec 12, 2019 at 15:33 cgutierrez-Ibanez notifications@github.com wrote:

Hi

I am using camera control with two Imaging Source USB3 cameras. I have two issues.

one: while recording one of the cameras randomly freezes. I get no error, so is hard to know what the issue is but wonder if you had any problem like this.

second, i recorded a behaving animal with the 2 cameras, analyzed with deeplabcut, and then got the 3d pose. all works but when attempting to create a 3d labeled video, I get the error,

could not broadcast input array from shape (112464) into shape (112773)

which let me to look at the length of the 2d pose csv files and I see the number above are the number of frames, which means that camera control is giving me slight different length for the two videos. This is true for other pairs of recordings.

any idea why this may be happening? I am recording at 500 fps by the way.

Thank you for your time.

Cristian

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/AdaptiveMotorControlLab/Camera_Control/issues/1?email_source=notifications&email_token=ADZNOGPMKTST4PEVYNF5XA3QYKN2TA5CNFSM4J2EBI72YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IAFAGRA, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADZNOGLAW2ADMWGI73B552DQYKN2TANCNFSM4J2EBI7Q .

MMathisLab commented 4 years ago

@cgutierrez-Ibanez did the above solve your issue(s)?

cgutierrez-Ibanez commented 4 years ago

Thank you for the responses. I got caught up with end of the year things so I haven't been able to test all this, but next week I will. unfortunately, the time stamps files were deleted, but I will run some tests next week.

cgutierrez-Ibanez commented 4 years ago

Hi,

First, we updated the drivers and seems to have fixed the freezing problem. Second, we run some test videos at 100, 300 an 500 fps (before updating the driver). At 100 the time stamps look identical for both cameras but at 300 and 500 they are of unequal lengths (this even after 1 min). after updating the driver, recording at 300 fps do have the same time stamps but not at 500, where you still get missing frames. 300 fps may be enough for what we want but I will keep all timestamp files from now own in case interpolation is needed. Thank you for the help.

best,