Category Archives: For Geek Innovators

For those geek innovators like YOU. Do you belong to clinicals? We welcome you DIY lovers!

Tutorial: Building SCCToolKit

Step 0: Prepare Necessary Resources

Currently, SCCToolKit runs only on OS X 10.7  – 10.10. This is due to the use of CoreImage and libdispatch library and Apple’s language extension of C/C++.  You need the following files.

  • Apple’s Xcode app [Apple].
  • OpenCV version 2.4 or later [download].
  • Qt 4.7 or later. [download].
  • Decklink SDK version 9.0 or later. [download]
  • Cmake version 2.8.10 or greater is used to build SCCToolKit. [download]

You can install these in their default directories. I do differently from the default – here is my preferences, but you don’t need to do same.

Step 1: Download SCCToolKit

You can download from GitHub. You can find “Download ZIP” button at the right bottom. Download the zip file, Expand it and put in your preferred directory. You can even change the name of the top directory, which is SCCToolKit originally. But do not change or relocate directories or files inside it.

Step 2: Build SCCToolKit

  1. Start Terminal.app in Applications folder.

Tips: By dropping a file or folder from Finder into Terminal.app’s window, you will get full path of the file/folder appearing at the end of command line. if you type ‘cd ‘ before drop, you can get something like ‘cd /Users/you/foo‘.

  1. Do cd to the root directory, SCCToolKit.
  2. Do mkdir build ; cd build.
  3. Run ccmake ... If you want Xcode to do debug, do ccmake -GXcode ..
  4. Type ‘c’ once. ccmake will ask you where’s your OpenCV, Qt and DeckLink SDK.
  5. After ccmake successfully identifies these, you type a few more ‘c’ and you can finish ccmake by typing ‘g’.
  6. Run make. This will build the library and sample programs in Examples.
  7. If everything goes fine, you get make complete with 100% done.
  8. Play with the examples.

Step 3: Build Apps in SCCToolKit

To build application programs in Apps directory, you need to do similar to the above process. For example,

  1. Do cd to Apps/lkdemo.
  2. Do mkdir build ; cd build
  3. Run ccmake ..
  4. Type c once. This case, you need to tell ccmake where is SCCToolKitConfig.cmake file, which is in ../../build in above example.
  5. After finding SCCToolKitConfig.cmake and do some customization, type ‘c’ a few more and if you are satisfied to your setting, type ‘g’.
  6. Run make. When successful, you will get an executable file (App) in build/bin/
  7. Play with App.

Enjoy happy hacking!

Qt 5.x Support

Qt version 5.x can be used to compile SCCToolKit.

Changes

  1. You can choose either Qt 4 or Qt 5 to build SCCToolKit in cmake.
  2. However, if OpenCV was built with Qt, we must use this version of Qt. SCCToolKit automatically obtains where’s Qt used to build OpenCV.
  3. Many bug fixes.

Important!

We recommend to use Qt 5.6 if you use Qt 5 from the following reasons,

  1. Qt 5.6 was announced to be the long term support version (3 years +).
  2. Qt 5.6 core license can be LGPLv2. ( Qt 5.7 uses LGLPv3, some modules without LGPL).
  3. Qt 5.5 had glitch in layout that has been solved in 5.6.

The LTS of Qt 4 is 4.8. Unless under special circumstances, we recommend to use Qt 5. We will gradually removing updating for Qt 4.

New Macros

Look at Cmake/SCCToolKitUtils.cmake and Cmake/QtMacrosExtra.cmake

cmake 3.0 compatibility

The major version up of cmake, now 3.0, has been released on June 11. We will check and do necessary modification to our cmake scripts. We recommend using cmake 2.8.12.

<Update on Jun 26, 2014> So far tested, cmake 3.0 works fine!

Support update (Apr 2014)

(As of July 15 2014, we completed Qt 5.x support and issues stated in this post)

Tools and libraries that we verified as of today.

  • Qt 5.x : cannot compile. Please use Qt 4.8.x
  • OS X 10.9 (Mavericks) : worked.
  • cmake 2.8.12 : fixed.
  • OpenCV 2.4.8 : worked.
  • Decklink SDK 10.0 : worked.

1) To date, SCCToolKit accepts Qt4 only. If you installed multiple Qt versions, see here. 2) Execute make. If you encounter warning message like

/Library/Frameworks/QtCore.framework/Headers/qglobal.h:331:6: warning: "This version of Mac OS X is unsupported"

This is because Qt 4.8.5 or older was not assumed to run on OS X 10.9 Maverics. If you want to dismiss it, Please use Qt 4.8.6. Or, please directly edit global.h around line 331 as this way.

# if !defined(MAC_OS_X_VERSION_10_9)
# define MAC_OS_X_VERSION_10_9 MAC_OS_X_VERSION_10_8 + 1
# endif
# if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_9)

3) You may encounter many warning messages like

warning: 'device' is deprecated [-Wdeprecated-declarations] ...
- (QTCaptureDevice *)device AVAILABLE_QTKIT_VERSION_7_2_AND_LATER_BUT_DE...

This appears because Apple deprecated QtKit to replace with AvKit. We are aware of this issue and plan to port to AvKit.(As of July 15 2014, we completed Qt 5.x support and issues stated in this post)

Tools and libraries that we verified as of today.

  • Qt 5.x : cannot compile. Please use Qt 4.8.x
  • OS X 10.9 (Mavericks) : worked.
  • cmake 2.8.12 : fixed.
  • OpenCV 2.4.8 : worked.
  • Decklink SDK 10.0 : worked.

1) To date, SCCToolKit accepts Qt4 only. If you installed multiple Qt versions, see here. 2) Execute make. If you encounter warning message like

/Library/Frameworks/QtCore.framework/Headers/qglobal.h:331:6: warning: "This version of Mac OS X is unsupported"

This is because Qt 4.8.5 or older was not assumed to run on OS X 10.9 Maverics. If you want to dismiss it, Please use Qt 4.8.6. Or, please directly edit global.h around line 331 as this way.

# if !defined(MAC_OS_X_VERSION_10_9)
# define MAC_OS_X_VERSION_10_9 MAC_OS_X_VERSION_10_8 + 1
# endif
# if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_9)

3) You may encounter many warning messages like

warning: 'device' is deprecated [-Wdeprecated-declarations] ...
- (QTCaptureDevice *)device AVAILABLE_QTKIT_VERSION_7_2_AND_LATER_BUT_DE...

This appears because Apple deprecated QtKit to replace with AvKit. We are aware of this issue and plan to port to AvKit.

If your PC has multiple Qt versions installed

(As of July 15, 2014 we completed Qt 5.x support and occasions you have multiple Qt installations. You can ignore this article.)

You may see odd compile errors related to Qt. When it happens, please examine specifying desired Qt’s cmake by this way:

ccmake -DQT_QMAKE_EXECUTABLE=(path to qmake of desired version) (path to SCCToolKit)

If you use GUI version cmake, use ‘Add Entry’ button to add QT_QMAKE_EXECUTABLE entry BEFORE you click ‘Configure’.

QT_QMAKE_EXECUTABLE

Support update (Feb 2014)

As of Feb 06, we examined the following latest software used to build and run SCCToolKit.

  • Qt 5.x : cannot compiled.
  • OS X 10.9 (Mavericks) : worked.
  • cmake 2.8.12 : fixed.
  • OpenCV 2.4.8 : worked.
  • Decklink SDK 9.7.7 : worked.

Tutorial: Directory structure

You need other SDKs to build SCCToolKit. You need to tell cmake where you put these. So it would make your life easier if you put these in convenient places. Here is my preferences.

/src
  |-Blackmagic_SDK -> bmdsdks/Blackmagic DeckLink SDK 9.7
  |-OpenCV -> opencvs/opencv-2.4.5
  |-Qt
      |-build -> qt-everywhere-opensource-src-4.8.4/build
      |-qt-everywhere-opensource-src-4.8.4
  |-bmdsdks
      |-Blackmagic DeckLink SDK 9.7
  |-opencvs
      |-opencv-2.4.5
          |- ...
          |-build
          |- ...

The points are

  • Put everything at /src, which is very short in the full path.
  • Put versions of SDKs in /src/opencvs, /src/bmdsdks, /src/Qt
  • Put ‘build’ to be accessible by /src/OpenCV/build, /src/Qt/build
  • To tell cake where’s qmake, you set /src/Qt/build/bin/qmake
  • Make symbolic links to the designated version (shown as ‘->‘ in above tree).

It is just an example. You don’t need to do this way — find your preference and happy hacking!You need other SDKs to build SCCToolKit. You need to tell cmake where you put these. So it would make your life easier if you put these in convenient places. Here is my preferences.

/src
  |-Blackmagic_SDK -> bmdsdks/Blackmagic DeckLink SDK 9.7
  |-OpenCV -> opencvs/opencv-2.4.5
  |-Qt
      |-build -> qt-everywhere-opensource-src-4.8.4/build
      |-qt-everywhere-opensource-src-4.8.4
  |-bmdsdks
      |-Blackmagic DeckLink SDK 9.7
  |-opencvs
      |-opencv-2.4.5
          |- ...
          |-build
          |- ...

The points are

  • Put everything at /src, which is very short in the full path.
  • Put versions of SDKs in /src/opencvs, /src/bmdsdks, /src/Qt
  • Put ‘build’ to be accessible by /src/OpenCV/build, /src/Qt/build
  • To tell cake where’s qmake, you set /src/Qt/build/bin/qmake
  • Make symbolic links to the designated version (shown as ‘->‘ in above tree).

It is just an example. You don’t need to do this way — find your preference and happy hacking!

Tutorial: Building SCCToolKit

Step 0: Prepare Necessary Resources

Currently, SCCToolKit runs only on OS X 10.7 to 10.10. This is due to the use of CoreImage and libdispatch library and Apple’s language extension of C/C++.  You need the following files.

  • Apple’s Xcode app [Apple].
  • OpenCV version 2.4 or later [download].
  • Qt 4.7 or later. [download].
  • Decklink SDK version 9.0 or later. [download]
  • Cmake version 2.8.10 or greater is used to build SCCToolKit. [download]

You can install these in their default directories. I do differently from the default – here is my preferences, but you don’t need to do same.

Step 1: Download SCCToolKit

You can download from GitHub. Expand it and put in your preferred directory. You can even change the name of the top directory, which is SCCToolKit originally. But do not change or relocate directories or files inside it.

Step 2: Build SCCToolKit

  1. Start Terminal.app in Applications folder.

Tips: By dropping a file or folder from Finder into Terminal.app’s window, you will get full path of the file/folder appearing at the end of command line. if you type ‘cd ‘ before drop, you can get something like ‘cd /Users/you/foo‘.

  1. Do cd to the root directory, SCCToolKit.
  2. Do mkdir build ; cd build.
  3. Run ccmake ... If you want Xcode to do debug, do ccmake -GXcode ..
  4. Type ‘c’ once. ccmake will ask you where’s your OpenCV, Qt and DeckLink SDK.
  5. After ccmake successfully identifies these, you type a few more ‘c’ and you can finish ccmake by typing ‘g’.
  6. Run make. This will build the library and sample programs in Examples.
  7. If everything goes fine, you get make complete with 100% done.
  8. Play with the examples.

Step 3: Build Apps in SCCToolKit

To build application programs in Apps directory, you need to do similar to the above process. For example,

  1. Do cd to Apps/lkdemo.
  2. Do mkdir build ; cd build
  3. Run ccmake ..
  4. Type c once. This case, you need to tell ccmake where is SCCToolKitConfig.cmake file, which is in ../../build in above example.
  5. After finding SCCToolKitConfig.cmake and do some customization, type ‘c’ a few more and if you are satisfied to your setting, type ‘g’.
  6. Run make. When successful, you will get an executable file (App) in build/bin/
  7. Play with App.

Enjoy happy hacking!