I want to use OpenCV2.0 and Python2.6 to show resized images. I used and adopted this example but unfortunately, this code is for OpenCV2.1 and does not seem to be working on 2.0. Here my code:
import os, glob import cv ulpath = "exampleshq/" for infile in glob.glob( os.path.join(ulpath, "*.jpg") ): im = cv.LoadImage(infile) thumbnail = cv.CreateMat(im.rows/10, im.cols/10, cv.CV_8UC3) cv.Resize(im, thumbnail) cv.NamedWindow(infile) cv.ShowImage(infile, thumbnail) cv.WaitKey(0) cv.DestroyWindow(name)
Since I cannot use
cv.LoadImageM
I used
cv.LoadImage
instead, which was no problem in other applications. Nevertheless, cv.iplimage has no attribute rows, cols or size. Can anyone give me a hint, how to solve this problem?
Related Posts:
- RuntimeWarning: overflow encountered in ubyte_scalars
- TypeError: Image data can not convert to float
- Numpy Resize/Rescale Image
- TypeError: Image data can not convert to float
- inverting image in Python with OpenCV
- Python OpenCV2 (cv2) wrapper to get image size?
- ValueError: total size of new array must be unchanged
- Cannot find module cv2 when using OpenCV
- Cannot find module cv2 when using OpenCV
- ImportError: numpy.core.multiarray failed to import
- import opencv vs import cv2
- Cannot find module cv2 when using OpenCV
- ImportError: DLL load failed: %1 is not a valid Win32 application. But the DLL’s are there
- ImportError: numpy.core.multiarray failed to import
- ImportError: DLL load failed: %1 is not a valid Win32 application. But the DLL’s are there
- Permission denied error by installing matplotlib
- How do I install Python OpenCV through Conda?
- How do I insert a JPEG image into a python Tkinter window?
- How can I upgrade NumPy?
- How to convert a PIL Image into a numpy array?
- Difference in output with waitKey(0) and waitKey(1)
- numpy with python: convert 3d array to 2d
- How do I resize an image using PIL and maintain its aspect ratio?
- ImportError: libSM.so.6: cannot open shared object file: No such file or directory
- explain arguments meaning in res = cv2.bitwise_and(img,img,mask = mask)
- OpenCV NoneType object has no attribute shape
- What does bitwise_and operator exactly do in openCV?
- No module named Image
- SystemError: new style getargs format but argument is not a tuple?
- Saving a Numpy array as an image
- matplotlib: how to draw a rectangle on image
- ImportError: No module named ‘cv2’ Python3
- Cannot import cv2 in python in OSX
- ImportError: No module named cv2
- OpenCV NoneType object has no attribute shape
- Installing opencv on Windows 10 with python 3.6 and anaconda 3.6
- How to crop an image in OpenCV using Python
- SystemError: new style getargs format but argument is not a tuple?
- How to embed image or picture in jupyter notebook, either from a local machine or from a web resource?
- cmake error ‘the source does not appear to contain CMakeLists.txt’
- How does cv2.boundingRect() function of OpenCV work?
- OpenCV houghLinesP parameters
- Equivalent to matlab’s imagesc in matplotlib? [duplicate]
- How do I lowercase a string in Python?
- Difference between del, remove, and pop on lists
- How to use the pass statement
- How do you round UP a number?
- What is the pythonic way to calculate dot product?
- Where does pip install its packages?
- Python inline if statement
- if/else in a list comprehension
- data type not understood
- How to read a text file into a string variable and strip newlines?
- What does hash do in python?
- How to copy a dictionary and only edit the copy
- Are dictionaries ordered in Python 3.6+?
- How to customize a scatter matrix to see all titles?
- What is the problem with shadowing names defined in outer scopes?
- TypeError: write() argument must be str, not bytes (Python 3 vs Python 2 )
- How to clear the interpreter console?
- Forbidden (403) CSRF verification failed. Request aborted. Even using the {% csrf_token %}
- Flask ImportError: No Module Named Flask
- ModuleNotFoundError: No module named ‘MySQLdb’
- How to change dataframe column names in pyspark?
- Normalize data in pandas
- Unresolved reference issue in PyCharm
- How to use 2to3 properly for python?
- Is there a way to return literally nothing in python?
- Is there a built-in function to print all the current properties and values of an object?
- How to troubleshoot an “AttributeError: __exit__” in multiproccesing in Python?
- TypeError : Unhashable type
- Read PDF in Python and convert to text in PDF
- Importing variables from another file in Python
- How to read a file without newlines?
- Multiple try codes in one block
- Error: Segmentation fault (core dumped)
- can’t open tensorboard 0.0.0.0:6006 or localhost:6006
- TypeError: ‘newline’ is an invalid keyword argument for this function
- datetime to string with series in pandas
- Is it possible only to declare a variable without assigning any value in Python?
- How to Install pip for python 3.7 on Ubuntu 18?
- How to add a new row to an empty numpy array
- Logical indexing with lists
- How to set timeout on python’s socket recv method?
- How does str(list) work?
- Automatic indentation for Python in Notepad++
- How to make a python script wait for a pressed key?
- Mean Squared Error in Numpy?
- Turn a single number into single digits Python
- Is there a head and tail method for Numpy array?
- What should I use to open a url instead of urlopen in urllib3
- Create a list with initial capacity in Python
- Accessing dict_keys element by index in Python3
- How to update Pandas from Anaconda and is it possible to use eclipse with this last
- Does python support character type?
- Styling multi-line conditions in ‘if’ statements?
- What is related_name used for?
- Symbol not found: __PyCodecInfo_GetIncrementalDecoder
- How can I tail a log file in Python?
- How to write unicode strings into a file?