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

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 graduated and received his MSc and PhD degrees from the Department of Mechanical Engineering of Eskisehir Osmangazi University. He is the founder and CEO of ESENJA LLC Company. His interests are Programming, Thermodynamics, Fluid Mechanics, Artificial Intelligence, 2D & 3D Designs, and high-end innovations.
Related posts
C++C++11C++14C++17C++20Introduction to C++Learn C++

Learn Copy Constructors in C++ Classes

C++C++11C++14C++17Introduction to C++Learn C++Syntax

Learn How To Use Types Of Destructors In C++?

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

How To Convert u32string To A wstring In C++

C++C++11C++14C++17C++20Introduction to C++Learn C++

How To Learn The Move Constructors In Modern C++?

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