DQZHU
Posts: 1
Joined: Sat Apr 30, 2016 2:01 pm

opencv can not show picture

Sat Apr 30, 2016 2:16 pm

I am following the tutorial of opencv(using python), when i want to show a picture, i meet a problem that says: Gtk-WARNING **: cannot open display:
I have open Xming, when run the pythin code. I can not find what the problem is.

the command I type in are:

(cv) pi@raspberrypi:~/Documents/opencvtutorial $ ls

(cv) pi@raspberrypi:~/Documents/opencvtutorial $ ls
imread.py me.jpg
(cv) pi@raspberrypi:~/Documents/opencvtutorial $ python imread.py

(image:1419): Gtk-WARNING **: cannot open display:

And the python code is:

import numpy as np
import cv2
#load a color image in color
img = cv2.imread('me.jpg',1)
#show an image
cv2.imshow('image',img)

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: opencv can not show picture

Sun May 01, 2016 5:47 pm

DQZHU wrote:I am following the tutorial of opencv(using python), when i want to show a picture, i meet a problem that says: Gtk-WARNING **: cannot open display:
I have open Xming, when run the pythin code. I can not find what the problem is.
Are you running this from another machine? Do other X applications open properly, e.g. iceweasel? So if you type iceweasel instead of what you are trying, does that come up?

roundmoundofsound
Posts: 1
Joined: Sun May 14, 2017 2:43 am

Re: opencv can not show picture

Sun May 14, 2017 2:45 am

Is there a resolution for this? I have the same issue.

Return to “Graphics programming”