abidrahmank / OpenCV2-Python-Tutorials

This repo contains tutorials on OpenCV-Python library using new cv2 interface
1.25k stars 888 forks source link

img = cv2.line(img, ...) vs. cv2.line(img, ...) #36

Open FranzEricSchneider opened 9 years ago

FranzEricSchneider commented 9 years ago

Hi,

I'm running through the OpenCV Drawing Functions tutorials and this link has a series of typos for me. http://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_gui/py_drawing_functions/py_drawing_functions.html#drawing-functions

For example when I run img = cv2.line(img,(0,0),(511,511),(255,0,0),5) then cv2.line returns None and promptly overwrites img with None.

I'm in Python 2, not Python 3. Does the functionality change going from 2 to 3? Is this a typo for other poeple as well?

Ludek17 commented 9 years ago

Hi, little bit late but maybe it will help somebody :)

Function cv2.line() has empty return, so it clears img if used as img = cv2.line(). Use it without 'img = ', it will modify variable passed to it so in your case:

draw a line

cv2.line(img,(0,0),(511,511),(255,0,0),5)

show already modified image with line

cv2.imshow('img',img)

abidrahmank commented 9 years ago

That tutorial is designed for OpenCV 3. On Jan 29, 2015 9:09 PM, "Ludek17" notifications@github.com wrote:

Hi, little bit late but maybe it will help somebody :)

Function cv2.line() has empty return, so it clears img if used as img = cv2.line(). Use it without 'img = ', it will modify variable passed to it so in your case: draw a line

cv2.line(img,(0,0),(511,511),(255,0,0),5) show already modified image with line

cv2.imshow('img',img)

— Reply to this email directly or view it on GitHub https://github.com/abidrahmank/OpenCV2-Python-Tutorials/issues/36#issuecomment-72045586 .

hiostreas commented 9 years ago

Is there any tutorial for camera calibration for older versions? specially for the 2.4.10.

Thanks I need that version

foreverlms commented 6 years ago

@hiostreas hi, do you know where to find tutorials specially for 2.4.x? Really thanks.