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
14
votes
1 answer

OpenCV: convertTo returns white image (sometimes)

I'm relatively new to OpenCV and i've stumpled upon a problem. I've got an input image and want to convert it from Type CV_8U to CV_32F. With some images it works just fine via input.convertTo(output, CV_32F) but with other images output would only…
moatilliatta
  • 365
  • 1
  • 7
  • 18
14
votes
1 answer

OpenCV - Floodfill onto new Mat

Given a point on an image, I'd like to floodfill all points connected to that point - but onto a new image. A naive way to do this would be to floodfill the original image to a special magic colour value. Then, visit each pixel, and copy all…
1''
  • 26,823
  • 32
  • 143
  • 200
14
votes
4 answers

Configure and Build OpenCV to Custom FFMPEG Install

I cannot seem to configure OpenCV to link to a non-/usr/lib set of FFMPEG libraries. My LD_LIBRARY_PATH contains a direct link to the folder for the custom install of FFMPEG: LD_LIBRARY_PATH=/pathto/ffmpeg-0.10.2/lib Additionally, I've configured…
enderland
  • 13,825
  • 17
  • 98
  • 152
14
votes
2 answers

Is there an equivalent of the matlab 'idealfilter' for Python in Scipy (or other libraries)?

I am looking for an equivalent of the time series idealfilter that is implemented in Matlab, for Python. My goal is to implement an ideal filter using Discrete Cosine Transform as is used in the Eulerian Video Magnification paper in Python in order…
Daniel Castro
  • 448
  • 1
  • 3
  • 10
14
votes
1 answer

Framework for benchmarking my tracking algorithm

I am currently developing an application based on OpenCV/C++ to track small animals: Here is a example of the kind of video it should process. The program simply output the x,y position of the animal and the time for each area. This is graphical…
Quentin Geissmann
  • 2,240
  • 1
  • 21
  • 36
14
votes
5 answers

Why Opencv GPU code is slower than CPU?

I'm using opencv242 + VS2010 by a notebook. I tried to do some simple test of the GPU block in OpenCV, but it showed the GPU is 100 times slower than CPU codes. In this code, I just turn the color image to grayscale image, use the function of…
David Ding
  • 680
  • 3
  • 9
  • 19
14
votes
8 answers

OpenCV, how to use arrays of points for smoothing and sampling contours?

I have a problem to get my head around smoothing and sampling contours in OpenCV (C++ API). Lets say I have got sequence of points retrieved from cv::findContours (for instance applied on this this image: Ultimately, I want To smooth a sequence…
Quentin Geissmann
  • 2,240
  • 1
  • 21
  • 36
14
votes
2 answers

OpenCV: How to use other font than HERSHEY with cvPutText (like Arial)

I want to write to an image a formatted text. OpenCV offers only a limited set of default fonts. Is it possible to use others? For example to read them from the *.ttf file (in Ubuntu)?
user1592546
  • 1,480
  • 1
  • 14
  • 30
14
votes
3 answers

Android UnsatisfiedLinkError with OpenCV 2.4.2

just trying to do a simple openCV android program. Downloaded and installed OpenCV for Android following the instructions here and added the OpenCV Library 2.4.2 as a library project for my own android project like the instructions state. However…
Jason
  • 13,563
  • 15
  • 74
  • 125
14
votes
2 answers

OpenCV via python: Is there a fast way to zero pixels outside a set of rectangles?

I have an image of a face and I have used haar cascades to detect the locations (x,y,width,height) of the mouth, nose and each eye. I would like to set all pixels outside these regions to zero. What would be the fastest (computationally) way to do…
Mike Lawrence
  • 1,641
  • 5
  • 20
  • 40
14
votes
1 answer

OpenCV Hough strongest lines

Do the HoughLines or HoughLinesP functions in OpenCV return the list of lines in accumulator order like the HoughCircles function does? I would like to know the ordering of lines. It would also be very handy to get a the accumulator value for the…
zzzz
  • 682
  • 10
  • 16
14
votes
3 answers

Running OpenCV from a Python virtualenv

I'm trying to install OpenCV within a virtualenv on my Ubuntu Server 12.04. I found a thread discussing this but managed to extract no information from it. I tried using pip install pyopencv but it failed. ... package/extras/core/ndarray.cpp:598:1: …
runfalk
  • 1,996
  • 1
  • 17
  • 20
14
votes
3 answers

Trying to extract pixel values from a given PNG image

Trying to understand PNG format. Consider this PNG Image: The Image is taken from here In Hex Editor , it looks like this: 89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52 00 00 00 80 00 00 00 44 08 02 00 00 00 C6 25 AA 3E 00 00 00 C2 49 44 41…
gpuguy
  • 4,607
  • 17
  • 67
  • 125
14
votes
4 answers

Is it possible to have black and white and color image on same window by using opencv?

Is it possible to have black-and-white and color image on same window by using opencv libraray? How can I have both of these images on same window?
user991511
14
votes
2 answers

How to format xy points for undistortPoints with the python cv2 api?

I'm having trouble formatting the x,y list of points to pass to undistortPoints (opencv 2.4.1). The error message is c++ specific and complains about the array of points not being of type CV_32FC2. Shouldn't I be able to pass in an Nx2 numpy…
Lucas Walter
  • 942
  • 3
  • 10
  • 23