how to solve the problem when run python program and VNC problem

Dear friends

Recently, I do my final project for my bachelor degree with Beaglebone Black.

So I always post some stupid questions, I hope all guys do not be mad! :stuck_out_tongue: sorry about that, I am really fresh man to do that.

Until now, I just find the monitor, mouse, keypad and bought a webcam( C920), and my project environment as shown as the attachment file.(Ubuntu 12.04 LTS, Beaglebone Black: Ubuntu 12.04.4 LTS with XFCE desktop)

I got two problems are:
when I run python program like following command:


import as cv
iport time

cv.NamedWindow(“camera”, 1)

capture = cv.CaptureFromCAM(0)
cv.SetCaptureProperty(capture, 3, 360)
cv.SetCaptureProperty(capture, 4, 240)

while True:
img = cv.QueryFrame(capture)

hue_img = cv.CreateImage(cv.GetSize(img), 8, 3)
cv.CvtColor(img,hue_img, cv.CV_BGR2HSV)

threshold_img = cv.CreateImage(cv.GetSize(hue_img), 8, 1)
cv.InRangeS(hue_img, (38, 120, 60), (75, 255, 255), threshold_img)

cv.ShowImage(“Color Tracking”, img)
cv.ShowImage(“threshold”, threshold_img)

if cv.WaitKey(10) == 27:

and then, I run this python file use “./”

it show :

init done
OpenCV Error: Bad argument (Array should be CvMat or IplImage) in cvGetSize, file /home/ubuntu/finalproject/(this is my opencv directory)
opencv-2.4.7/modules/core/src/array.cpp, line 1238

Traceback (most recent call last):

File “./”, line 16, in

hug_img = cv.CreateImage(cv.Getsize(img), 8, 3)

cv2.erro: Array should be CvMat or IplImage

I check this problem for a long time, I did not get usefull answer. I hope someone can help me to solve that.

One crazy thing is I use the Ubuntu system (12.04LTS) and not use windows system

I would like to save space on my desk to using vnc viewer(SSL/SSH VNC Viewer(Ubuntu Edition) and Gtk VNC Viewer) this are not can be connect with BBB desktop

This are reference all have read. But I think this all can not help me?!msg/beagleboard/D2e1tcLCANo/a1b4csCLPdYJ

The serious problem, when I use VNC Viewer, it cannot be fine the BBB device. : (

I think this are a lit bit long and waste some time to solve, I am really looking forward someone who can help me to solve that.

Your Sincerely


problem 1.png

Ubuntu 12.04 System .jpg

working environment (Ubuntu12.04.4 XFCE).png