Web lists-archives.com

opencv 3.2.0-1: imshow() very slow




I started to test the new OpenCV packages and I noticed that each call to the imshow() function delays for usually 25 seconds. Most of the time, the following message is displayed:

** (Great title:11352): 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.

More rarely, a different message, as for example the following one, is shown:

** (Great title:9472): WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.TimedOut: Failed to activate service 'org.a11y.Bus': timed out

After the delay, the function displays the image as it is supposed to.
This problem occurs both from within Python and C++. To reproduce it, run one of the following programs (supposing the file picture.jpg is available):

########## cvtest.py ##########
# Run using the following command line (works also with python3):
# python cvtest.py
from __future__ import print_function, division
import time
import cv2

img = cv2.imread('picture.jpg')
print('Image shape:', img.shape)
t1 = time.time()
cv2.imshow('Great title', img)
t2 = time.time()
print('%.3f s' % (t2 - t1))
cv2.waitKey()

########## cvtest.cxx ##########
// Compile and run using the following command line (tested with GCC 5.4.0):
// g++ -std=c++11 -Wall -Wextra -O3 -march=native -s cvtest.cxx -lopencv_imgcodecs -lopencv_highgui -lopencv_core -o cvtest && ./cvtest
#include <iostream>
#include <chrono>
#include <opencv2/opencv.hpp>

int main()
{
    auto img = cv::imread("picture.jpg");
    std::cout << "Image size: " << img.size() << '\n';
    auto t1 = std::chrono::high_resolution_clock::now();;
    cv::imshow("Great title", img);
    auto t2 = std::chrono::high_resolution_clock::now();;
    std::cout << std::chrono::duration<double>(t2 - t1).count() << " s\n";
    cv::waitKey();
    return 0;
}

################################

Unfortunately I seem to be unable to send this mail to the list while attaching my cygcheck output - I tried uncompressed (400 kB) and compressed (38 kB).
-- Falk


Attachment: cygcheck.tar.xz
Description: Binary data

--
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