opencv, display=:0.0

xhost +local:root
su – user
export DISPLAY=:0.0

python
>>>

import cv2
img = cv2.imread('car.jpg')
img2 = cv2.imread('car2.jpg')

cv2.namedWindow('Example', cv2.CV_WINDOW_AUTOSIZE )
w = -1
v = -1
while (v == -1) && (w == -1):

cv2.imshow('Example', img)
w = cv2.waitKey(2000) # wait 2 seconds
cv2.imshow('Example', img2)
v = cv2.waitKey(2000)

cv2.destroyAllWindows()

Advertisements

~ by nambabwe on 2012/11/28.

 
%d bloggers like this: