cv2.imshow does not work (Bug #4326)


Added by Yasuhiro Yoshimura almost 10 years ago. Updated over 9 years ago.


Status:Cancelled Start date:2015-05-09
Priority:Normal Due date:
Assignee:Maksim Shabunin % Done:

0%

Category:highgui-gui
Target version:-
Affected version:branch 'master' (3.0-dev) Operating System:Windows
Difficulty: HW Platform:x64
Pull request:

Description

In OpenCV 3.0.0-rc1, cv2.imshow(python binding) does not work.
Error message is as follows.
On the other hand, cv::imshow(C++ API) operates correctly.

OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvShowImage, file ......\modules\highgui\src\window.cpp, line 534
Traceback (most recent call last):
File "C:/Users/hoge/PycharmProjects/imshow_test_opencv300/imshow_test_opencv300.py", line 7, in 
cv2.imshow('image', img)
cv2.error: ......\modules\highgui\src\window.cpp:534: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvShowImage

There is sample code and information of my environment in the following page.
https://gist.github.com/atinfinity/8535fa7c9a87ed25a91b

I found that 'window_w32.cpp' not included in 'modules/highgui/opencv_highgui.vcxproj'.
Maybe, this configuration may be related to this issue.


History

Updated by Maksim Shabunin almost 10 years ago

The GUI block in cmake output should look like this:

--   GUI: 
--     QT:                          NO
--     Win32 UI:                    YES
--     OpenGL support:              NO
--     VTK support:                 NO

Please, check cmake output for any warnings and related messages. Make sure you have WITH_WIN32UI cmake option enabled. Try to make clean build.

  • Status changed from New to Incomplete
  • Assignee set to Maksim Shabunin

Updated by Yasuhiro Yoshimura almost 10 years ago

Thank you for your comment. Sorry, I overlooked the setting of WITH_WIN32UI.
I understood the reason of this error.

But, I used the following batch file to build OpenCV(WITH_WIN32UI=ON).
https://gist.github.com/atinfinity/73ef649afbf2b8b44d0f

So, I recorded and checked the log of this build.
As a result, I found that CMake run several times when I enabled WITH_CUDA,
In this case, the setting of WITH_WIN32UI is sometimes modified.
But, I don't understand the reason.

Updated by Maksim Shabunin almost 10 years ago

WITH_WIN32UI variable should be set to ON automatically when building on Windows. But there can be an issue with cmake scripts.

Can you please, make clean build (in empty build folder), then run cmake one-two times with same parameters in the same folder. After that, please, provide your cmake output after each run and CMakeCache.txt file contents.

Also, it is recommended to make out of source builds, i.e. use something like `set BUILD_DIR=%SOURCE_DIR%\..\build`.

Updated by Yasuhiro Yoshimura almost 10 years ago

Sorry for replying late.
I solved this issue thanks to your advice.

Updated by Maksim Shabunin over 9 years ago

  • Status changed from Incomplete to Cancelled

Also available in: Atom PDF