imread() vs LoadImage() in Python [closed]
Hi,
I am a new user to Python with OpenCV (1 week old). When I search for code for some specific function, but many of them does NOT work for me. For example, I found a command to load image, I found many example with imread() command, but, my Python only work with LoadImage(). It is really confuse me because it happen on other command too. If I wish to use imread() in Python, how can I make it work?
Is that version problem? What could be wrong with my setup? I appreciate it if anyone can help me. Thanks.
Version:
Python: 2.7.3, OpenCV: 2.4.3, numpy: 1.6.2, OS: MS-Windows 7
Below two command are fro Python:
Python: cv2.imread(filename[, flags]) → retval
Python: cv.LoadImage(filename, iscolor=CV_LOAD_IMAGE_COLOR) → None
Found from: http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html
there just is no question: use cv2. (full stop)
the old cv api is being phased out, and won't be available in upcoming versions
if that does not work for you, - update. (start with numpy, 1.6.2 looks pretty old)
It is new to me. Maybe I should focus on V2 code. Thanks.
My code was: import cv2.cv as cv im = cv.imread("lean.jpg",1) Using wrong libery was the source of the problem. I got it now. Thanks.
ah, ok. easy catch. good luck here!