OpenCV Tutorial Source Code
Posted: Wed May 08, 2019 11:42 pm
I appreciate the video tutorial for live video processing with OpenCV that was posted recently on the Support page. Is the full source code available for the tutorial?
https://forum.blackmagicdesign.com/
https://forum.blackmagicdesign.com/viewtopic.php?f=12&t=90959
tautin wrote:Hi Cameron,
Thank you so much !
I ran the program and would like to know if there's something we can do to improve the latency when simply looping through, or this the best we can get with Decklink cards (I'm evaluating AR directly with Decklink vs with ATEM + green background / keying)?
Thanks again!
EDIT: you might want to know that the code requires some minor updates to run with a DeckLink 8K Pro.
StartDeckLinkCapture
Capture failed: Could not enable video input
Hey, can you elaborate on what changes are required to run the OpenCV example with DeckLink 8K Pro?
I am having trouble running it. The output is:
tautin wrote:Hey, can you elaborate on what changes are required to run the OpenCV example with DeckLink 8K Pro?
I am having trouble running it. The output is:
Hello,
I don't remember what I changed exactly, but I attached the working project (tested on Ubuntu 16.04 LTS with a DeckLink 8K Pro).
Step I followed:
- plug your camera in the 1st input (the one next to the ref input)
- plug your screen in the 3rd input
- open BlackMagic Desktop Video Setup and:
-> set DeckLink 8K Pro (1) connector to SDI 1 In or Out
-> set DeckLink 8K Pro (2) connector to SDI 3 In or Out
- update the BuildLinux.sh script to put your OpenCV & DeckLink SDK paths
- update the LiveVideoWithOpenCV.cpp at line 552 to set your camera's video mode (4K, Full HD, etc)
- cd into the project folder
- run ./BuildLinux.sh
- run ./build/LiveVideoWithOpenCV
By default you should get a video with a green rectangle around your face when you smile.
Have fun
StartDeckLinkCapture
Capture failed: Could not enable video output
C:\Users\...\DeviceManager.h(80,35): error C3861: 'CreateDeckLinkDiscoveryInstance': identifier not found [C:\Users\...\build\LiveVideoWithOpenCV.vcxproj]
m_decklinkDiscovery = CreateDeckLinkDiscoveryInstance();
// This is a COM interface so should only be created with CreateInstance(), and managed with AddRef() and Release()
DeckLinkNotificationManager()
: m_refCount(1)
{
#ifndef _WIN32
m_decklinkDiscovery = CreateDeckLinkDiscoveryInstance();
#else
IDeckLinkDiscovery* discovery = nullptr;
CoCreateInstance(CLSID_CDeckLinkDiscovery, NULL, CLSCTX_ALL, IID_IDeckLinkDiscovery, (void**)&discovery);
m_decklinkDiscovery = discovery;
#endif
if (!m_decklinkDiscovery)
throw std::runtime_error("CreateDeckLinkDiscoveryInstance failed: check driver is installed");
}
C:\Users\...\build\Release>LiveVideoWithOpenCV.exe
Capture failed: CreateDeckLinkDiscoveryInstance failed: check driver is installed
throw std::runtime_error("CreateDeckLinkDiscoveryInstance failed: check driver is installed");