Ask Your Question

Revision history [back]

Python openCV drawing functions does not work?!

Hi, today I tried to draw a line in a window, this is the code I used.

import numpy as np import cv2

Create a black image

img = np.zeros((512,512,3), np.uint8)

Draw a diagonal blue line with thickness of 5 px

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

The problem is that when I run this, I get no errors and the Shell comes up and start running but the window to show the video never pops up or anything, nothing happens. Am I missing some plugin or something that I need to run this?

I got OpenCV and Matplotlib installed for Python.

Heelp please! =(

Python openCV drawing functions does not work?!

Hi, today I tried to draw a line in a window, this is the code I used.

import numpy as np
import cv2

cv2

# Create a black image

image img = np.zeros((512,512,3), np.uint8)

np.uint8)

# Draw a diagonal blue line with thickness of 5 px

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

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

The problem is that when I run this, I get no errors and the Shell comes up and start running but the window to show the video never pops up or anything, nothing happens. Am I missing some plugin or something that I need to run this?

I got OpenCV and Matplotlib installed for Python.

Heelp please! =(