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.

About author

Dr. Yilmaz Yoru has 35+ years of coding with more than 30+ programming languages, mostly C++ on Windows, Android, Mac-OS, iOS, Linux, and some other operating systems. He was born in 1974, Eskisehir-Turkey, started coding in college and graduated from the department of Mechanical Engineering of Eskisehir Osmangazi University in 1997. He worked as a research assistant at the same university for more than 10 years. He received his MSc and PhD degrees from the same department at the same university. Since 2012, he is the founder and CEO of Esenja LLC Company. He has married and he is a father of a son. Some of his interests are Programming, Thermodynamics, Fluid Mechanics, Artificial Intelligence, 2D & 3D Designs, and high-end innovations.
Related posts
C++C++11C++14C++17C++20Learn C++Syntax

What Is An Eligible Copy Assignment Operator In C++?

C++C++11C++14C++17C++20Learn C++Syntax

What Is A Trivial Copy Assignment Operator In C++?

C++C++11C++14C++17C++20Learn C++Syntax

What Is Uppercase T in C++ Syntax?

C++C++11C++14C++17Learn C++Syntax

What Is An Implicitly-defined Copy Assignment Operator In C++?

Worth reading...
Top 6 C++ IDEs For Building Native Windows Apps In 2020