<h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV = 4.5.0</li>
<li>Operating System / Platform =&gt; Raspbian 32 Bit</li>
<li>Compiler =&gt; Visual Studio 2017</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">This is my program:<br>
import cv2<br>
img = cv2.imread('test.png',1)<br>
cv2.imshow('Camera Capture', img)</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/35594203/97256254-8b16ae80-184d-11eb-8914-62d7b1f0b4dc.png"><img src="https://user-images.githubusercontent.com/35594203/97256254-8b16ae80-184d-11eb-8914-62d7b1f0b4dc.png" alt="image" style="max-width: 100%;"></a><br>
When i run this program, it will prompt "error: (-2:Unspecified error) Can't initialize GTK backend in function 'cvInitSystem'"<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/35594203/97256316-ada8c780-184d-11eb-8fa5-d7d527a3e6c3.png"><img src="https://user-images.githubusercontent.com/35594203/97256316-ada8c780-184d-11eb-8fa5-d7d527a3e6c3.png" alt="image" style="max-width: 100%;"></a></p>
<h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV =&gt; 3.4</li>
<li>Operating System / Platform =&gt; aarch64 (debian based OS)</li>
<li>Compiler =&gt; g++ 8.3.0</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">I have opencv as an external dependency that I compile from source like this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ExternalProject_Add(opencv
  GIT_REPOSITORY https://github.com/opencv/opencv
  GIT_TAG &quot;3.4&quot;
  SOURCE_DIR opencv
  BINARY_DIR opencv-build
  CMAKE_ARGS
    -DCMAKE_BUILD_TYPE=RELEASE 
    -DFORCE_VTK=ON
    -DWITH_TBB=ON
    -DWITH_V4L=ON
    -DWITH_QT=OFF
    -DWITH_GTK_2_x=ON
    -DWITH_OPENGL=ON
    -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/opencv_install
)
set(OPENCV_INCLUDE_DIR ${CMAKE_BINARY_DIR}/opencv_install/include/)
set(OPENCV_LIBRARY_DIR ${CMAKE_BINARY_DIR}/opencv_install/lib/)
set(OPENCV_LIBRARIES opencv_imgproc opencv_core opencv_highgui opencv_video opencv_videoio opencv_imgcodecs opencv_features2d)
if(EXISTS &quot;${CMAKE_BINARY_DIR}/opencv_install/share/OpenCV/OpenCVConfig.cmake&quot;)
    include(${CMAKE_BINARY_DIR}/opencv_install/share/OpenCV/OpenCVConfig.cmake)
    add_custom_target(rerun)
else()
    add_custom_target(rerun ${CMAKE_COMMAND} ${CMAKE_SOURCE_DIR} DEPENDS opencv)
endif()"><pre class="notranslate"><code class="notranslate">ExternalProject_Add(opencv
  GIT_REPOSITORY https://github.com/opencv/opencv
  GIT_TAG "3.4"
  SOURCE_DIR opencv
  BINARY_DIR opencv-build
  CMAKE_ARGS
    -DCMAKE_BUILD_TYPE=RELEASE 
    -DFORCE_VTK=ON
    -DWITH_TBB=ON
    -DWITH_V4L=ON
    -DWITH_QT=OFF
    -DWITH_GTK_2_x=ON
    -DWITH_OPENGL=ON
    -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/opencv_install
)
set(OPENCV_INCLUDE_DIR ${CMAKE_BINARY_DIR}/opencv_install/include/)
set(OPENCV_LIBRARY_DIR ${CMAKE_BINARY_DIR}/opencv_install/lib/)
set(OPENCV_LIBRARIES opencv_imgproc opencv_core opencv_highgui opencv_video opencv_videoio opencv_imgcodecs opencv_features2d)
if(EXISTS "${CMAKE_BINARY_DIR}/opencv_install/share/OpenCV/OpenCVConfig.cmake")
    include(${CMAKE_BINARY_DIR}/opencv_install/share/OpenCV/OpenCVConfig.cmake)
    add_custom_target(rerun)
else()
    add_custom_target(rerun ${CMAKE_COMMAND} ${CMAKE_SOURCE_DIR} DEPENDS opencv)
endif()
</code></pre></div>
<p dir="auto">Everything compiles just fine until I run the program, an error like this appears:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="terminate called after throwing an instance of 'cv::Exception'
  what():  OpenCV(3.4.12-pre) /media/sd/nam-detect/edgetpu-detection-camera/build/opencv/modules/highgui/src/window_gtk.cpp:624: error: (-2:Unspecified error) Can't initialize GTK backend in function 'cvInitSystem'

Aborted"><pre class="notranslate"><code class="notranslate">terminate called after throwing an instance of 'cv::Exception'
  what():  OpenCV(3.4.12-pre) /media/sd/nam-detect/edgetpu-detection-camera/build/opencv/modules/highgui/src/window_gtk.cpp:624: error: (-2:Unspecified error) Can't initialize GTK backend in function 'cvInitSystem'

Aborted
</code></pre></div>
<p dir="auto">libgtk2 is definitely installed:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ sudo apt search libgtk2.0-dev
Sorting... Done
Full Text Search... Done
libgtk2.0-dev/eagle,now 2.24.32-3 arm64 [installed]
  development files for the GTK+ library"><pre class="notranslate"><code class="notranslate">$ sudo apt search libgtk2.0-dev
Sorting... Done
Full Text Search... Done
libgtk2.0-dev/eagle,now 2.24.32-3 arm64 [installed]
  development files for the GTK+ library
</code></pre></div>
<h5 dir="auto">Steps to reproduce</h5>
<p dir="auto">This code, which used to works without issue: <a href="https://github.com/Namburger/edgetpu-detection-camera">https://github.com/Namburger/edgetpu-detection-camera</a><br>
We are only seeing this behavior on one of the system o_0</p>
<p dir="auto">Any suggestion would be highly appreciated!</p>