Found 7347 Articles for C++

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

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 C++, Mat is a variable of OpenCV, which creates a matrix data structure to load images inside it. In this program, we wrote 'Mat myImage;'. That means we are declaring a matrix variable named 'myImage'. namedWindow(): It allocates some memory and creates a window to show the image. It works like a ... Read More

How to install OpenCV for C++ in Windows?

Ginni
Updated on 10-Mar-2021 07:44:08

18K+ Views

There are three steps to install OpenCV, which are as follows −Downloading all required software and install them.Processing OpenCV for Visual Studio.Linking OpenCV with Visual Studio.Let us define these steps one by one.Step 1 - Downloading and Installing the required SoftwareWe will use OpenCV in Microsoft Visual Studio. So we must have to download Visual Studio and OpenCV.Visual StudioOpenCVCMakeLet us learn how to install this software first.Installing Visual StudioThe first step is to download the Visual Studio on your system from its official website or follow link https://visualstudio.microsoft.com/downloads/.Then click on the download button for downloading the Visual Studio. After installing ... Read More

What is OpenCV?

Ginni
Updated on 10-Mar-2021 07:35:56

591 Views

OpenCV stands for open-source computer vision. It was generated to support a common infrastructure for computer vision operations and use system behaviour in financial products. It generally targets image processing, faces recognition, video capture, searching, and object disclosure.OpenCV is created to implement various operations including recognising and detecting faces, analysing human tasks in videos, identifying objects, recording camera movements, tracking moving objects, and combining images to create a high-resolution image for the accurate scene. Let's see the topic defining the term "Computer Vision."Computer VisionComputer vision is a flexible scientific area that manages to regenerate, preventing, and learn a 3D image from ... Read More

Difference Between Object and Class in C++

AmitDiwan
Updated on 02-Mar-2021 04:57:52

742 Views

In this post, we will understand the difference between an object and a class with respect to C++ programming language.Classes in C++It is a building block of code in C++ that helps implement object oriented programming.It is a type that is defined by the user.It holds its own data members and member functions.These data members and member functions can be accessed by creating an instance of the class.They can be used to manipulate the variables and can be used to define property to tell how the objects in a class have to act.It can be understood as a blueprint for ... Read More

Difference Between C# and C++

AmitDiwan
Updated on 02-Mar-2021 04:56:56

441 Views

Let us first learn about C# and C++ −C# is a general-purpose object-oriented programming language.It is considered as a pure object-oriented programming language.It is pronounced as 'C sharp'.It was developed by Anders Hejlsberg and his team at Microsoft.Memory Management is done automatically by the garbage collector.It is the language's duty to automatically delete the object once its objective is completed.It is windows specific, i.e. it can't be used on all systems.It doesn't support multiple inheritance.The pointers in C# can only be used in the unsafe mode.It is considered as a high-level language.Once the code is compiled, it gets converted into ... Read More

Symmetric Tree in C++

Dev Prakash Sharma
Updated on 23-Feb-2021 19:10:18

512 Views

Let us suppose we have a binary tree and the task is to check whether it constructs a symmetry of itself or not. A Symmetric Binary tree constructs the mirror image of itself.For ExampleInput-1:           Output:TrueExplanation:Since the given binary tree constructs the mirror image of itself, the output is True.Input-2: Output:FalseExplanation:Since the given binary tree doesn't make a mirror image of itself, it is not symmetric.Approach to Solve this ProblemA symmetric binary tree is a tree which is the mirror image of itself, which means we have to check whether the left and right nodes of the tree are ... Read More

Write a program in C++ to split two strings to make it a palindrome

Dev Prakash Sharma
Updated on 23-Feb-2021 19:14:29

229 Views

A string is said to be a palindromic string if it remains the same after reversing it.In this particular problem, we've given two strings 'a' and 'b' of the same length. If they are split with some indexes, then the task is to check whether the sum of the strings makes a palindrome or not.Let's say we have two string 'a' and 'b' of length '4' and after splitting both the string at the index '3' such that,                  aaa | b  and bbb | aaaa (prefix of first string) + a(suffix of ... Read More

How to Segregate a given Linked List in C++

Dev Prakash Sharma
Updated on 23-Feb-2021 05:22:40

151 Views

A Linked List is a linear data structure in which each node has two blocks such that one block contains the value or data of the node and the other block contains the address of the next field.Let us assume that we have a linked list such that each node contains the data and a pointer which is pointing to the next node of the linked list. The task is to segregate the given Linked List. Segregating the linked list means we have to separate the odd indexed nodes and even index nodes in the list.Approach to Solve this ProblemTo ... Read More

Powerful Integers in C++

Dev Prakash Sharma
Updated on 23-Feb-2021 19:19:43

191 Views

Let us suppose we have three integers 'a' and 'b' and 'limit'. The task is to print the numbers in the range [a, limit]. List of these numbers is said to be powerful integers and represented as, a^i + b^j such that i >= 0 and j >= 0For ExampleInput-1:a = 2b = 5limit = 10Output:[2, 3, 4, 5, 6, 7, 9]Explanation: for each i and j,                        2^0 + 5^0 = 2   , 2^0 + 5^1= 6                       2^1 + ... Read More

Make three numbers Zero in C++

Dev Prakash Sharma
Updated on 23-Feb-2021 19:22:11

181 Views

Let us suppose we have three numbers. The task is to count the total number of optimal steps to make all these numbers '0'.For ExampleInput-1:a = 4 b = 4c = 6Output:7Explanation: Total number of optimal steps to make all the numbers '0' is, (4, 4, 6)Removing '1' from 1st and 2nd number = (3, 3, 6)Removing '1' from 1st and 3rd number = (2, 3, 5)Removing '1' from 1st and 3rd number = (1 ,3, 4)Removing '1' from 1st and 3rd number = (0 ,3 ,3)Removing '1' from 2nd and 3rd number = (0 ,2, 2)Removing '1' from 2nd and ... Read More

Advertisements