opencv python - how to enable debug logging?

asked 2018-10-25 09:06:16 -0600

Hi,

I am running into a bug when I use cv2.blur() when doing face blurring on big panorama images.

The python code hangs and the machine cpu usage goes to 100% on one of the core.

I would like to see if I can figure out why when I call cv2.blur(...) the code hangs. I wonder if there is a way in openCV to enable debug logging from the python api

Many Thanks

edit retag flag offensive close merge delete

Comments

what do you expect to "debug" from python ? (opencv is a c++ library)

also: os / opencv version ? how did you install that ?

and where is your code ?

berak gravatar imageberak ( 2018-10-25 09:12:15 -0600 )edit

I am running a python script from a docker container built from this image

https://hub.docker.com/r/mxnet/python/

the python script imports cv2

Python 2.7.12 (default, Dec  4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> print cv2.__version__
3.4.3

my code hangs when I use the cv2.blur function. this only happens under certain circumstances

is there anyway to see debug logs of the cc+ library when it runs as to understand what is happening inside the blur and why it gets stuck there?

could it be possible from the python wrapper?

thanks.

massimo gravatar imagemassimo ( 2018-10-25 09:23:54 -0600 )edit

oh, my what a mix from hell there ...

there is no "logging". neither in the python wrappers, nor in the c++ code. however, there is profiling , if you have that builtin (see cv2.getBuildInformation()).

you can also try to disable hardware optimizations like openCL , and see if it has an effect. (that's what i'd try first !)

berak gravatar imageberak ( 2018-10-25 09:51:50 -0600 )edit

it is indeed a mix from hell, anyway the profiling and tracing link you provided seems quite interesting. I will try it out. thanks a lot

massimo gravatar imagemassimo ( 2018-10-25 10:00:15 -0600 )edit