Ginni has Published 1602 Articles

How to draw a line in OpenCV using C++?

Ginni

Ginni

Updated on 10-Mar-2021 08:06:58

1K+ Views

To draw a line we need two points-the starting point and ending point. We also require a canvas to draw the line.Using OpenCV, the matrix in our canvas, we need to define the line's starting and ending points. We require to assign a color to the line as well. The ... Read More

How to draw a circle in OpenCV using C++?

Ginni

Ginni

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

6K+ Views

A circle has a center and a radius. To draw a circle using OpenCV, we have to define the center and the radius. In OpenCV we have to include header because 'circle()' function is defined in this header.The basic syntax of this method is as follows −Syntaxcircle(whiteMatrix, center, radius, ... Read More

How to put a text in an image in OpenCV using C++?

Ginni

Ginni

Updated on 10-Mar-2021 08:03:35

3K+ Views

In OpenCV, we can put some text in the image by using puttext() function. This function is defined in header. To put text in an image, we first need to declare the matrix which will load the image.Instead of loading an image in our program, we have filled matrix ... Read More

How to draw a rectangle in OpenCV using C++?

Ginni

Ginni

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

838 Views

To draw a rectangle, we need four points. Look at the following figure.In the figure, there are four points x1, x2, y1 and y2. These four points are forming the four coordinates. To draw a rectangle using OpenCV, we have to define these points and show the rectangle we need ... Read More

How to read the pixel value of a single channel image in OpenCV using C++?

Ginni

Ginni

Updated on 10-Mar-2021 07:57:00

1K+ Views

Digital images are made of pixels. Using OpenCV, it is easy to read the value of pixels. However, if we want to get the pixel values, we have to handle a single channel separately.Here we are loading an image in the matrix named 'cimage', and then it converts the image ... Read More

How to convert color spaces in OpenCV using C++?

Ginni

Ginni

Updated on 10-Mar-2021 07:53:48

1K+ Views

Color space is the model of representing colors. There are different ways of describing colors. For example, RGB, CYMK, HSV, Grayscale etc.Here, we used a new header named 'imgproc.hpp'. This 'imgproc.hpp' is the abbreviation of Image Processing. To convert color spaces, we need to use 'cvtColor()' function of OpenCV. This function ... Read More

How to split images into different channels in OpenCV using C++?

Ginni

Ginni

Updated on 10-Mar-2021 07:50:14

4K+ Views

There are three channels in an RGB image- red, green and blue. The color space where red, green and blue channels represent images is called RGB color space. In OpenCV, BGR sequence is used instead of RGB. This means the first channel is blue, the second channel is green, and ... Read More

How to calculate the number of channels of an image in OpenCV using C++?

Ginni

Ginni

Updated on 10-Mar-2021 07:49:54

1K+ Views

In this topic, we will understand how to find out the number of channels of an image. After running the program, the number of the channel will be shown in the console window.To get the number of the channel, we have used a class of OpenCV named 'channels()'. When we ... Read More

What is Image Array? Explain with an example in C++

Ginni

Ginni

Updated on 10-Mar-2021 07:49:32

636 Views

An array is a convenient method to store and retrieve the collection of data. In OpenCV, we can use this concept to load multiple images in an image array and show them using the array's index number.The following program loads multiple images in a matrix array and shows the array's ... Read More

How to load and show image in OpenCV using C++?

Ginni

Ginni

Updated on 10-Mar-2021 07:45:51

2K+ Views

In this topic, we will determine how to load and show images using OpenCV in C++. There are the following functions required for loading and showing an image in OpenCV. Mat: Mat is not a function. It is a data structure, a type of variable. Like int, char, string variable types in ... Read More

Advertisements