loading
 
Streaming Webcam to Roborealm
J.Geddes from Australia  [4 posts]
10 year
Hi.

I was wondering if it were possible to stream my webcam over a network using RR, and have that stream downloaded on another PC(s) and processed with either another RR or Matlab?

I'm able to setup the webserver and view it in the java applet, but this is not quite the functionality I am after.

Using something like:
    img = imread('127.0.0.1:8080');
return errors of unknown file type, and RR HTML module returns a similar error (not a .jpeg).

Any help on this would be greatly appreciated!

Thanks.
Steven Gentner from United States  [1446 posts] 10 year
J.,

1. Yes, and no. As there are a couple ways to do this. If you remain in the RR ecosystem, that's easier. You can use the Distributor modules to pass image and variables from one RR instance to another. This happens over a network.

2. If you want to use the webserver route (so that you can peek into the stream from a webbrowser), setup the system as you had but instead use the HTTP_Read module on the remote RR system and just use

http://127.0.0.1:8080/whatever.jpg

in the url and that will make the remote RR act like a webbrowser with respect to the streaming RR.

3. If you want an app on the remote system to view that camera, I'd recommend using the distributor modules between two copies of RR and then have the virtual camera setup on the remote side. This will effectively create a webcam that will get its info from the remote system. This webcam should then look like a webcam installed on the system locally.

4. It seems like from your statement that you are working with a code system. I'd then use the API

http://www.roborealm.com/help/API.php

which works over a network to grab images into your programming system. In this case, only one RR copy is needed to capture the local webcam and then have its API (see the Options dialog) enabled that can be queried from a remote system.

Hopefully one of these works for you.

STeven.
J.Geddes from Australia  [4 posts] 10 year
Thanks.

I'll give these options a go and get back to you if they DON'T work!
J.Geddes from Australia  [4 posts] 10 year
I'm having a few issues actually making the provided Matlab files for the API work.

I compiled MexFunction.cpp (mex -v MexFunction.cpp) and ran the test. This error occurred:
>> test
Undefined function 'RoboRealm' for input arguments of type 'char'.

Error in test (line 9)
RoboRealm('open', 'C:\Program Files (x86)\RoboRealm\RoboRealm.exe', 6060);

I'v never actually used mex files in matlab before so it could be that im missing an obvious step.

Any help would be greatly appreciated!
Steven Gentner from United States  [1446 posts] 10 year
J.

When you type that you end up with a MexFunction.mexw64 When you run the test.m file it is looking for a RoboRealm.mexw64 So if you rename MexFunction to RoboRealm things should improve.

Note that I'm assuming you have a 64bit system.

If that doesn't work, unzip the attached (compiled for 64bit system) and try that file.

Also, check the first line in test.m is to the right path to RoboRealm. Its probably configured differently for you. Will most likely be

RoboRealm('open', 'c:\Program Files (x86)\RoboRealm\RoboRealm.exe', 6060);

since you are on a 64 bit system.

STeven.
RoboRealm.zip
J.Geddes from Australia  [4 posts] 10 year
Thanks!
Renaming MexFunction.mexw64 to RoboRealm.mexw64 allowed me to run the test file.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index