Community
cancel
Showing results for 
Search instead for 
Did you mean: 
YYeon1
Novice
1,367 Views

Unable to open webcam on Intel Edison

Jump to solution

Hi everyone,

Currently, I'm doing a project about image processing on Intel Edison kit for Arduino. A webcam is attached to Intel Edison. The webcam must be able to capture the image, then send to another computer (Ubuntu OS). Video streaming is also needed. Below is the detail of my project.

Intel Edison image: edison-image-ww05-15

Downloaded from http://downloadmirror.intel.com/24909/eng/edison-image-ww05-15.zip http://downloadmirror.intel.com/24909/eng/edison-image-ww05-15.zip

I'm using this image because it is already has kernel-module-uvcvideo installed.

Webcam: Logitech C270h HD webcam (It is Linux & UVC-compatible)

Output after running dmesg -c :

I have written a C++ code in openCV and compiled it as executable file. The C++ coding (webcam.cpp) as follow:

# include

# include

# include

using namespace cv;

using namespace std;

int main() {

VideoCapture stream1(0); //0 is the id of video device

if (!stream1.isOpened()) { //check if video device has been initialised

cout << "cannot open camera";

}

while (true) {

Mat cameraFrame;

stream1.read(cameraFrame);

imshow("cam", cameraFrame);

if (waitKey(30) >= 0)

break;

}

return 0;

}

When I open the executable file (webcam), it gives this error: (cam:2050): Gtk-WARNING **: cannot open display:

As I know, Intel Edison does not have a video out (https://software.intel.com/en-us/articles/opencv-300-beta-ipp-tbb-enabled-on-yocto-with-intel-edison as described here). The error is occurred as I call functions related to 'display on the screen' such as 'imshow' which creates and displays an image or a video on the screen.

Anyone has idea to solve this problem?

It does not necessary to display image on Intel Edison but it must be able :

to capture image and send to another computer (native Ubuntu OS).

live video streaming (can view it on another computer)

I have an idea for video streaming but I am not sure how to do it. Connect both Intel Edison and computer to same network. The webcam acts like a IP camera. To stream video, I will create a C++ coding in openCV to call the IP address and port number. One more thing i'm not sure is how to check the port number.

Note: I won't use the web browser to view it because I need to integrate the C++ coding with some image processing algorithms.

Is this the solution?

Do you have better suggestion to implement it?

Thank you in advance!

Tags (1)
1 Solution
idata
Community Manager
191 Views

Hi Yeong,

 

 

Thank you very much for all the information provided.

 

 

However, I would like to know how you want to send the image captured to another PC.

 

Regarding to live video streaming I've done it using the Edi-cam guide, please look at the "Edi-cam" in this link: https://github.com/drejkim/edi-cam https://github.com/drejkim/edi-cam, it demonstrates live video streaming on Intel Edison.

 

 

Moreover, this error: Gtk-WARNING **: cannot open display: as you mentioned you can't use the function "imshow" because the Edison do not have a multimedia processor or screen that could allow you to show the image on it. This is discussed is this thread: /message/342521# 342521 https://communities.intel.com/message/342521# 342521, they are using Python, but maybe you can get an idea how to solve in your code.

 

 

Hope this information helps, let me know any updates or questions.

 

 

Regards,

 

-Yermi

 

View solution in original post

4 Replies
idata
Community Manager
192 Views

Hi Yeong,

 

 

Thank you very much for all the information provided.

 

 

However, I would like to know how you want to send the image captured to another PC.

 

Regarding to live video streaming I've done it using the Edi-cam guide, please look at the "Edi-cam" in this link: https://github.com/drejkim/edi-cam https://github.com/drejkim/edi-cam, it demonstrates live video streaming on Intel Edison.

 

 

Moreover, this error: Gtk-WARNING **: cannot open display: as you mentioned you can't use the function "imshow" because the Edison do not have a multimedia processor or screen that could allow you to show the image on it. This is discussed is this thread: /message/342521# 342521 https://communities.intel.com/message/342521# 342521, they are using Python, but maybe you can get an idea how to solve in your code.

 

 

Hope this information helps, let me know any updates or questions.

 

 

Regards,

 

-Yermi

 

View solution in original post

YYeon1
Novice
191 Views

Hi Yermi,

Thanks for your reply. I have tried "Edi-cam".

When run "npm install", i get this error:

root@fyp_ykc:/edi-cam/web/server# npm install

npm http GET https://registry.npmjs.org/morgan

npm http GET https://registry.npmjs.org/ws

npm http GET https://registry.npmjs.org/express

npm http 304 https://registry.npmjs.org/morgan

npm http 304 https://registry.npmjs.org/ws

npm http 304 https://registry.npmjs.org/express

npm http GET https://registry.npmjs.org/basic-auth

npm http GET https://registry.npmjs.org/debug

npm http GET https://registry.npmjs.org/depd

npm http GET https://registry.npmjs.org/on-finished

npm http 304 https://registry.npmjs.org/basic-auth

npm http 304 https://registry.npmjs.org/debug

npm http 304 https://registry.npmjs.org/depd

npm http 304 https://registry.npmjs.org/on-finished

npm ERR! Failed to parse json

npm ERR! Unexpected end of input

npm ERR! File: /home/root/.npm/debug/2.1.3/package/package.json

npm ERR! Failed to parse package.json data.

npm ERR! package.json must be actual JSON, not just JavaScript.

npm ERR!

npm ERR! This is not a bug in npm.

npm ERR! Tell the package author to fix their package.json file. JSON.parse

npm ERR! System Linux 3.10.17-poky-edison+

npm ERR! command "node" "/usr/bin/npm" "install"

npm ERR! cwd /edi-cam/web/server

npm ERR! node -v v0.10.28

npm ERR! npm -v 1.4.9

npm ERR! file /home/root/.npm/debug/2.1.3/package/package.json

npm ERR! code EJSONPARSE

npm http GET https://registry.npmjs.org/tinycolor

npm http GET https://registry.npmjs.org/options

npm http GET https://registry.npmjs.org/commander

npm http GET https://registry.npmjs.org/nan

npm http GET https://registry.npmjs.org/escape-html

npm http GET https://registry.npmjs.org/etag

npm http GET https://registry.npmjs.org/finalhandler

npm http GET https://registry.npmjs.org/fresh

npm http GET https://registry.npmjs.org/media-typer

npm http GET https://registry.npmjs.org/methods

npm http GET https://registry.npmjs.org/parseurl

npm http GET <a class="jive-...

idata
Community Manager
191 Views

Hi Yeong,

 

 

We saw that you have opened another thread regarding to Edi-cam, so we'll try to help you in that other thread.

 

 

Regards,

 

-Yermi

 

YYeon1
Novice
191 Views

Hi YermiA_Intel,

Great! I am waiting your assistance in that other thread (/thread/106959 How to Capture Video Stream from Edi-Cam Server using C++ in openCV? ). Thank you.

Regards,

Yeong

Reply