👻 Check our latest review to choose the best laptop for Machine Learning engineers and Deep learning tasks!
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?
👻 Read also: what is the best laptop for engineering students?
We hope this article has helped you to resolve the problem. Apart from How to resize an image with OpenCV2.0 and Python2.6, check other code Python module-related topics.
Want to excel in Python? See our review of the best Python online courses 2023. If you are interested in Data Science, check also how to learn programming in R.
By the way, this material is also available in other languages:
- Italiano How to resize an image with OpenCV2.0 and Python2.6
- Deutsch How to resize an image with OpenCV2.0 and Python2.6
- Français How to resize an image with OpenCV2.0 and Python2.6
- Español How to resize an image with OpenCV2.0 and Python2.6
- Türk How to resize an image with OpenCV2.0 and Python2.6
- Русский How to resize an image with OpenCV2.0 and Python2.6
- Português How to resize an image with OpenCV2.0 and Python2.6
- Polski How to resize an image with OpenCV2.0 and Python2.6
- Nederlandse How to resize an image with OpenCV2.0 and Python2.6
- 中文 How to resize an image with OpenCV2.0 and Python2.6
- 한국어 How to resize an image with OpenCV2.0 and Python2.6
- 日本語 How to resize an image with OpenCV2.0 and Python2.6
- हिन्दी How to resize an image with OpenCV2.0 and Python2.6
San Francisco | 2023-03-29
os Python module is always a bit confusing 😭 How to resize an image with OpenCV2.0 and Python2.6 is not the only problem I encountered. I am just not quite sure it is the best method
Boston | 2023-03-29
I was preparing for my coding interview, thanks for clarifying this - How to resize an image with OpenCV2.0 and Python2.6 in Python is not the simplest one. Checked yesterday, it works!
Singapore | 2023-03-29
Thanks for explaining! I was stuck with How to resize an image with OpenCV2.0 and Python2.6 for some hours, finally got it done 🤗. Will get back tomorrow with feedback