Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JPEG decoding and encoding is significant slower than from Ubuntu package #52

Closed
homm opened this issue Oct 15, 2017 · 3 comments
Closed

Comments

@homm
Copy link

homm commented Oct 15, 2017

First of all thanks for your work!

OpenCV version in Ubuntu 16.04 is still 2.4.9.1, so most users have to install OpenCV from this wheels.

Surprisingly, these wheels have much lower JPEG decoding and encoding speed than shipped with Ubuntu.

Cv2 load 2560×1600 RGB image
    Jpeg load           0.05430 s    75.43 Mpx/s
    Jpeg save           0.10867 s    37.69 Mpx/s
Cv2 load 2560×1600 RGB image
    Jpeg load           0.03277 s   124.99 Mpx/s
    Jpeg save           0.03084 s   132.82 Mpx/s

Here is perf report for both cases:

screen shot 2017-10-16 at 1 39 58

screen shot 2017-10-16 at 1 17 12

It's clear that these wheels don't use system-provided libjpeg library (which is libjpeg-turbo for some systems). Instead, they are decoding and encoding using some build-in libjpeg library which is much slower.

I see two solutions: use libjpeg-turbo for wheels or use system libraries.

@homm
Copy link
Author

homm commented Oct 15, 2017

I've tried to build recent version of OpenCV from sources, it also uses system codecs and run fast

@skvark
Copy link
Member

skvark commented Oct 20, 2017

Yes, due to the nature of the wheel packaging format requirements (restricted subset of the Linux kernel and core userspace ABI) almost all of the needed libraries are embedded into the wheels. However, libjpeg's case is a bit different because the it's most likely included in the static OpenCV binary.

I'm pretty sure I can change the library to libjpeg-turbo, but it requires a lot of manual tinkering on the CentOS 5 Docker containers (like all the other open Linux related issues which are currently open).

@skvark
Copy link
Member

skvark commented Dec 18, 2017

Next release will ship with libjpeg-turbo 1.5.3.

@skvark skvark closed this as completed Dec 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants