Page MenuHomePhabricator | MITK

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

Description

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

franza created this task.Oct 30 2017, 10:59 AM
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.
seitela moved this task from Backlog to 2018 - Release relevant on the IGT board.Jan 29 2018, 9:13 AM

Problem can not be reproduced on current master (https://phabricator.mitk.org/rMITK1568f0606caf57ab696deb5a3ec1b6425c5a9ac5). Tested for Win7, Visual Studio 2015 x32

seitela claimed this task.
seitela moved this task from In Progress to Finished on the IGT board.Feb 27 2018, 11:57 AM
seitela closed this task as Resolved.Apr 20 2018, 8:33 AM
franza reopened this task as Open.Nov 2 2018, 12:32 PM
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.

franza added a comment.Nov 2 2018, 1:01 PM

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.

franza removed seitela as the assignee of this task.Nov 2 2018, 2:48 PM
franza added a comment.Nov 3 2018, 4:39 PM
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-3.30.3.0007\epiphan\frmgrab\lib\win\x64)

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