OpenCV Interview Questions

OpenCV Interview Questions | Freshers & Experienced

  • Sharad Jaiswal
  • 17th Dec, 2021

About Opencv

OpenCV aka open Source Computer Vision Library is a BCD licensed library, is used to analyze and process all images and videos. It is an open-source library that includes hundreds of computer vision algorithms. It is capable enough to identify faces, objects, and even handwriting by processing images and videos.

Key Features of Opencv

Below are few major features of Opencv

Image Processing

Pattern Recognition

Capture and save videos

Perform feature detection

Detect objects

Edge Detection

Analyze the video motions

Adaptive Thresholding

Face Detection

Practice Best OpenCV Interview Questions

Q1. Please explain what is OpenCV?

OpenCV is a software released in June 2000 by the intel corporation. It mainly deals with real-time things such as videos, image, & machine learning. It is used in both the fields i.e., academics, & commercial.

OpenCV is written in C++ & from version 3.4, OpenCV.js is a JavaScript. It can be run easily on any OS :- Windows, Linux, Mac.

Some most common application of OpenCV is:-

  • Medical image analysis. 
  • Monitor tracking. 
  • gesture recognization. 
  • Automated inspection and surveillance. 
  • Movies – 3D structure from motion. 
  • 2D and 3D feature toolkits. 
  • Street view image stitching. 
  • Vehicle counting on highways along with their speeds.

Q2. For what OpenCV is used?

OpenCV is the open-source vision ( To promote and protect open-source software and communities ). OpenCV looks after image processing, face recognition, patterns, videos & machine learning.

There are some library modules of OpenCV:-

  • Core functionality
  • Image processing 
  • Video 
  • Highgui 
  • Objdetect 
  • calib3d

Q3. What is OpenCV image processing?

Image Processing is a method to perform some operations on an image, in order to extract some useful information from it.

Sub-tasks can be categorized as follows:-

  • Image Acquisition, storage, transmission: digitization/quantization, compression, encoding/decoding.
  • Image Enhancement and Restoration: for improvement of pictorial information.
  • Information Extraction: for further computer analysis.

Q4. For what sobel is used in Opencv?

Sobel Operation is used for detecting the edges of an image in vertical & horizontal direction both.

Sobel() keyword is used to apply Sobel operation in the image. Sobel(src, dst, ddepth, dx, dy)

The following parameters are given below:-

  • src - used for representing the source image.
  • dst - used for representing destination image.
  • ddepth - used for representing the depth of the image.
  • dx - used to represent the x-derivative.
  • dy - used to represent the y-derivative.

Q5. How many types of image filters are available in OpenCV?

There are various filters available in OpenCV, some of them are listed below -

inear image filtering - In addition to multiplication by the scalar value, each pixel can also be increased or decreased by a constant value.

It is written in the form:- g(i,j) = K x f(i,j)

2D linear image filtering - In 2D linear image mapping the operation is defined first by superimposing the kernel matrix on the original image, then taking the product of the corresponding pixels and returning a summation of all the products.

Box filtering - Box filtering is used for blurring the image.

Non-linear image filtering - Many times linear filter work however in some cases performances can be increased by non-linear image filtering. It is more complex than the linear one.

Median image filtering - It is similar to other filters but it uses the median value as it is non-linear. It is used for removing noise from the image.

Q6. How to connect GPU with opencv?

GPU is used to direct control of transferring data between CPU & GPU.

With these requirements, anyone can connect GPU with the OpenCV -

  • OpenCV sources .
  • CMake 2.8.8 ( Cmake-GUI ) .
  • NVIDIA Display Driver .
  • NVIDIA GPU Computing Toolkit (for CUDA) .
  • And your favorite IDE/compiler .

Q7. What is computer vision.Enlist it few applications?

Computer Vision is a field of AI & computer science within deep learning at the moment. According to Sockman & Shapiro.

Computer Vision is “to make useful decisions about real physical objects and scenes based on sensed images” .

The application of Computer vision are :-

  • Face Recognition :- Nowadays apps like InstaGram, Sanpchat are using this technology.
  • Image Retrieval :- In this Case the result of something is search on the basis of image with the help of some algorithm & return the best result.
  • Gaming & control :- In gaming there uses stereo vision .
  • Survelliance :- Now at public places we can easily detect any unwanted thing/person .
  • Biometrics :- Finger print, Iris detection are the most common example .
  • Smart car :- Google & mercedes has launched his smart car in the market totally based on the computer vision.

Q8. What are Erosion and Dilation in OpenCv?

Erosion & Dilation both are basic morphological operations that are used for image processing (shapes & all). Now we discuss further about the erosion & dilation:-


It is very similar to soil erosion as the idea is the same, it is used to remove noise from the image & the function of erosion is performed by the by erode() function.


It is opposite of the erosion if we want to remove the noise from image erosion is come after dilation. It works on shape or size, generally square or circle.

Q9. What is use of Mat class in OpenCV?

Mat class is mainly based for storing the image (pixel value). It has two parts:-

  • Header:- Contains information like size, the method used for storing, and the address of the matrix (constant in size).
  • Pointer:- Stores the pixel values .

The parameters which you add to the cv::Mat are :-

  • The name starts with a lower or upper case character, hence a value between a-z or A-Z.
  • To create Mat object:- (using the create())
  • nrows is the number of rows
  • ncols is the number of columns

Q10. What is Haarcascade?

Haar cascade is an algorithm used for detecting or identifying the objects in the other images. It is a machine learning approach.

In Haar cascade there are two types of images:-

1. Positive Image

2. Negative Image

The algorithm has four stages:-

1. Haar Feature Selection

2. Creating Integral Images

3. Adaboost Training

4. Cascading Classifiers

OpenCV does this by converting the computer vision of virtual information into vector space. After that, we can identify features and patterns from the vector space and perform mathematical operations on these features. Along with this, you can also convert the images into other color scales to have a better view of features.

This is a brief introduction to OpenCV, but if you want to know more about it, check our online interview questions related to OpenCV. I guarantee you that you will capable enough to crack any interview questions by reading the below article. Then, what are you waiting for, Go and visit the website today!

Matlab vs OpenCV

The speed of executing the programs is more than MATLAB The programs take more time to execute than OpenCV.
OpenCV is based on C. MATLAB is based on C
OpenCV program needs ~ 70MB of RAM to run in real life. MATLAB needs a vast amount of memory
It is free of cost, so you can use it freely. To use MATLAB under the user license, you have to pay USD 2150 
The learning curve is stiff, which means it is not easy to learn OpenCV. MATLAB is a comparatively simple language to understand and learn.

OpenCV doesn't have its IDE.

MATLAB comes with its IDE.

Advantages of OpenCV:

  • Speed: Since OpenCV is a library of functions that are written in C/C++; therefore, it directly provides machine language to the computer. OpenCV is very fast when it comes to the speed of execution. In this, at least 30 frames per second are present that helps in real-time detection.
  • Memory: OpenCV needs very less amount of storage to save its program. Nearly 70Mb memory is enough to save the program to run in real-time.
  • Cost: OpenCV comes under the BCD license and you don't need to pay any sum of money. It is free of cost for use.
  • Portability: You can run OpenCV on Windows, Linux, and macOS very well. Also, you can run it on any device that can run C.

Disadvantages of OpenCV:

  • Development Environment: there is no particular IDE for OpenCV to use. Instead, you have to use C programming IDE depending on the operating system you are working with. For example, NetBeans IDE is used for windows, For Linux, it is an eclipse, and so on.
  • Ease of use: OpenCV is not easier to use in comparison with MATLAB.
  • Memory management: We know that OpenCV is based on C. So, each time when you allocate a memory chunk, you have to release it again. It is not smart enough to locate and release the memory in the background.

About Author :

  • Author of OpenCV Interview Questions

    Sharad Jaiswal

    My name is Sharad Jaiswal, and I am the founder of Conax web Solutions. My tech stacks are PHP, NodeJS, Angular, React. I love to write technical articles and programming blogs.

Leave A Comment :

Valid name is required.

Valid name is required.

Valid email id is required.