Python import cv error on OpenCV 3.0.0 (no error for import cv2) [closed]
I am using a Windows 10 machine with Python 2.7.x and OpenCV 3.0.0 installed and both work fine. I followed the official link for installation of the same along with numpy and matplotlib. I get an error saying:
ImortError: No module named cv
when I try to run the following code:
import cv2
import numpy as np
import cv
def diceroll():
rng = cv.RNG(np.random.randint(1,10000))
print 'The outcome of the roll is:'
print int(6*cv.RandReal(rng) + 1)
return
diceroll()
I have also tried using cv2.cv instead of cv(and not use import cv) but then I get an error saying:
AttributError: 'module' object has no attribute 'cv'
Implying cv2 does not have cv attribute. Is there a way I can get it to work? I have just followed the link given above and not appended any python path or set environment variables for openCV
yes, the old cv or cv2.cv api got removed entirely in opencv3. (not your error)
@berak is there a way I can use the RNG function with this setup? I am open to installing additional packages.
no real idea, unfortunately. there seems to be no such thing as cv2.RNG.
can't you use something from numpy.random ?
Sure, I will use something else . Thanks barak :)