Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fastest way to resize image

As in the title, which is the fastest way to resize an image? I'm using Python + OpenCV 2.11 (not openCV3), and it seems cv2.resize() is very slow.

We can use CUDA with OpenCV3 (http://www.coldvision.io/2015/12/22/image-resize-with-opencv-and-cuda/), but is it supported in OpenCV 2?

like image 707
trminh89 Avatar asked May 16 '16 11:05

trminh89


People also ask

Can you bulk resize images?

If you're submitting photos, or using them for a website, you'll need to be able to quickly change the pixel dimensions of those images. Luckily, a photo editing program like Adobe Photoshop can help you batch resize images for fast and accurate results.


2 Answers

OpenCV 2 has gpu module but unfortunately there's no bindings for Python.

like image 164
Giebut Avatar answered Sep 29 '22 11:09

Giebut


CUDA programming comes with a pretty big warmup- and code complexity overhead itself.

There exists a SIMD fork of Pillow, which claims to have much better performance than ImageMagick or plain Pillow, but there are no comparisons to OpenCV. Maybe worth checking out how they compare.

like image 36
Nils Werner Avatar answered Sep 29 '22 12:09

Nils Werner