Questions tagged [opencv]

OpenCV (Open Source Computer Vision) is a library for real time computer vision. When using this tag, please add a language specific tag (python, c++, ...), if relevant.

OpenCV is a code library for Computer Vision related applications, spanning from many very basic tasks (capture and pre-processing of image data) to high-level algorithms (feature extraction, motion tracking, machine learning).

It is free software. Versions from 4.5.0 are licensed under the Apache 2 license, versions before that under the BSD 3-clause license. OpenCV provides a rich API in C++, Python, and Java. Third party wrappers are available. The library is platform-independent and often used for real-time image processing and computer vision (e.g. tracking in videos). It supports Windows, Linux, and OS X as well as Android (native and Java) and iOS.

OpenCV was officially launched by Intel in 1999. Version 2.0 (2009) was an important landmark as it introduced the new, comprehensive C++ interface, which since then is also to be used internally in the library. Since this release, OpenCV saw a strong acceleration of development in improving the library and adding new features. Version 3.0, released in 2015, deprecated the C API and emphasized object-oriented design for increased modularity and intuitive interface. More information may be found in Wikipedia.

Latest stable versions:

Homepage: https://opencv.org

Documentation: https://docs.opencv.org

Tutorials including source code:


Books

Note that this list is likely outdated and not vetted for quality. A book or course on computer vision in general, along with the official documentation of OpenCV, will give a better understanding of the matter and the library.

72729 questions
13
votes
2 answers

Why create your own Haar-classifier cascades?

I found this tutorial on creating your own haar-classifier cascades. This raised the question with me: what are the advantages, if any, of running HaarTraining, and creating your own classifier (as opposed to using the cascades provided by OpenCv)?
wen
  • 3,782
  • 9
  • 34
  • 54
13
votes
6 answers

People Counting System

I want to develop a "People Counting System" using OpenCV (or Emgu CV). Please guide me on how to implement or lead me to some examples or open source projects. (I have done some work: extracting diff then threshold to delete background, using…
Kaveh Shahbazian
  • 13,088
  • 13
  • 80
  • 139
13
votes
2 answers

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway

I try to use library cv2 for changing picture. In mode debug I found out that problem in function cv2.namedWindow: def run(self): name_of_window = 'Test_version' image_cv2 = cv2.imread('external_data/probe.jpg') …
Spartak Borisov
  • 357
  • 2
  • 4
  • 14
13
votes
5 answers

How to remove distortion due to motion, from an image

I am trying to track motion of a toy car. I have recorded few videos and now trying to calculate rotation. My problem is extracting features from object surface is quit challenging due to motion blur. Below image shows a cropped image from a video…
Niroshan
  • 2,064
  • 6
  • 35
  • 60
13
votes
5 answers

How to remove hidden marks from images using python opencv?

I wanted to work on a small project to challenge my computer vision and image processing skills. I came across a project where I want to remove the hidden marks from the image. Hidden here refers to the watermarks that are not easily visible in rgb…
Hissaan Ali
  • 2,229
  • 4
  • 25
  • 51
13
votes
1 answer

How to use OpenCV 4 in native C++ of Flutter (in 2022) (support Flutter 2.0/3.0)?

I need to write some C++ code which uses OpenCV, and the Flutter code will call those C++ code. There are tutorials about writing C++ with Flutter, but I cannot find any up-to-date and easy-to-deploy solution about working with OpenCV. How to do…
ch271828n
  • 15,854
  • 5
  • 53
  • 88
13
votes
2 answers

how to remove background of images in python

I have a dataset that contains full width human images I want to remove all the backgrounds in those Images and just leave the full width person, my questions: is there any python code that does that ? and do I need to specify each time the…
reham501
  • 109
  • 1
  • 1
  • 9
13
votes
1 answer

cv2.approxPolyDP() , cv2.arcLength() How these works

How do these function works? I am using Python3.7 and OpenCv 4.2.0. Thanks in Advance. approx = cv2.approxPolyDP(cnt, 0.01*cv2.arcLength(cnt, True), True)
13
votes
3 answers

Digital image processing of corn kernels

I am trying to identify and count insect-infested corn kernels from good or healthy corn kernels. I have done the thresholding up until drawing contours around all the corn kernels in the image. FYI, the insect-infested kernels have holes and…
SMD
  • 131
  • 2
13
votes
2 answers

OpenCV cvFindContours - how do I separate components of a contour

I've been playing around with OpenCV and with alot of trial and error have managed to learn how to detect circles (coins) in a photo. Everything is working great, except when I place coins directly next to each other (as seen below, ignore the fact…
Grinneh
  • 871
  • 1
  • 8
  • 14
13
votes
3 answers

Using YOLO or other image recognition techniques to identify all alphanumeric text present in images

I have multiple images diagram, all of which contains labels as alphanumeric characters instead of just the text label itself. I want my YOLO model to identify all the numbers & alphanumeric characters present in it. How can I train my YOLO model to…
user11247278
13
votes
3 answers

Open CV Face Recognition not accurate

In my app I'm trying to do face recognition on a specific image using Open CV, here first I'm training one image and then after training that image if I run face recognition on that image it successfully recognizes that trained face. However, when I…
R.Coder
  • 257
  • 3
  • 17
13
votes
1 answer

OpenCV4 error: ‘CV_CAP_PROP_FRAME_WIDTH’ was not declared in this scope

I recently migrated from OpenCV3.3 to the latest version OpenCV4 on my Ubuntu 18.04 LTS. I have some persistent issues with the installation. My installation did not give any errors when I followed this installation tutorial. But whenever I include…
Arun Kumar
  • 634
  • 2
  • 12
  • 26
13
votes
3 answers

Extracting the dimensions of a rectangle

So I'm working on an image processing project with sonar images. To be more specific, I am trying to extract the dimensions of an image of a pool taken by a sonar scanner. I was able to extract the rectangular region of the pool but I can not figure…
rockmyboat
  • 157
  • 2
  • 10
13
votes
5 answers

cv2.rectangle: TypeError: Argument given by name ('thickness') and position (4)

I am trying to visualize bounding boxes on top of an image. My Code: color = (255, 255, 0) thickness = 4 x_min, y_min, x_max, y_max = bbox cv2.rectangle(img, (x_min, y_min), (x_max, y_max), color, thickness=thickness) and I get TypeError: Argument…
Sam Shleifer
  • 1,716
  • 2
  • 18
  • 29