Questions tagged [opencv3.0]

OpenCV (Open Source Computer Vision) is a library for real time computer vision. (This tag is for questions about OpenCV 3.0. Use [opencv] for general questions.)

OpenCV is an open source computer vision library

Version 3.0 released in June 2015. Its documentation can be found here.

For more information, see .

2111 questions
64
votes
2 answers

why cv2.imwrite() changes the color of pics?

I have the following piece of code: imgs = glob.glob('/home/chipin/heart/tray.png') current_img = io.imread(imgs[0]) cv2.imwrite('/home/chipin/heart/01.png', current_img[0:511,0:511]) The size of picture is 512*512, after being saved, a blue…
StalkerMuse
  • 1,001
  • 3
  • 11
  • 22
51
votes
17 answers

OpenCV Error: (-215)size.width>0 && size.height>0 in function imshow

I am trying to make a face tracker that combines Haar Cascade Classification with Lucas Kanade good feature detection. However, I keep getting an error that I cannot figure out what it means nor how to solve it. Can anyone help me here? Error: line…
user3377126
  • 2,091
  • 4
  • 32
  • 39
50
votes
6 answers

OpenCV 3.0 LineIterator

I want to use the LineIterator in OpenCV 3.0 using Python, is it still available with OpenCV 3.0 built for Python? It seems that the answers on the internet are all pointing to cv.InitLineIterator which is part of the cv module. I've tried importing…
mohikhsan
  • 1,478
  • 2
  • 11
  • 17
49
votes
4 answers

TypeError: Required argument 'outImg' (pos 6) not found

When I run my python code import numpy as np import cv2 import matplotlib.pyplot as plt img1 = cv2.imread('/home/shar/home.jpg',0) # queryImage img2 = cv2.imread('/home/shar/home2.jpg',0) # trainImage # Initiate SIFT detector sift =…
shar
  • 1,233
  • 6
  • 20
  • 30
35
votes
17 answers

OpenCV resize fails on large image with "error: (-215) ssize.area() > 0 in function cv::resize"

I'm using OpenCV 3.0.0 and Python 3.4.3 to process a very large RGB image (107162,79553,3). While I'm trying to resize it using the following code: import cv2 image = cv2.resize(img, (0,0), fx=0.5, fy=0.5, interpolation=cv2.INTER_AREA) I had this…
user3667217
  • 2,172
  • 2
  • 17
  • 29
28
votes
1 answer

What is the cv2.cv replacement in OpenCV3?

I'm using OpenCV3, and with the python bindings there is no cv2.cv module: In [1]: import cv2 In [2]: from cv2 import cv --------------------------------------------------------------------------- ImportError Traceback…
Bill Cheatham
  • 11,396
  • 17
  • 69
  • 104
27
votes
3 answers

what is the difference between OpenCV 2.4.11 and 3.0.0

The latest release of OpenCV shows 2.4.11 Feb,2015 which is more recent then 3.0.0 which is in Beta. What is the difference between them. Should I use OpenCV 2.4.11 over 3.0.0 as I have encountered few bugs in 3.0.0. How do their releases work?
Manish Kumar Sharma
  • 12,982
  • 9
  • 58
  • 105
26
votes
2 answers

OpenCV 3.x only contains one lib - opencv_world.lib?

I'm trying to update my OpenCV version from 2.4.9 to the newest version, 3.10. I downloaded the Windows binary from here, having navigated there from the official OpenCV site. I then ran the installer, but the opencv\build\x64\vc12\lib directory…
marcman
  • 3,233
  • 4
  • 36
  • 71
25
votes
4 answers

What are the main references to the fish-eye camera model in OpenCV3.0.0dev?

I am wrestling with the Fish-Eye Camera Model used in OpenCV 3.0.0.dev. I have read the documentation in this link several times, especially the "Detailed Description" part and formulas modeling fish-eye distortion. By now I have two concerns:…
masih
  • 598
  • 1
  • 6
  • 10
24
votes
3 answers

How to remove whitespace from an image in OpenCV?

I have the following image which has text and a lot of white space underneath the text. I would like to crop the white space such that it looks like the second image. Cropped Image Here is what I've done >>> img =…
Anthony
  • 33,838
  • 42
  • 169
  • 278
24
votes
4 answers

Python opencv sorting contours

I am following this question: How can I sort contours from left to right and top to bottom? to sort contours from left-to-right and top-to-bottom. However, my contours are found using this (OpenCV 3): im2, contours, hierarchy =…
user6796935
23
votes
4 answers

Error in installing opencv3 with homebrew and python3

I'm using homebrew installing opencv3 on OSX(EI Captain), brew install opencv3 --with-contrib --with-python3 --HEAD and an error occurred: Updating Homebrew... ==> Installing opencv3 from homebrew/science ==> Cloning…
SKSKSKSK
  • 545
  • 1
  • 4
  • 15
23
votes
4 answers

compatibility issue with contourArea in openCV 3

I am trying to do a simple area calculation of contours I get from findContours. My openCv version is 3.1.0 My code is: cc = cv2.findContours(im_bw.copy(), cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) cv2.contourArea(cc[0]) error:…
YNWA
  • 680
  • 2
  • 9
  • 19
23
votes
1 answer

KNN train() in cv2 with opencv 3.0

I'm trying to run k-nearest neighbours using cv2 (python 2.7) and opencv 3.0. I've replicated the same error message using code like http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_ml/py_knn/py_knn_understanding/py_knn_understanding.html: import…
Brad Foley
  • 333
  • 1
  • 2
  • 5
21
votes
2 answers

Python result changes during cv2.Rodrigues computation

If I run: import numpy as np import cv2 def changes(): rmat=np.eye(4) tvec=np.zeros(3) (rvec, jacobian)=cv2.Rodrigues(rmat) print rvec for i in range(2): changes() I get: [[6.92798859e-310] [2.19380404e-316] …
1
2 3
99 100