Page MenuHomePhabricator

Connection to Epiphan frame grabber via OpenCV is buggy
Open, NormalPublic


Connecting an Epiphan DVI2USB 3.0 frame grabber to MITK via OpenCV does not work as expected. Sometimes the images stays black after connecting to the. After disconnecting and reconnecting it usually works, but sometimes it takes several reconnects until it works.

Event Timeline

seitela added a project: Restricted Project.Oct 30 2017, 1:16 PM
seitela moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.

Problem can not be reproduced on current master ( Tested for Win7, Visual Studio 2015 x32

seitela moved this task from Wishlist to In Progress on the IGT board.
franza updated the task description. (Show Details)
franza added a subscriber: mittmann.

Tested the setup with two Epiphan framegrabbers of the same type and DVI/VGA video sources. The problem is always there. A OpenCV minimal example works fine, but if we paste exactly the same code to a MITK plugin the problem is there. Seems as if OpenCV doesn't like MITK running in the background for this specific frame grabber. With a framegrabber from another manufacturer (TERRATEC G1) or with a webcam video source there was no problem during the tests.

OpenCV minimal example which works. The location of an OpenCV build has to be defined in CMake to get it running.

A possible workaround is to use PLUS for the connection to the Epiphan grabber and then connect to it via OpenIGTLink:
(1) Start a PLUS server (2.6.0 / 64bit was tested) with the default device set for a Epiphan frame grabber (PlusDeviceSet_Server_EpiphanVideoCapture.xml)
(2) Open MITK, create a new video device in the US view and choose "OIGTL Client".
(3) Activate the device and it should work

We still have to check if there are any update rate or latency problems with this solution.

PLUS seems to use a API provided by Epiphan and not OpenCV for the connection. This might also a solution if we ever have to fix this in MITK directly.

This comment was removed by franza.

We digged into the Epiphan SDK and found the V2U_GrabFrame2 structure which is returned by the GrabFrame method. We will try to convert this structure to an mitk Image using also the ITKConvertIplImageBuffer logic. Afterwards, we will try to replace the OpenCV VideoCapture method by using the Epiphan SDK in MITK directly. @aguilera

Thanks for looking into this. Keep in mind that we should still keep the current implementation to grab images as it allows to grab far more than only from the Epiphan frame grabber. Once the feasibility of using the SDK is shown, we should think of integrating it as a separate video source that is dependent on the specific Epiphan SDK.

Cool! Thanks for taking care for this. I'm looking forward to use the Epiphan grabber directly again (current workaround: PLUS Server and OpenIGTLink). If you need any help please let me know. There also is a nice chat support on the Epiphan page.

Just updated the branch with the correct CMake configuration. The Epiphan library should now be accessible and can be tested.

It can be integrated and used in a plugin when the frmgrab.dll and frmgrab.lib files were in the same folder (\Epiphan\epiphan_sdk-\epiphan\frmgrab\lib\win\x64)

It has to be checked how to configure Cmake to be able to get different files from different paths

Two options in order to integrate Epiphan were discussed:

  1. Creating a "USEpiphanDevice" (derived from mitk::USDevice) and "USEpiphanImage" (derived from mitk::USImageSource). The UI could be extended as mitkUSTelemedImageSource in order to integrate the Epiphan image source.
  1. Integrate it into the VideoSource. In this case, the USVideoDevice could implement either openCV as capturing device or Epiphan.

@seitela: Do you know if this was merged and if we can close this task?

I don't think this was finished / merged yet.