Questions regarding Braid setup

171 views
Skip to first unread message

Elhanan Ben Yishay

unread,
Nov 28, 2019, 8:04:19 AM11/28/19
to multi-camera software from the Straw Lab
Hi Andrew,
So I've got Braid installed, and all the cameras are detected correctly when running them separately via the Strand app.
However, when trying to run the braid-pylon app, only one camera is detected:

braid-pylon run default-config.toml
 INFO
2019-11-28T13:01:34Z: braid: braid 0.7.1+53ed801c6498ce14222a9b9aeb75bd117ffe5cd3 starting
 INFO
2019-11-28T13:01:34Z: flydra2_mainbrain: saving to directory: /home/elhanan_la/Videos
 INFO
2019-11-28T13:01:34Z: flydra2: using TrackingParams TrackingParams { motion_noise_scale: 0.1, initial_position_std_meters: 0.1, initial_vel_std_meters_per_sec: 1.0, ekf_observation_covariance_pixels: 1.0, accept_observation_min_likelihood: 0.00000001, max_position_std_meters: 0.01212, hypothesis_test_params: HypothesisTestParams { minimum_number_of_cameras: 2, hypothesis_test_max_acceptable_error: 5.0, minimum_pixel_abs_zscore: 0.0 } }
Depending on things, you may be able to login with this url: http://127.0.0.1:46081/
 INFO
2019-11-28T13:01:34Z: strand_cam: camera module: async-pylon
 INFO
2019-11-28T13:01:34Z: strand_cam:   camera "Basler-23047980" detected
 INFO
2019-11-28T13:01:34Z: strand_cam:   camera "Basler-23088879" detected
 INFO
2019-11-28T13:01:34Z: strand_cam:   camera "Basler-23088882" detected
 INFO
2019-11-28T13:01:35Z: strand_cam:   got camera Basler-23088882

Then I can connect to the web interface and it shows this data:

No trigger device clock model.

No calibration.

0 cameras:

Data hasn't fetched yet.


Pressing "Synchronize cameras" produces this output on the terminal:
 INFO 2019-11-28T12:56:43Z: flydra2_mainbrain: preparing to synchronize cameras
 INFO
2019-11-28T12:56:43Z: flydra2_mainbrain: preparing for triggerbox to temporarily stop sending pulses
 INFO
2019-11-28T12:56:43Z: flydra2_mainbrain: requesting triggerbox to stop sending pulses
 INFO
2019-11-28T12:56:46Z: flydra2_mainbrain: requesting triggerbox to start sending pulses again

I have attached the config file i am currently using - it is based on the default one, ignoring the calibration for now.

Additionally, I wanted to know regarding the camera calibration - is there any way to start the process via the new version, or do I have to use the old flydra process? and generally, I am currently running this on an Ubuntu 18.04 without ROS installed - is ROS still necassery?

Thanks,
Elhanan
default-config.toml

Andrew Straw

unread,
Nov 28, 2019, 8:22:33 AM11/28/19
to Elhanan Ben Yishay, multi-camera software from the Straw Lab
Dear Elhanen,

My best guess is that the cameras are waiting for a trigger pulse which never comes. Braid puts them into external trigger mode to be able to synchronize them. If this is true, if you switch to Strand-Cam or Pylon Viewer without replugging the cameras, they should still be waiting for external trigger and thus also not show any new frames. What is your trigger setup? I guess your triggerbox is working because otherwise I don’t think Braid would be showing the messages it is. So I suspect it is a cabling issue.

ROS is not needed for Braid. (There is a ROS node that lets you get the realtime data into ROS from it.)

If you want to do VR with our FreemoVR system, you will need ROS. It is probably easiest to get Braid working first and ROS later.

My lab is still on Ubuntu 16.04 and if you use our installers (see “Installation” at https://github.com/strawlab/freemovr_engine ) it will be fairly easy to install all the dependencies.

I hope that helps.

-Andrew

--
You received this message because you are subscribed to the Google Groups "multi-camera software from the Straw Lab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to multicams+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/multicams/b394f60e-d4a8-4b2e-8462-8417ef5fdf4a%40googlegroups.com.
<default-config.toml>

Elhanan Ben Yishay

unread,
Nov 29, 2019, 5:28:28 AM11/29/19
to multi-camera software from the Straw Lab
Hi Andrew - indeed, the wiring was incorrect - I forgot to connect the camera trigger to the GND. Now when running the same command I'm getting the Braid page up and running, and showing all the cameras:

trigger device clock model: ClockModel { gain: 0.01001801120582968, offset: 1575023222.675574, residuals: 0.0001030166406508215, n_measurements: 17 }

No calibration.

3 cameras:
  • Basler_23047980 Unsynchronized RecentStats { total_frames_collected: 0, frames_collected: 0, points_detected: 0 }
  • Basler_23088879 Unsynchronized RecentStats { total_frames_collected: 0, frames_collected: 0, points_detected: 0 }
  • Basler_23088882 Unsynchronized RecentStats { total_frames_collected: 0, frames_collected: 0, points_detected: 0 }

However, I still have a question regarding starting up the calibration acquisition - I am following the instructions here, after installing the make_freemovr_workspace.sh role. I have also downloaded the example ROS configuration files, and placed them in the freemovr_engine folder. However, when trying to run the flycube_only_flydra.launch file I get this error:
 roslaunch freemovr_engine flycube_only_flydra.launch --screen
... logging to /home/elhanan_la/.ros/log/574cf49a-1292-11ea-8aca-4c52622fa18c/roslaunch-nfc3006-2195.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

Traceback (most recent call last):
 
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/__init__.py", line 306, in main
    p
.start()
 
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/parent.py", line 268, in start
   
self._start_infrastructure()
 
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/parent.py", line 217, in _start_infrastructure
   
self._load_config()
 
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/parent.py", line 132, in _load_config
    roslaunch_strs
=self.roslaunch_strs, verbose=self.verbose)
 
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/config.py", line 451, in load_config_default
    loader
.load(f, config, verbose=verbose)
 
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 749, in load
   
self._load_launch(launch, ros_config, is_core=core, filename=filename, argv=argv, verbose=verbose)
 
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 721, in _load_launch
   
self._recurse_load(ros_config, launch.childNodes, self.root_context, None, is_core, verbose)
 
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 685, in _recurse_load
    val
= self._include_tag(tag, context, ros_config, default_machine, is_core, verbose)
 
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 95, in call
   
return f(*args, **kwds)
 
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 589, in _include_tag
    inc_filename
= self.resolve_args(tag.attributes['file'].value, context)
 
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 183, in resolve_args
   
return substitution_args.resolve_args(args, context=context.resolve_dict, resolve_anon=self.resolve_anon)
 
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/substitution_args.py", line 370, in resolve_args
    resolved
= _resolve_args(resolved, context, resolve_anon, commands)
 
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/substitution_args.py", line 383, in _resolve_args
    resolved
= commands[command](resolved, a, args, context)
 
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/substitution_args.py", line 151, in _find
    source_path_to_packages
=source_path_to_packages)
 
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/substitution_args.py", line 197, in _find_executable
    full_path
= _get_executable_path(rp.get_path(args[0]), path)
 
File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 203, in get_path
   
raise ResourceNotFound(name, ros_paths=self._ros_paths)
ResourceNotFound: freemovr_arena
ROS path
[0]=/opt/ros/kinetic/share/ros
ROS path
[1]=/home/elhanan_la/ros/freemovr-kinetic/src
ROS path
[2]=/opt/ros/kinetic/share
Thanks,
Elhanan
To unsubscribe from this group and stop receiving emails from it, send an email to mult...@googlegroups.com.

Andrew Straw

unread,
Nov 29, 2019, 8:31:12 AM11/29/19
to Elhanan Ben Yishay, multi-camera software from the Straw Lab
On 29 Nov 2019, at 11:28 AM, Elhanan Ben Yishay <elha...@gmail.com> wrote:

Hi Andrew - indeed, the wiring was incorrect - I forgot to connect the camera trigger to the GND. Now when running the same command I'm getting the Braid page up and running, and showing all the cameras:

trigger device clock model: ClockModel { gain: 0.01001801120582968, offset: 1575023222.675574, residuals: 0.0001030166406508215, n_measurements: 17 }

No calibration.

3 cameras:
  • Basler_23047980 Unsynchronized RecentStats { total_frames_collected: 0, frames_collected: 0, points_detected: 0 }
  • Basler_23088879 Unsynchronized RecentStats { total_frames_collected: 0, frames_collected: 0, points_detected: 0 }
  • Basler_23088882 Unsynchronized RecentStats { total_frames_collected: 0, frames_collected: 0, points_detected: 0 }

That sounds good, and hopefully the “total_frames_collected” starts increasing and then when you click the “Synchronize” button they cameras all start showing that they are synchronized.

However, I still have a question regarding starting up the calibration acquisition - I am following the instructions here, after installing the make_freemovr_workspace.sh role.

Ahh, yes, these instructions are for the original flydra, which is dependent on ROS. To calibrate Braid, you do not need ROS at all. 

I have started to update those instructions for Braid. See https://github.com/strawlab/nextgen-camera-users/blob/master/users-guide/src/calibration.md (login required for now).

I have also downloaded the example ROS configuration files, and placed them in the freemovr_engine folder. However, when trying to run the flycube_only_flydra.launch file I get this error:

ROS is not required to run Braid in any way.

Best,
Andrew

Elhanan Ben Yishay

unread,
Dec 2, 2019, 4:53:45 AM12/2/19
to multi-camera software from the Straw Lab
Hi Andrew, thank you for all the help.

Currently I have two issues:
1) Braid recognizes all the cameras and is able to calibrate them, however the status stays like this:
Trigger device clock model: ClockModel { gain: 0.010020261484896764, offset: 1575279969.3357232, residuals: 0.0010873918043898811, n_measurements: 66 }

No calibration.

3 cameras:
  • Basler_23047980 Unsynchronized RecentStats { total_frames_collected: 0, frames_collected: 0, points_detected: 0 }
  • Basler_23088879 Unsynchronized RecentStats { total_frames_collected: 0, frames_collected: 0, points_detected: 0 }
  • Basler_23088882 Unsynchronized RecentStats { total_frames_collected: 0, frames_collected: 0, points_detected: 0 }

And no frames are collected. I think the triggerbox is correctly recognized:
 INFO 2019-12-02T09:41:56Z: flydra1_triggerbox: connected to triggerbox firmware version 14
 INFO
2019-12-02T09:41:56Z: flydra2_mainbrain::multicam_http_session_handler: opening session for cam Basler_23047980 to http://127.0.0.1:41903
 INFO
2019-12-02T09:41:56Z: flydra2_mainbrain::multicam_http_session_handler: opening session for cam Basler_23088879 to http://127.0.0.1:40503
 INFO
2019-12-02T09:41:56Z: flydra2_mainbrain::multicam_http_session_handler: opening session for cam Basler_23088882 to http://127.0.0.1:42895
 INFO
2019-12-02T09:46:06Z: flydra2_mainbrain: preparing to synchronize cameras
 INFO
2019-12-02T09:46:06Z: flydra2_mainbrain: preparing for triggerbox to temporarily stop sending pulses
 INFO
2019-12-02T09:46:06Z: flydra2_mainbrain: requesting triggerbox to stop sending pulses
 INFO
2019-12-02T09:46:09Z: flydra2_mainbrain: requesting triggerbox to start sending pulses again

When I'm trying to view the cameras individually using their IP address, no video shows and the UI doesn't respond. However, if I launch them individually using Strand, I am able to view the videos and change the parameters, calibration, etc.


2) if I force shut-down (Ctrl-C) and later try to restart the server, I am unable to run it:
 INFO 2019-12-02T09:49:11Z: braid: braid 0.7.1+53ed801c6498ce14222a9b9aeb75bd117ffe5cd3 starting
 INFO
2019-12-02T09:49:11Z: flydra2_mainbrain: saving to directory: /home/elhanan_la/Videos
 INFO
2019-12-02T09:49:11Z: flydra2: using TrackingParams TrackingParams { motion_noise_scale: 0.1, initial_position_std_meters: 0.1, initial_vel_std_meters_per_sec: 1.0, ekf_observation_covariance_pixels: 1.0, accept_observation_min_likelihood: 0.00000001, max_position_std_meters: 0.01212, hypothesis_test_params: HypothesisTestParams { minimum_number_of_cameras: 2, hypothesis_test_max_acceptable_error: 5.0, minimum_pixel_abs_zscore: 0.0 } }
Depending on things, you may be able to login with this url: http://127.0.0.1:37133/
 INFO
2019-12-02T09:49:11Z: strand_cam: camera module: async-pylon
 INFO
2019-12-02T09:49:11Z: strand_cam:   camera "Basler-23047980" detected
 INFO
2019-12-02T09:49:11Z: strand_cam:   camera "Basler-23088879" detected
 INFO
2019-12-02T09:49:11Z: strand_cam:   camera "Basler-23088882" detected
 INFO
2019-12-02T09:49:11Z: strand_cam:   got camera Basler-23088882

It just gets stuck on that status. I believe it's an issue with the cameras from the previous session not disconnecting properly

Thanks,
Elhanan

Andrew Straw

unread,
Dec 2, 2019, 8:01:18 AM12/2/19
to multi-camera software from the Straw Lab
Dear Elhanen,

I think your cameras are still not being triggered properly. The  'total_frames_collected' variable should increase over time for each camera. I gather it is not doing this currently.

I agree that the USB connection to the trigger box looks good, and Braid is able to connect to it. Also, the fact that Strand Camera has no problems is also good.

We are just testing a release today which should close the camera connections nicely when you push ctrl-c. Provided our internal testing doesn't cause any problems to turn up, I will publish this at the github releases page.

Elhanan Ben Yishay

unread,
Dec 3, 2019, 6:00:21 AM12/3/19
to multi-camera software from the Straw Lab
Dear Andrew,
I built the triggerbox according to the PDF schematic in the triggerbox repository. Are these the correct instructions?

Best
Elhanan

Andrew Straw

unread,
Dec 3, 2019, 7:47:46 AM12/3/19
to multi-camera software from the Straw Lab
Dear Elhanen,

To the best of my knowledge, the schematic in the PDF is correct. You can validate the triggerbox by attaching an oscilloscope and checking that you do indeed get trigger pulses. Still, the PDF schematic of the triggerbox does not specify which pin on your camera is used as the external trigger.

Since it seems that the frame count is not increasing when the camera is set to external trigger mode, I think your cameras are not being triggered.

Best,
Andrew

Andrew Straw

unread,
Dec 4, 2019, 3:55:47 PM12/4/19
to strawlab realtime multi-camera software
This got off-thread, but I'm putting it back here.

---------- Forwarded message ---------
From: Andrew Straw <dr.andr...@gmail.com>
Date: Wed, Dec 4, 2019 at 9:51 PM
Subject: Re: Questions regarding Braid setup
To: Elhanan Ben Yishay <elha...@gmail.com>


Braid uses the default trigger input, which I think is Line 1 on the Basler cameras. (To enable external triggering, Braid sets TriggerMode to On and TriggerSelector to FrameStart.) You should be able to open your camera in the Pylon Viewer App after braid to check its settings. Conversely, you should be able to set its settings and then re-open it in Braid. Apart from a few that get reset explicitly by Braid (such as TriggerMode), Braid will not touch the other settings.

On Wed, Dec 4, 2019 at 1:50 PM Elhanan Ben Yishay <elha...@gmail.com> wrote:
Hi Andrew,
from testing the triggerbox with an oscilloscope it seems I'm getting a nice square-wave at 50Hz (which is weird since I set the frame rate to 100). Is it possible that Braid sets the wrong input line on the Basler cameras themselves? or is there any way to configure which trigger input line to use?

Best
Elhanan

--
You received this message because you are subscribed to the Google Groups "multi-camera software from the Straw Lab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to multicams+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/multicams/955d150e-2c7d-49bb-a9c9-b38716904b5f%40googlegroups.com.

Elhanan Ben Yishay

unread,
Dec 16, 2019, 4:17:08 AM12/16/19
to multi-camera software from the Straw Lab
Hi Andrew,
So I figured what was the issue with the triggering - I was using the GP-I/O cables, which don't have a Line1 configured; when switching to the Opto-I/O cables the cameras trigger properly.
Also, it is not possible to open Pylon after starting Braid - you get a  'Device is exclusively opened by another client.' error.

Finally, I just updated to the new Braid release this morning, and I have an issue where one of the cameras trigger twice as much as the others:

trigger device clock model: ClockModel { gain: 0.005004672333598137, offset: 1576487365.0227346, residuals: 0.0007103912438992666, n_measurements: 27 }

No calibration.

3 cameras:
  • Basler_23047980 Synchronized(7721) RecentStats { total_frames_collected: 8008, frames_collected: 200, points_detected: 0 }
  • Basler_23088879 Synchronized(3799) RecentStats { total_frames_collected: 4001, frames_collected: 101, points_detected: 0 }
  • Basler_23088882 Synchronized(3938) RecentStats { total_frames_collected: 4005, frames_collected: 100, points_detected: 0 }

I've attached a text file with the braid-pylon output after starting it up (It's mostly a "acquisition duration negative?" error for one of the cameras, followed "acquisition duration statistics" warning").

Thanks,
Elhanan

On Wednesday, December 4, 2019 at 9:55:47 PM UTC+1, Andrew Straw wrote:
This got off-thread, but I'm putting it back here.
---------- Forwarded message ---------
From: Andrew Straw <dr.and...@gmail.com>
Date: Wed, Dec 4, 2019 at 9:51 PM
Subject: Re: Questions regarding Braid setup
To: Elhanan Ben Yishay <elha...@gmail.com>


Braid uses the default trigger input, which I think is Line 1 on the Basler cameras. (To enable external triggering, Braid sets TriggerMode to On and TriggerSelector to FrameStart.) You should be able to open your camera in the Pylon Viewer App after braid to check its settings. Conversely, you should be able to set its settings and then re-open it in Braid. Apart from a few that get reset explicitly by Braid (such as TriggerMode), Braid will not touch the other settings.

On Wed, Dec 4, 2019 at 1:50 PM Elhanan Ben Yishay <elha...@gmail.com> wrote:
Hi Andrew,
from testing the triggerbox with an oscilloscope it seems I'm getting a nice square-wave at 50Hz (which is weird since I set the frame rate to 100). Is it possible that Braid sets the wrong input line on the Basler cameras themselves? or is there any way to configure which trigger input line to use?

Best
Elhanan

On Tue, Dec 3, 2019 at 1:47 PM Andrew Straw <dr.and...@gmail.com> wrote:
Dear Elhanen,

To the best of my knowledge, the schematic in the PDF is correct. You can validate the triggerbox by attaching an oscilloscope and checking that you do indeed get trigger pulses. Still, the PDF schematic of the triggerbox does not specify which pin on your camera is used as the external trigger.

Since it seems that the frame count is not increasing when the camera is set to external trigger mode, I think your cameras are not being triggered.

Best,
Andrew
--
You received this message because you are subscribed to the Google Groups "multi-camera software from the Straw Lab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mult...@googlegroups.com.


On Wednesday, December 4, 2019 at 9:55:47 PM UTC+1, Andrew Straw wrote:
This got off-thread, but I'm putting it back here.
---------- Forwarded message ---------
From: Andrew Straw <dr.and...@gmail.com>
Date: Wed, Dec 4, 2019 at 9:51 PM
Subject: Re: Questions regarding Braid setup
To: Elhanan Ben Yishay <elha...@gmail.com>


Braid uses the default trigger input, which I think is Line 1 on the Basler cameras. (To enable external triggering, Braid sets TriggerMode to On and TriggerSelector to FrameStart.) You should be able to open your camera in the Pylon Viewer App after braid to check its settings. Conversely, you should be able to set its settings and then re-open it in Braid. Apart from a few that get reset explicitly by Braid (such as TriggerMode), Braid will not touch the other settings.

On Wed, Dec 4, 2019 at 1:50 PM Elhanan Ben Yishay <elha...@gmail.com> wrote:
Hi Andrew,
from testing the triggerbox with an oscilloscope it seems I'm getting a nice square-wave at 50Hz (which is weird since I set the frame rate to 100). Is it possible that Braid sets the wrong input line on the Basler cameras themselves? or is there any way to configure which trigger input line to use?

Best
Elhanan

On Tue, Dec 3, 2019 at 1:47 PM Andrew Straw <dr.and...@gmail.com> wrote:
Dear Elhanen,

To the best of my knowledge, the schematic in the PDF is correct. You can validate the triggerbox by attaching an oscilloscope and checking that you do indeed get trigger pulses. Still, the PDF schematic of the triggerbox does not specify which pin on your camera is used as the external trigger.

Since it seems that the frame count is not increasing when the camera is set to external trigger mode, I think your cameras are not being triggered.

Best,
Andrew

--
You received this message because you are subscribed to the Google Groups "multi-camera software from the Straw Lab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mult...@googlegroups.com.
braid_191216.txt
Message has been deleted

Andrew Straw

unread,
Dec 18, 2019, 12:58:01 AM12/18/19
to multi-camera software from the Straw Lab

On Monday, December 16, 2019 at 10:17:08 AM UTC+1, Elhanan Ben Yishay wrote:
Hi Andrew,
So I figured what was the issue with the triggering - I was using the GP-I/O cables, which don't have a Line1 configured; when switching to the Opto-I/O cables the cameras trigger properly.

I'm glad to hear that the cameras are now being triggered.

 
Also, it is not possible to open Pylon after starting Braid - you get a  'Device is exclusively opened by another client.' error.

The new release (0.7.2) should behave better in this regard - it should nicely close down the camera when quitting with Ctrl-C (or any other way). Is this still the case with this latest release, or is it now fixed?
 
Finally, I just updated to the new Braid release this morning, and I have an issue where one of the cameras trigger twice as much as the others:

trigger device clock model: ClockModel { gain: 0.005004672333598137, offset: 1576487365.0227346, residuals: 0.0007103912438992666, n_measurements: 27 }

No calibration.

3 cameras:
  • Basler_23047980 Synchronized(7721) RecentStats { total_frames_collected: 8008, frames_collected: 200, points_detected: 0 }
  • Basler_23088879 Synchronized(3799) RecentStats { total_frames_collected: 4001, frames_collected: 101, points_detected: 0 }
  • Basler_23088882 Synchronized(3938) RecentStats { total_frames_collected: 4005, frames_collected: 100, points_detected: 0 }


I think your triggerbox is giving pulses with a shorter interval than your exposure time. In other words, if you have 200 fps trigger pulses (5 msec inter-pulse interval), your exposures should be shorter than 5 msec else you'll skip acquisition on half the pulses as the camera is still doing the previous acquisition. Please either slow your triggerbox pulse rate or shorten the exposure time on the cameras. The log you sent is consistent with this idea.

Andrew Straw

unread,
Dec 18, 2019, 1:02:08 AM12/18/19
to Elhanan Ben Yishay, multi-camera software from the Straw Lab
On Mon, Dec 16, 2019 at 10:26 AM Elhanan Ben Yishay <elha...@gmail.com> wrote:
Hi Andrew, sorry for the double response - I forgot to ask regarding the calibration.
I've already done the internal checkerboard calibration for each camera separately; for the mutli-camera calibration, I assume i need to use braid-pylon to track the LED pointer, convert it to hdf5, and then pass it through flydra_analysis_generate_recalibration?

No, use Braid to record simultaneously from all the cameras. For now, we need to still use the old flydra1 tools, so convert the .braidz file to a flydra1 mainbrain .h5 file. Then run MCSC on this with our Python wrapper. This is described in a bit more detail here https://github.com/strawlab/nextgen-camera-users/blob/master/users-guide/src/calibration.md

Elhanan Ben Yishay

unread,
Dec 19, 2019, 8:18:40 AM12/19/19
to multi-camera software from the Straw Lab
Hi Andrew, thank you very much for all the help.

1. Regarding the camera shut-down - after closing Braid with Ctrl-C I am able to open Pylon and change the settings (for example the trigger line); however once i try to restart Braid it gets stuck relatively early on:
 INFO 2019-12-19T13:11:25Z: strand_cam: camera module: async-pylon
 INFO
2019-12-19T13:11:25Z: strand_cam:   camera "Basler-23047980" detected
 INFO
2019-12-19T13:11:25Z: strand_cam:   camera "Basler-23088879" detected
 INFO
2019-12-19T13:11:25Z: strand_cam:   camera "Basler-23088882" detected
 INFO
2019-12-19T13:11:26Z: strand_cam:   got camera Basler-23088882

And if I try to Ctrl-C:
^C INFO 2019-12-19T13:13:26Z: flydra2_mainbrain: got Ctrl-C, shutting down
^C INFO 2019-12-19T13:13:38Z: flydra2_mainbrain: got Ctrl-C, shutting down
ERROR
2019-12-19T13:13:38Z: flydra2_mainbrain: failed sending quit command: channel closed

2. Regarding the calibration: I am able to get low mean reprojection errors, but I have a question regarding the next step:
Next, using this new calibration, collect a dataset which outlines the geometry of your arena [...] Easist is to acquire this dataset directly by running Braid with the new calibration.
How can I run Braid with the new calibration? From the config file, is see it requires an .xml file (cal_fname = "/path/to/cal.xml"), but none is generated during the calibraiton process.

Thank you
Elhanan

Andrew Straw

unread,
Dec 20, 2019, 4:57:00 AM12/20/19
to multi-camera software from the Straw Lab


On Thursday, December 19, 2019 at 2:18:40 PM UTC+1, Elhanan Ben Yishay wrote:
Hi Andrew, thank you very much for all the help.

1. Regarding the camera shut-down - after closing Braid with Ctrl-C I am able to open Pylon and change the settings (for example the trigger line); however once i try to restart Braid it gets stuck relatively early on:
 INFO 2019-12-19T13:11:25Z: strand_cam: camera module: async-pylon
 INFO
2019-12-19T13:11:25Z: strand_cam:   camera "Basler-23047980" detected
 INFO
2019-12-19T13:11:25Z: strand_cam:   camera "Basler-23088879" detected
 INFO
2019-12-19T13:11:25Z: strand_cam:   camera "Basler-23088882" detected
 INFO
2019-12-19T13:11:26Z: strand_cam:   got camera Basler-23088882

And if I try to Ctrl-C:
^C INFO 2019-12-19T13:13:26Z: flydra2_mainbrain: got Ctrl-C, shutting down
^C INFO 2019-12-19T13:13:38Z: flydra2_mainbrain: got Ctrl-C, shutting down
ERROR
2019-12-19T13:13:38Z: flydra2_mainbrain: failed sending quit command: channel closed


OK, thanks for the report. I am not seeing this on our systems, so it is hard for me to debug. Could this be a triggering issue? In other words, can you check that trigger pulses are being generated during this time? (I presume your trigger cables are not the problem, since they seem to work correctly in other contexts.)

 
2. Regarding the calibration: I am able to get low mean reprojection errors, but I have a question regarding the next step:
Next, using this new calibration, collect a dataset which outlines the geometry of your arena [...] Easist is to acquire this dataset directly by running Braid with the new calibration.
How can I run Braid with the new calibration? From the config file, is see it requires an .xml file (cal_fname = "/path/to/cal.xml"), but none is generated during the calibraiton process.

Elhanan Ben Yishay

unread,
Jan 13, 2020, 8:56:05 AM1/13/20
to multi-camera software from the Straw Lab
Hi Andrew, I currently can't reproduce this error - once I can I'll check the triggering.
I was wondering if I could get some general explanation on the object detection parameters - for example, what does the alpha and n_sigma relate to, as well as the use_cmp, clear_fraction, and despeckle_threshold?

Best
Elhanan

Andrew Straw

unread,
Jan 15, 2020, 1:04:59 AM1/15/20
to multi-camera software from the Straw Lab
Dear Elhanen,

These should behave identically to the parameters in https://github.com/motmot/realtime_image_analysis . Here is a brief description for each:


do_update_background_model: bool

Switch whether to continuously update the background model or not.


What kind of difference from the background model to detect.

alpha: f32

How much to weight the update of the background model. Valid range is 0.0 - 1.0. 0.0 means never update, 1.0 means complete replacement on every update.


n_sigma: f32

Number of standard deviations a pixel must differ by to be detected.

Used when use_cmp is true. No effect when use_cmp is false. Valid range is 0.0 - infinity. 0.0 means any difference is detected, large value means only large deviations from mean are detected.


bright_non_gaussian_cutoff: u8

(used when use_cmp is true)


bright_non_gaussian_replacement: u8

(used when use_cmp is true)


bg_update_interval: u32
How often to update the background model, in number of frames.

Valid range is 0-4294967295.


diff_threshold: u8
If use_cmp is true, this is the absolute difference required to detect a point.

use_cmp: bool
If use_cmp is true, use n_sigma based difference.

max_num_points: u16
How many points above threshold can be detected.

feature_window_size: u16
Half the width (and half the height) of the analysis region. In pixels.

clear_fraction: f32
Reduces moment arm when detecting pixels.

The result of this computation or despecked_threshold is used, whichever is larger. Fraction of the maximum difference value in pixel intensity. Valid range is 0.0 - 1.0. 0.0 means the value is 0, 1.0 means the value used is the maximum difference in pixel intensity between the current image and the mean of the background model.


despeckle_threshold: u8
Reduces moment arm when detecting pixels.

This value or the result of the clear_fraction computation is used, whichever is larger. Intensity difference value. Value range is 0-255.


valid_region: Shape
The shape of the reason over which detected points are checked.

Elhanan Ben Yishay

unread,
Mar 9, 2020, 9:26:59 AM3/9/20
to multi-camera software from the Straw Lab
Hi Andrew,
thank you very much for all the help. I had a few issues recently (that occurred even before updating to the last version). Specifically, I can only synchronize the cameras once, if I try another time i get this error:
[2020-03-09T13:09:51Z INFO  flydra2_mainbrain] preparing to synchronize cameras
[2020-03-09T13:09:51Z INFO  flydra2_mainbrain] preparing for triggerbox to temporarily stop sending pulses
[2020-03-09T13:09:51Z INFO  flydra2_mainbrain] requesting triggerbox to stop sending pulses
[2020-03-09T13:09:54Z INFO  flydra2_mainbrain] requesting triggerbox to start sending pulses again
[2020-03-09T13:09:54Z INFO  flydra2::connected_camera_manager] cam Basler_23047980 synchronized. frame_offset: 361214
[2020-03-09T13:09:54Z INFO  flydra2_mainbrain::multicam_http_session_handler] for cam Basler_23047980, sending frame offset 361214
[2020-03-09T13:09:54Z INFO  flydra2::connected_camera_manager] cam Basler_23088879 synchronized. frame_offset: 361196
[2020-03-09T13:09:54Z INFO  flydra2_mainbrain::multicam_http_session_handler] for cam Basler_23088879, sending frame offset 361196
[2020-03-09T13:09:54Z INFO  flydra2::connected_camera_manager] cam Basler_23096298 synchronized. frame_offset: 361178
[2020-03-09T13:09:54Z INFO  flydra2_mainbrain::multicam_http_session_handler] for cam Basler_23096298, sending frame offset 361178
[2020-03-09T13:09:54Z INFO  flydra2::connected_camera_manager] cam Basler_23088882 synchronized. frame_offset: 361231
[2020-03-09T13:09:54Z INFO  flydra2_mainbrain::multicam_http_session_handler] for cam Basler_23088882, sending frame offset 361231
thread
'triggerbox_comms' panicked at 'cannot access stderr during shutdown', src/libcore/option.rs:1188:5
note
: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[2020-03-09T13:09:54Z ERROR flydra2_mainbrain] done listening for trigger clock data: sender hung up.
Segmentation fault (core dumped)

Followed by a crash.

I also have a question regarding recommended hardware for braid - I currently have 4 Basler acA800-510um, connected to a dedicated 4-USB port PCIe expansion card (USB 3.0 Card PCIe, Fresco FL1100, 4HC, x4, 4Ports specifically). I have it running on an i7-8700k with 16GB memory, recording to an SSD. Often when recording at higher frame rates (100Hz) I get many acquisition duration warnings (see below), and was wondering if you had any suggestions. I am also interested to know if you have any recommendations for an Nvidia card to support fast video recording.
[2020-03-09T13:24:26Z WARN  image_tracker] Basler_23088879 acquisition duration statistics: mode: 99 msec, max: 99+ msec (longest: 2588)
[2020-03-09T13:24:26Z WARN  image_tracker] Basler_23047980 acquisition duration statistics: mode: 99 msec, max: 99+ msec (longest: 2668)
[2020-03-09T13:24:26Z WARN  image_tracker] Basler_23096298 acquisition duration statistics: mode: 99 msec, max: 99+ msec (longest: 2503)
[2020-03-09T13:24:26Z WARN  image_tracker] Basler_23088882 acquisition duration statistics: mode: 99 msec, max: 99+ msec (longest: 2745)

Finally, is there any option to setup braid in such a way that it will record data only if motion is actually detected?

Thanks,
Elhanan

Elhanan Ben Yishay

unread,
Mar 10, 2020, 10:41:47 AM3/10/20
to multi-camera software from the Straw Lab
Hi Andrew, 
I've also got the latest .crash file if it helps:

Thanks,
Elhanan

Elhanan Ben Yishay

unread,
May 20, 2020, 10:31:18 AM5/20/20
to multi-camera software from the Straw Lab
Hi Andrew, how are you doing? I hope everything's going well considering the current situation.
I just wondered if you had any time to look over my previous posts?

I also had a couple of more questions:
1) Regarding the valid_region - I understand how to define it within the Braid browser window,
valid_region:
 
Circle:
    center_x
: 410
    center_y
: 570
    radius
: 600

but I can't seem to make it work within the toml document.
valid_region = "Circle"
center_x
= 410
center_y
= 570
radius
= 600

The error i get is
Error: Error { inner: ErrorInner { kind: Custom, line: None, col: 0, message: "invalid type: unit variant, expected newtype variant", key: ["cameras", "point_detection_config", "valid_region"] } }

I tried to go over the toml documentation but couldn't find anything useful. In general it would be nice to be able to save the configuration.

2) regarding tracking - is Braid supposed to continue tracking flies even when not moving/flying? Very often I would have fine tracking only as long as the fly is actually moving. Once it stops, the tracking stops as well.

3) general questions - are there any plans to integrate FreemoVR with braid, or will it be Flydra-only for now?

Thank you,
Elhanan
Reply all
Reply to author
Forward
0 new messages