swarm-lab / Rvision

Basic computer vision library for R
https://swarm-lab.github.io/Rvision/
GNU General Public License v3.0
142 stars 34 forks source link

Using the Prosilica Cameras with VIMBA drivers #90

Open boolstring opened 1 year ago

boolstring commented 1 year ago

We are trying to run an AVT Prosilica GT-4090 camera with VIMBA drivers under RVison, but the the system is unable to open the respective stream.

Using a simple USB camera, the standard sample code works and gives an image. Thus, RVision is installed correctly and and works. I assume that there might be an issue with the drivers.

The old 'PVAPI' does not work and I think the respüective functionality is no longer supported, as the new generation VIMBA drivers come along with the AVT cameras.

Is there any soulution for this topic or is there maybe a work-around? It could also be that RVision can't access to the drivers at the moment. Is there a specific folder where DLLs (or anything else?) need to copied to? I tried to copy them into several folders that looked like having DLLs, but obviously this did not change anything.

Thanks a lot,

boolstring

sjmgarnier commented 1 year ago

@boolstring It's not a system I'm familiar with. From what I can tell, VIMBA is a layer between the camera and all sorts of image-processing frameworks, so it's not something that can be integrated into Rvision easily and without significant testing on my end (which would be difficult without having one of these camera systems anyway). And there might be licensing issues on top of that. However, it looks like they have released a plugin for GStreamer here: https://github.com/alliedvision/gst-vimbasrc. If you install GStreamer and their plugin on your system, and recompile OpenCV and Rvision with them (ROpenCVLite::installOpenCV() + devtools::install_github("swarm-lab/Rvision", force = TRUE) should do the trick), then you should be able to use the GStreamer API in the stream function to start the stream.

This being said, I may still need to modify the stream function under the hood because, at the moment, it only accepts camera indexes and not the more complex GStreamer pipelines your camera may require. Let me know if you want to give this a shot and I can make modifications to Rvision (if required) as soon as I find the time.

sjmgarnier commented 1 year ago

@boolstring #91 now includes the ability to pass a string argument to stream. If you can install GStreamer and the gst-vimbasrc plugin, then you should be able to pass to stream a GStreamer pipeline from VIMBA to OpenCV.

I'll push the change from develop to main later tonight or tomorrow morning. The automated checks will take some time to run.

sjmgarnier commented 1 year ago

@boolstring The change is now in the main repository. I verified with simple examples that it is possible to feed a GStreamer pipeline to stream. I'm happy to help further but, then, I will need a way to access your system (directly or indirectly) for testing.