Allied vision camera capture

632 views
Skip to first unread message

joao.f...@neuro.fchampalimaud.org

unread,
Feb 16, 2016, 4:44:25 AM2/16/16
to Bonsai Users
Hi, 

I've tried to capture some video with a Pike camera from allied vision and it didn't work.
has anyone been able to capture video in bonsai with these cameras?

What ways can I solve this other than get another camera, and, btw, what cameras work with bonsai.


goncaloclopes

unread,
Feb 16, 2016, 9:21:17 AM2/16/16
to Bonsai Users
Hi João,

Actually the Allied Vision Pike cameras were the very first ones to be integrated into Bonsai. What happened is that over time they stopped being so "trendy" for some reason (e.g. too expensive for their specs) and we ended up never releasing the package to the public.

I still have the code with me but I'm not sure if it works with the latest version of their drivers. Can you tell me what is the version of the Allied Vision drivers that you have? I'll give it a quick look.

In the meantime what you can do is the following: I've attached the old code for the FireWrapCamera that I had here. If you can install their drivers, you should be able to create a new Bonsai package (see tutorial here) and build it with references to their API. If you can get it to build, it should in principle work.

About your second question, we currently have direct integration with PointGrey, DirectShow and OpenCV capture drivers. "Unofficially" we have developed integration with uEye cameras, CLEye (Playstation) cameras, AVT cameras, Microtron/Basler (through NI-IMAQ; see this thread). 

There are two limitations in developing and maintaining these packages for public use:

1) Licensing: some of these libraries actually have license agreements that prohibit you from redistributing their APIs in 3rd party applications; this means we cannot legally host these packages in the Bonsai package manager (sometimes it's not even clear from the license and we need to spend time reading a lot of legal documents so we kind of "give up").

2) Hardware availability: in order to test a lot of this code you need the actual hardware. Some of these cameras (like the Microtron) I have actually never even used or touched, so there is no way that I can write the necessary interface code.

The "ideal" way for this to work would be for camera users to either submit their hardware / software code for interfacing the devices with Bonsai so we can share a common code base. In this way someone would just need to write the code once and then share it with other users. If people would be interested to do this, I can help organize and coordinate.

Anyway, long story short: try to build this code and in the meantime I'll try to grab an AVT camera (maybe even yours?) and try out if the new upgraded drivers work.

Hope this helps.
Best,

FireWrapCamera.cs

joao.f...@neuro.fchampalimaud.org

unread,
Feb 16, 2016, 10:30:03 AM2/16/16
to Bonsai Users
Hi Goncalo,

thanks for the valuable help.

I should have mentioned that I'm using NI-IMAQ (NI-IMAQdx). 

I will try to work it out with what you provided.

joao.f...@neuro.fchampalimaud.org

unread,
Mar 7, 2016, 10:04:14 AM3/7/16
to Bonsai Users
Hi,

the solution is download the DirectStreamPackage from here (legacy software). This way the CameraCapture and the VideoCaptureDevice nodes will work with firewire AVT Pike cameras.

goncaloclopes

unread,
Mar 7, 2016, 1:32:04 PM3/7/16
to Bonsai Users
Cool, great to hear you worked out a solution!

Thanks for the follow up, I'm sure this will come in handy later :-)

gho...@hotmail.co.uk

unread,
Oct 4, 2016, 9:17:18 AM10/4/16
to Bonsai Users

Hi guys, 

I've been trying to set up a Allied Vision Pike camera in Bonsai as well. 

So far I've tried the following: 
  • I downloaded the DirectStreamPackage as Joao suggested, though this is not compatible with Windows 10 
  • I downloaded Visual Studio Express for Desktop (2015) - https://www.visualstudio.com/vs/visual-studio-express/ 
  • The Bonsai extensions were not compatible with Visual Studio Express 2015 so I edited the BonsaiTemplates.vsix to include the 14th edition (2015); screen shot attached. Was this correct? 
  • I then copied the FireWrapCamera code (Goncalo provided above) into the editor: 
  • This will "happily" run and open Bonsai though the node (which I'm guessing should be called FirePackage?) is nowhere to be found. 
  • I'm guessing this is due to what Visual Studios highlights as "obsolete" code (see photo). 
Any help would be greatly appreciated! 


Thanks!
Marcus 
FireWrapCamera_ScreenGrab.jpg
Mainfest_ScreenGrab.jpg

goncal...@gmail.com

unread,
Oct 4, 2016, 6:11:55 PM10/4/16
to gho...@hotmail.co.uk, Bonsai Users

Hi Marcus and welcome to the forums!

 

Thanks for the reporting the situation with VS Express for Desktop 2015. I have added it as an issue.

 

There is built-in support for Community Edition 2015, but I wasn’t aware until recently that they actually made an Express Edition 2015.

 

Regarding why the node does not work, it shouldn’t be related to the obsolete code. Rather, I suspect that this may be a problem with missing DLL dependencies. If Bonsai can’t load the type because of missing dependencies, it will be missing.

 

Can you try looking at all thrown exceptions? By default Visual Studio only notifies you of unhandled exceptions, but you can actually also look at exceptions that were thrown but later ignored.

 

You can see how to do this here:

https://msdn.microsoft.com/en-us/library/x85tt0dd.aspx

 

If there is a problem with dependency loading, you will see at some point a FileLoadException when loading the plugin. If this happens we need to understand what is missing. It can be a number of things: Missing DLLs from fire package, incompatible 32-bit or 64-bit DLLs, missing system libraries, etc.

 

My best bet is you may be missing some DLLs from FirePackage. The FireWrap.Net itself is just a wrapper on top of another C++ DLL and you need to have that as well in the final debug folder.

 

Let me know how it goes. We are also trying to update AVT support to the new driver package. Will let you know if we make progress.

--
You received this message because you are subscribed to the Google Groups "Bonsai Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bonsai-users...@googlegroups.com.
Visit this group at https://groups.google.com/group/bonsai-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/bonsai-users/c878e600-8d96-4059-8c3e-740c81ead6f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

gho...@hotmail.co.uk

unread,
Oct 20, 2016, 10:11:54 AM10/20/16
to Bonsai Users, gho...@hotmail.co.uk
Hi again, 

I've tried to run the attached code. 

When looking at all thrown exceptions there are two types of error thrown: 
    1. Managed Debugging Assistant 'BindingFailure' has detected a problem in 'C:\Users\Rihel Lab\AppData\Local\Bonsai\Bonsai.exe'.
        Additional information: The assembly with display name 'Bonsai.Editor' failed to load in the 'Load' binding context of the AppDomain with ID 1. The cause of the failure was: System.IO.FileNotFoundException: Could not load file or assembly 'Bonsai.Editor, Version=2.2.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified

        2. Managed Debugging Assistant 'LoadFromContext' has detected a problem in 'C:\Users\Rihel Lab\AppData\Local\Bonsai\Bonsai.exe'.

        Additional information: The assembly named 'System.Reactive.Linq' was loaded from '<file:///C:/Users/Rihel Lab/AppData/Local/Bonsai/Packages/Rx-Linq.2.2.5/lib/net45/System.Reactive.Linq.dll>' using the LoadFrom context. The use of this context can result in unexpected behavior for serialization, casting and dependency resolution. In almost all cases, it is recommended that the LoadFrom context be avoided. This can be done by installing assemblies in the Global Assembly Cache or in the ApplicationBase directory and using Assembly.Load when explicitly loading assemblies.

        If there is a handler for this exception, the program may be safely continued.

        I've tried looking at the visual studio recommendations for these errors though am a bit confused by what's going on? 

        Any help would be greatly appreciated, 
        Marcus 
        Transform1.cs

        Gonçalo Lopes

        unread,
        Oct 20, 2016, 10:25:09 AM10/20/16
        to gho...@hotmail.co.uk, Bonsai Users
        Hi Markus,

        How exactly are you running this code? Is it from inside Visual Studio? If the exceptions are MDAs (Managed Debugging Assistants), they may not be necessarily impeditive, sometimes they are more like "warnings" and you can continue program execution by pressing F5. Does this work for you?

        Does the editor window of Bonsai even start? It looks like the binding failure you are reporting is related to an inability to load the editor DLL so I was wondering if the installation of Bonsai is not where it should be, or if there are any missing libraries.

        Hope this helps,

        To unsubscribe from this group and stop receiving emails from it, send an email to bonsai-users+unsubscribe@googlegroups.com.

        gho...@hotmail.co.uk

        unread,
        Oct 20, 2016, 10:37:51 AM10/20/16
        to Bonsai Users, gho...@hotmail.co.uk
        Hi, 

        Thanks a lot for the speedy response! 

        I'm running the code from inside visual studio.

        If I continue past the exceptions (or run the code without catching all of the thrown exceptions) Bonsai will open, though there is no node for the camera anywhere. 

        If I run the code Adam posted for the NI-DAQ camera (with any National Instruments bits commented out) then Bonsai will open and a node will appear. 

        One thing I was curious about was the fact that Visual Studios asks me to run the code attached above on a x86 CPU, could that be a cause? 

        Marcus

        Gonçalo Lopes

        unread,
        Oct 20, 2016, 11:53:38 AM10/20/16
        to gho...@hotmail.co.uk, Bonsai Users
        Yes, that could definitely a cause. In general, most of these problems have to do with a failure loading specific DLLs, due to one of two reasons:

        1. One of its dependencies is missing.
        2. The DLL is x86 and the process is x64, or vice-versa.

        A combination of the above is also possible, and one of the dependencies may be there, but be targeting the wrong platform, etc. A good tool to debug these cases is to use Dependency Walker (http://dependencywalker.com/) to figure out which DLLs are actually needed and whether the system can find them. Make sure to use the x86 or x64 version of the tool accordingly (for the reasons stated above).

        Hope this helps.


        To unsubscribe from this group and stop receiving emails from it, send an email to bonsai-users+unsubscribe@googlegroups.com.
        Reply all
        Reply to author
        Forward
        0 new messages