Web lists-archives.com

Re: opencv 3.2.0-1: imshow() very slow




Am 07.05.2017 um 21:16 schrieb René Berber:
Obviously you are not running dbus-daemon, which accounts for the
time-out, and the delay, but where does that dependency come from? Is it
needed? apparently not.

According to OpenCV's documentation
(http://docs.opencv.org/2.4/doc/tutorials/introduction/linux_install/linux_install.html)
there is no such dependency.

Well, I think there were many functionalities added to OpenCV between releases 2.4 and 3.2, so it seems that dbus-daemon is now required. As a matter of fact, it is launched in the background the first time I start my 'cvtest' program - here is an extract of a bash session:
___________________________________________________________________________
falkt@FalksAsusDesktop Mo 2017-05-08 01:35:13 ~
$ python cvtest.py
Image shape: (600, 800, 3)

** (Great title:10460): WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
26.541 s

falkt@FalksAsusDesktop Mo 2017-05-08 01:35:54 ~
$ ps
      PID    PPID    PGID     WINPID   TTY         UID    STIME COMMAND
     6192   10764    2924       4404  ?         197609 01:35:29 /usr/libexec/at-spi-bus-launcher
      396       1   10460        396  pty0      197609 01:35:29 /usr/bin/dbus-launch
     8416    1944    1944       2360  cons0     197609 17:28:14 /usr/bin/xinit
    10744    8416   10744      10244  cons0     197609 17:28:14 /usr/bin/XWin
     1944       1    1944       6284  cons0     197609 17:28:09 /usr/bin/sh
     6492    8416    6492      10288  ?         197609 17:28:16 /usr/bin/sh
     8388    6492    6492       6424  ?         197609 17:28:16 /usr/bin/sleep
     6860    2756    6860       8292  pty0      197609 01:34:52 /usr/bin/bash
    10764    2924    2924      10764  ?         197609 01:35:29 /usr/bin/dbus-daemon
     2756       1    2756       2756  ?         197609 01:34:52 /usr/bin/mintty
     6464    6860    6464       4904  pty0      197609 01:36:01 /usr/bin/ps
     2924       1    2924       2924  ?         197609 01:35:29 /usr/bin/dbus-daemon

falkt@FalksAsusDesktop Mo 2017-05-08 01:36:01 ~
$
___________________________________________________________________________

Strangely enough, even with dbus-daemon launched, the problem persists.

Check out the libraries linked, and probably one of them has that
dependency.  Dbus library is linked somehow, the problem is which other
library was the one that brought it.  Perhaps checking with pkg-config
to see which one uses it would help.

When I run cygcheck on the executable generated from the cvtest.cxx program I posted, I get the following list:
___________________________________________________________________________
$ cygcheck ./cvtest.exe
C:\Users\falkt\Documents\cvtest.exe
  C:\cygwin64\bin\cygwin1.dll
    C:\WINDOWS\system32\KERNEL32.dll
      C:\WINDOWS\system32\ntdll.dll
      C:\WINDOWS\system32\KERNELBASE.dll
        C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\api-ms-win-eventing-provider-l1-1-0.dll
  C:\cygwin64\bin\cygopencv_core-3.2.dll
    C:\cygwin64\bin\cygz.dll
    C:\cygwin64\bin\cyggcc_s-seh-1.dll
    C:\cygwin64\bin\cygstdc++-6.dll
  C:\cygwin64\bin\cygopencv_highgui-3.2.dll
    C:\cygwin64\bin\cygopencv_imgcodecs-3.2.dll
      C:\cygwin64\bin\cygopencv_imgproc-3.2.dll
      C:\cygwin64\bin\cygHalf-12.dll
      C:\cygwin64\bin\cygIlmImf-22.dll
        C:\cygwin64\bin\cygIex-12.dll
        C:\cygwin64\bin\cygIlmThread-12.dll
      C:\cygwin64\bin\cygjasper-4.dll
        C:\cygwin64\bin\cygjpeg-8.dll
      C:\cygwin64\bin\cygpng16-16.dll
      C:\cygwin64\bin\cygtiff-6.dll
        C:\cygwin64\bin\cygjbig-2.dll
        C:\cygwin64\bin\cyglzma-5.dll
      C:\cygwin64\bin\cygwebp-5.dll
    C:\cygwin64\bin\cygcairo-2.dll
      C:\cygwin64\bin\cygEGL-1.dll
        C:\cygwin64\bin\cygexpat-1.dll
        C:\cygwin64\bin\cygX11-xcb-1.dll
        C:\cygwin64\bin\cygxcb-1.dll
          C:\cygwin64\bin\cygXau-6.dll
          C:\cygwin64\bin\cygXdmcp-6.dll
      C:\cygwin64\bin\cygfontconfig-1.dll
        C:\cygwin64\bin\cygfreetype-6.dll
          C:\cygwin64\bin\cygbz2-1.dll
      C:\cygwin64\bin\cygGL-1.dll
        C:\cygwin64\bin\cygglapi-0.dll
        C:\cygwin64\bin\cygX11-6.dll
        C:\cygwin64\bin\cygxcb-glx-0.dll
        C:\cygwin64\bin\cygXext-6.dll
        C:\WINDOWS\system32\GDI32.dll
        C:\WINDOWS\system32\OPENGL32.dll
          C:\WINDOWS\system32\msvcrt.dll
          C:\WINDOWS\system32\ADVAPI32.dll
            C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\api-ms-win-eventing-controller-l1-1-0.dll
            C:\WINDOWS\system32\SECHOST.dll
              C:\WINDOWS\system32\RPCRT4.dll
          C:\WINDOWS\system32\GLU32.dll
            C:\WINDOWS\system32\USER32.dll
              C:\WINDOWS\system32\win32u.dll
          C:\WINDOWS\system32\DDRAW.dll
            C:\WINDOWS\system32\DCIMAN32.dll
      C:\cygwin64\bin\cygpixman-1-0.dll
      C:\cygwin64\bin\cygxcb-render-0.dll
      C:\cygwin64\bin\cygxcb-shm-0.dll
      C:\cygwin64\bin\cygXrender-1.dll
    C:\cygwin64\bin\cyggdk-3-0.dll
      C:\cygwin64\bin\cygcairo-gobject-2.dll
        C:\cygwin64\bin\cygglib-2.0-0.dll
          C:\cygwin64\bin\cygiconv-2.dll
          C:\cygwin64\bin\cygintl-8.dll
          C:\cygwin64\bin\cygpcre-1.dll
        C:\cygwin64\bin\cyggobject-2.0-0.dll
          C:\cygwin64\bin\cygffi-6.dll
      C:\cygwin64\bin\cygepoxy-0.dll
      C:\cygwin64\bin\cyggdk_pixbuf-2.0-0.dll
        C:\cygwin64\bin\cyggio-2.0-0.dll
          C:\cygwin64\bin\cyggmodule-2.0-0.dll
      C:\cygwin64\bin\cygpango-1.0-0.dll
        C:\cygwin64\bin\cygthai-0.dll
          C:\cygwin64\bin\cygdatrie-1.dll
      C:\cygwin64\bin\cygpangocairo-1.0-0.dll
        C:\cygwin64\bin\cygpangoft2-1.0-0.dll
          C:\cygwin64\bin\cygharfbuzz-0.dll
            C:\cygwin64\bin\cyggraphite2-3.dll
      C:\cygwin64\bin\cygXcomposite-1.dll
      C:\cygwin64\bin\cygXcursor-1.dll
        C:\cygwin64\bin\cygXfixes-3.dll
      C:\cygwin64\bin\cygXdamage-1.dll
      C:\cygwin64\bin\cygXi-6.dll
      C:\cygwin64\bin\cygXinerama-1.dll
      C:\cygwin64\bin\cygXrandr-2.dll
    C:\cygwin64\bin\cyggtk-3-0.dll
      C:\cygwin64\bin\cygatk-1.0-0.dll
      C:\cygwin64\bin\cygatk-bridge-2.0-0.dll
        C:\cygwin64\bin\cygatspi-0.dll
          C:\cygwin64\bin\cygdbus-1-3.dll
___________________________________________________________________________

So effectively cygdbus-1-3.dll appears in the last line.

Of course there's a better hint on your message: 'org.a11y.Bus'  I have
no idea what library, or program uses that Dbus ID.  Using Google I
found
https://github.com/GNOME/at-spi2-core/blob/master/bus/org.a11y.Bus.service.in
which is Gnome... so perhaps the OpenCV released only works with Gnome &
X-Windows running.

Starting the cvtest programs in a Gnome session doesn't change anything: always the same warning message and a 25-seconds delay before displaying the picture in a window.
-- Falk

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple