Page 1 of 1

OpenCV Tutorial Source Code

PostPosted: Wed May 08, 2019 11:42 pm
by jmeldrum
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?

Re: OpenCV Tutorial Source Code

PostPosted: Sun Sep 29, 2019 11:09 pm
by GlennNZ
+1
Me to!
Thanks

Re: OpenCV Tutorial Source Code

PostPosted: Tue Mar 17, 2020 10:59 am
by tautin
For what it's worth, +1 ;)

Re: OpenCV Tutorial Source Code

PostPosted: Wed Mar 18, 2020 10:19 pm
by Cameron Nichols
Hi Tim,

The Live Video Processing with OpenCV tutorial source is available on the Blackmagic Developer site:

https://www.blackmagicdesign.com/develo ... d-playback

Under heading: Presentations and Sample Code

Regards
Cameron

Re: OpenCV Tutorial Source Code

PostPosted: Fri Mar 20, 2020 3:26 pm
by tautin
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.

Re: OpenCV Tutorial Source Code

PostPosted: Fri Jul 10, 2020 1:56 pm
by giorgi3092
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.


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:
Code: Select all
StartDeckLinkCapture
Capture failed: Could not enable video input


I examined the code quickly and have set the mode to bmdModeHD1080i50 as the camera connected is set to 1080i50 as SDI video output.
I get the same error when I run the program.

I also ran the sample programs which auto-detect the camera mode and they also choose this mode (bmdModeHD1080i50) automatically.

But, again, I can't get it to work with the given OpenCV example.

Can you help on this?

Re: OpenCV Tutorial Source Code

PostPosted: Thu Jul 16, 2020 3:45 pm
by tautin
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 ;)

Re: OpenCV Tutorial Source Code

PostPosted: Mon Jul 20, 2020 8:19 am
by giorgi3092
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 ;)


Thank you so much! I am developing on Windows but your modifications immensely helped me to gain insight into the flow of the program and what functions really do.

I have modified the DeviceManager class according to yours and it works now!
The problem was that the program only kept enabling the device which arrived last, which was DeckLink subdevice 4 which was not correctly configured in Video Setup software. Your code kept those device pointers in an array and enabled me to enable each device separately and choose the device properly.

Also, credits to Cameron Nichols who gave me valuable insight through email exchange.
Thanks!