Ginni has Published 1602 Articles

How to change the brightness of an image in OpenCV using C++?

Ginni

Ginni

Updated on 10-Mar-2021 08:17:36

2K+ Views

Changing the brightness means changing the value of pixels. It means adding or subtracting value some integer value with the current value of each pixel. When you add some integer value with every pixel, it means you are making the image brighter. When you subtract some constant value from all ... Read More

How to reduce the color using Iterator Method in OpenCV?

Ginni

Ginni

Updated on 10-Mar-2021 08:15:47

153 Views

OpenCV has C++ STL compatible 'Mat iterator' class. Using this 'Mat iterator' class, we can access pixels very easily. We have to create an object of 'Mat iterator' class. We can do it as 'Mat_: : iterator example'. We have to use an underscore after 'Mat' like 'Mat_' because it ... Read More

How to reduce color using Pointer Method in OpenCV?

Ginni

Ginni

Updated on 10-Mar-2021 08:15:09

334 Views

In image processing, we perform computation on the image. To be more specific, we perform a calculation on pixel so the higher the number of pixels, the more the time consuming the computation becomes. To reduce the computation time, we require to scan the image efficiently. We will learn how ... Read More

How to get the value of a specific pixel in OpenCV using C++?

Ginni

Ginni

Updated on 10-Mar-2021 08:14:27

4K+ Views

To read the value of a specific pixel, we can use either 'at' or 'direct access' method. Here, we will learn both of the approaches.Let's start with 'at' method. The following program reads the pixel value located at (10, 29) of an RGB image.Example#include #include using namespace std; using namespace ... Read More

How to change Pixel values using Direct Access Method in OpenCV?

Ginni

Ginni

Updated on 10-Mar-2021 08:13:55

320 Views

In the previous method (the 'at' method), we need to specify the image type while accessing the pixel values. There is another method which is simpler than 'at' method. It is called direct access method. To access pixel value using this method, we need to specify the Mat type such ... Read More

How to change Pixel Values using 'at' Method in OpenCV?

Ginni

Ginni

Updated on 10-Mar-2021 08:13:14

2K+ Views

In a grayscale image, the pixel value is a single numeric value. But in a color image such as RGB image, the pixel is a vector having three values. These three values represent three channels.Here we will create a function that accesses both the grayscale image and RGB image pixel ... Read More

How to draw an Ellipse in OpenCV using C++?

Ginni

Ginni

Updated on 10-Mar-2021 08:10:41

561 Views

To draw an ellipse, we need a center, major axis and minor axis. That means we need three parameters for the ellipse. We need a matrix where we will draw the ellipse, and we need to declare line thickness and line color.When we want to draw an ellipse using OpenCV, ... Read More

How to save an Image in OpenCV using C++?

Ginni

Ginni

Updated on 10-Mar-2021 08:10:01

4K+ Views

Here, we will understand how to save the OpenCV image to any location on your computer.  OpenCV provides imwrite() function to save an image to a specified file. The file extension represents the image format. The actual format of the function is −imwrite("Destination/Name of the image with extension", Source Matrix)Here, "Destination" ... Read More

How to create a binary image in OpenCV using C++?

Ginni

Ginni

Updated on 10-Mar-2021 08:08:49

2K+ Views

A binary image is just a digital image that represents two colors, black and white. From an image processing perspective, a binary image contains pixels with two possible values- zero and one. When the value of a pixel is 0, it represents a pure black color. When the value of ... Read More

How to invert a binary image in OpenCV using C++?

Ginni

Ginni

Updated on 10-Mar-2021 08:08:09

4K+ Views

Inverting a binary image means inverting the pixel values. From a visual perspective, when we invert a binary image, white pixels will be converted to black, and black pixels will be converted to white.The basic form of this function is −cvtColor(original_image, grayscale_image, COLOR_BGR2GRAY);The next line is converting the grayscale image ... Read More

Advertisements