• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
CDP Studio logo

CDP Studio

The no-code and full-code software development tool for distributed control systems and HMI

  • Doc
  • Why CDP
    • Software developers
    • Automation engineers
    • Managers
  • Products
    • Automation Designer
    • HMI Designer
    • Maritime HMIs
  • Services
  • Use cases
  • Pricing
  • Try CDP

CDP Studio Documentation

  • Examples and Tutorials
  • Using OpenCV for Color Tracking

Using OpenCV Camera View in HMI GUI UI for industrial IO HW video tutorials

Using OpenCV for Color Tracking

Introduction

This purpose of this example is to show how CDP Studio integrates with OpenCV and how to use the OpenCV functions from CDPComponent C++ code in CDP Studio, the independent automation software for open PC-based real-time distributed control systems.

This project uses the OpenCV computer vision library to read camera image and filter out or track a specific color.

Prerequisites

This project depends on OpenCV. Follow the Importing OpenCV to CDP Studio guide. Make sure to download the OpenCV binaries and complete the File -> Import Library... step.

How to Run the Example

To run the example from CDP Studio, open Welcome mode and find it under Examples. Next, in Configure mode right-click on the library project and select Build, then right-click on the system project and select Run & Connect. See the Running the Example Project tutorial for more information.

Project Overview

This example includes:

  • A library project containing one component:
    • ColorTracking - displays image from webcam and tracks coordinates of a specific color.
  • A system project containing a pre-configured CDP Application that is ready to run.

After running the project, one should see three windows:

  • Original Image - displays image from webcam. A red circle marks the tracked color (if found on image).
  • Trackbars - here it is possible to specify the color to track in HSV (hue, saturation, value) encoding.
  • Thresholded Image - highlights matching part of webcam image as a white area. Useful when specifying correct values in Trackbars window.

Next select the ComputerVision project and open the ColorTracking component. There you will see in Signals table xCoord and yCoord CDP Signals. They mark the location of the tracked color. This is the place of the red circle in the Original Image window. The signals could be used to write code that depends on tracking an object of specific color using webcam.

To see the implementation of ColorTracking component, go to Code Mode and open ComputerVisionLib -> Sources -> ColorTracking.cpp.

Using OpenCV Camera View in HMI GUI UI for industrial IO HW video tutorials

The content of this document is confidential information not to be published without the consent of CDP Technologies AS.

CDP Technologies AS, www.cdpstudio.com

Get started with CDP Studio today

Let us help you take your great ideas and turn them into the products your customer will love.

Try CDP Studio for free
Why CDP Studio?

CDP Technologies AS
Hundsværgata 8,
P.O. Box 144
6001 Ålesund, Norway

Tel: +47 990 80 900
E-mail: info@cdptech.com

Company

About CDP

Contact us

Services

Partners

Blog

Developers

Get started

User manuals

Support

Document download

Release notes

My account

Follow CDP

  • LinkedIn
  • YouTube
  • GitHub

© Copyright 2025 CDP Technologies. Privacy and cookie policy.

Return to top