C++C++11C++14C++17Language FeatureLearn C++

How To Analyze Video Camera Images In C++ Builder On Windows

C++ is a strong and faster programming language, this feature really important on dynamic operations running less than in milliseconds of intervals. C++ is one of the best to analyze video camera images, it is good to analyze video image operations by using very modern methods of programming.

In C++ Builder, it is easy to use camera of device and easy to to capture video camera images by using CameraComponent with it’s FireMonkey UI framework. There is a video camera sample in Samples folder., please check details here before you start coding.

This small example below show how to use CameraComponent. You just need to add an Image component to show camera buffer and drag CameraComponent on your C++ Builder Project Form and double click on CameraComponent to add OnSampleBufferReady event, add lines as below;

After this step you can analyze Bitmap of Image1. You can analyze the image inside of this OnSampleBufferReady event. If your analyze takes much time, camera display may have delays while viewing actions, you can analyze this image in another Timer(), so your video frames will be more smoother while analyzing image takes much more time. That means you will pass some of frames to analyze, you will just show it.

In C++ Builder, Multi-Device FireMonkey projects are really good on Bitmap operations, we highly recommend FMX on Video Camera Operations, You can use same code on Windows, MacOS, iOS and Android. VCL Projects are also can be done in same way. FMX has locking Bitmap Data and reading mapped pixels are much more faster and it is possible to analyze or operate on Bitmaps.

In this example, this procedure can be used to find mean color of an image in a given rectangular area.

Now lets add a ColorBox on the form to show this calculated mean color. We can use this mean color procedure on the bitmap of image. Please update the first code to show mean color of camera image as below.

This simple example can be applied to analyze images that is called image processing. Nowadays it is very important to analyze faces, people, motions etc. You can use this to analyze or to control things and to do effects for fun. l. You can also add more complex algorithms like Deep Learning methods or other Artificial Intelligence Technologies.


Oh hi there 👋
It’s nice to meet you.

Sign up to receive awesome C++ content in your inbox, every day.

We don’t spam! Read our privacy policy for more info.

Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial

Free C++Builder Community Edition

About author

33+ years of coding with more than 30+ programming languages, mostly C++ on Windows, Android, Mac-OS, iOS, Linux and some other operating systems. Dr. Yilmaz Yoru was born in 1974, Eskisehir-Turkey. He graduated from the department of Mechanical Engineering of Eskisehir Osmangazi University in 1997. One year later he started to work in the same university as an assistant. He received his MSc and PhD degrees from the same department of the same university. He has married and he is a father of a son. Some of his interests are Programming, Thermodynamics, Fluid Mechanics and Artificial Intelligence. He also likes the graphical 2D & 3D design and high-end innovations.
Related posts
CC++Introduction to C++Learn C++

Who Wrote The C Programming Language?

CC++Introduction to C++Language FeatureLearn C++

Is C A High Level Programming Language?

CC++Introduction to C++Learn C++

How To Run A C Program in Command Prompt

CC++C++17Learn C++

How To Compile And Run A C Program

Worth reading...
Top C++ Compilers for Windows in 2020