Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

RoboRealm computer vision


  • Please log in to reply
7 replies to this topic

#1 MindTorque

MindTorque

    Seeker

  • Active Members
  • 6 posts

Posted 22 April 2012 - 02:50 PM

Just found a relatively simple means of doing vision on a PC.
RoboRealm can do many interesting things, including object recognition,
reading barcodes, controling servos (includes Phigets support), and is
well suited to controlling robots. I've only just begun experimenting with
it, so here's a simple example script to get you started with interfacing
to it with AutoIt. You can get RoboRealm from http://www.roborealm.com

Enjoy ;)

Attached Files









#2 martin

martin

    ~~\o/~~~/0\=¬''~~~

  • MVPs
  • 7,313 posts

Posted 23 April 2012 - 06:45 PM

This looks very interesting. I had a quick look at the Roborealm documentation and I didn't understand some of it. I see how you saved an image to disc, but do you understand how the "get image" instruction works. I would like to be able to grab an image and then perform some basic analysis of it. Saving to disc then loading it will not only slow things down but seems a bit silly.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

#3 Mat

Mat

    43 38 48 31 30 4E 34 4F 32

  • MVPs
  • 4,968 posts

Posted 23 April 2012 - 07:10 PM

It seems that most of the communication is done with text, however I'd look at the RR_API::setImage (as exposed by the C++ api) as they appear at first glance to be sending the pixel colours as RGB strings... May be wrong there though.

#4 MindTorque

MindTorque

    Seeker

  • Active Members
  • 6 posts

Posted 23 April 2012 - 08:23 PM

Martin,

I haven't yet had time to explore RoboRealm to the extent I'd like, but I
suspect that most analysis you'd likely wish to perform can be handled
by the broad variety of modules provided that can be inserted into the
pipeline, with the results put into one or more variables that AutoIt can
get via GetVariable - this way RoboRealm is doing all the "heavy lifting".
I agree that having to write it to disk and read it back would be rather
clunky, even if one uses a ramdisk to speed the process. I don't yet
know precisely how GetImage works, although I grabbed a look at the
type library if that's of any help to you. Here they are:

Plain Text         
// Generated .IDL file (by the OLE/COM Object Viewer) // // typelib filename: RR_COM_API.dll [   uuid(2DDA153B-5603-4697-AAC9-2B6FDCF1DC64),   version(1.0),   helpstring("RR_COM_API 1.0 Type Library"),   custom(DE77BA64-517C-11D1-A2DA-0000F8773CE9, 83951780),   custom(DE77BA63-517C-11D1-A2DA-0000F8773CE9, 1303678299) ] library RR_COM_APILib {     // TLib :    // TLib : OLE Automation : {00020430-0000-0000-C000-000000000046}     importlib("stdole2.tlb");     // Forward declare all types defined in this typelib     interface IAPI_Wrapper;     [       uuid(5379A53A-B254-483B-9DA0-AF6BA0970BE3),       helpstring("API_Wrapper Class")     ]     coclass API_Wrapper {         [default] interface IAPI_Wrapper;     };     [       odl,       uuid(B3B82392-E613-4711-B619-E04555549903),       helpstring("IAPI_Wrapper Interface"),       dual,       oleautomation     ]     interface IAPI_Wrapper : IDispatch {         [id(0x00000001), helpstring("method Connect")]         HRESULT Connect(                         [in] BSTR hostname,                         [out, retval] long* res);         [id(0x00000002), helpstring("method Disconnect")]         HRESULT Disconnect([out, retval] long* res);         [id(0x00000003), helpstring("method GetDimension")]         HRESULT GetDimension(                         [out] VARIANT* width,                         [out] VARIANT* height,                         [out, retval] long* res);         [id(0x00000004), helpstring("method GetImage")]         HRESULT GetImage(                         [in] BSTR name,                         [out] VARIANT* image,                         [out] VARIANT* width,                         [out] VARIANT* height,                         [out, retval] long* res);         [id(0x00000005), helpstring("method SetImage")]         HRESULT SetImage(                         [in] BSTR name,                         [in] VARIANT* image,                         [in] VARIANT* width,                         [in] VARIANT* height);         [id(0x00000006), helpstring("method GetVariable")]         HRESULT GetVariable(                         [in] BSTR name,                         [out, retval] BSTR* value);         [id(0x00000007), helpstring("method SetVariable")]         HRESULT SetVariable(                         [in] BSTR name,                         [in] BSTR value,                         [out, retval] long* res);         [id(0x00000008), helpstring("method DeleteVariable")]         HRESULT DeleteVariable(                         [in] BSTR name,                         [out, retval] long* res);         [id(0x00000009), helpstring("method Execute")]         HRESULT Execute(                         [in] BSTR str,                         [out, retval] long* res);         [id(0x0000000a), helpstring("method LoadProgram")]         HRESULT LoadProgram(                         [in] BSTR filename,                         [out, retval] long* res);         [id(0x0000000b), helpstring("method LoadImage")]         HRESULT LoadImage(                         [in] BSTR name,                         [in] BSTR filename,                         [out, retval] long* res);         [id(0x0000000c), helpstring("method SaveImage")]         HRESULT SaveImage(                         [in] BSTR name,                         [in] BSTR filename,                         [out, retval] long* res);         [id(0x0000000d), helpstring("method SetCamera")]         HRESULT SetCamera(                         [in] BSTR name,                         [out, retval] long* res);         [id(0x0000000e), helpstring("method Run")]         HRESULT Run(                         [in] BSTR name,                         [out, retval] long* res);         [id(0x0000000f), helpstring("method WaitVariable")]         HRESULT WaitVariable(                         [in] BSTR name,                         [in] BSTR value,                         [in] long timeout,                         [out, retval] long* res);         [id(0x00000010), helpstring("method WaitImage")]         HRESULT WaitImage([out, retval] long* res);         [id(0x00000011), helpstring("method LoadPPM")]         HRESULT LoadPPM(                         [in] BSTR filename,                         [in] VARIANT* image,                         [in] VARIANT* width,                         [in] VARIANT* height,                         [out, retval] long* res);         [id(0x00000012), helpstring("method SavePPM")]         HRESULT SavePPM(                         [in] BSTR filename,                         [in] VARIANT* image,                         [in] VARIANT* width,                         [in] VARIANT* height,                         [out, retval] long* res);         [id(0x00000013), helpstring("method Open")]         HRESULT Open(                         [in] BSTR hostname,                         [in] VARIANT* port,                         [out, retval] long* res);         [id(0x00000014), helpstring("method Close")]         HRESULT Close([out, retval] long* res);         [id(0x00000015), helpstring("method GetVariables")]         HRESULT GetVariables(                         [in] BSTR name,                         [out, retval] VARIANT* value);         [id(0x00000016), helpstring("method SetVariables")]         HRESULT SetVariables(                         [in] VARIANT* names,                         [in] VARIANT* values,                         [out, retval] long* res);         [id(0x00000017), helpstring("method SetParameter")]         HRESULT SetParameter(                         [in] BSTR mod,                         [in] VARIANT* count,                         [in] BSTR name,                         [in] BSTR value,                         long* res);         [id(0x00000018), helpstring("method GetParameter")]         HRESULT GetParameter(                         [in] BSTR mod,                         [in] VARIANT* count,                         [in] BSTR name,                         [out, retval] BSTR* res);         [id(0x00000019), helpstring("method MinimizeWindow")]         HRESULT MinimizeWindow([out, retval] long* res);         [id(0x0000001a), helpstring("method MaximizeWindow")]         HRESULT MaximizeWindow([out, retval] long* res);         [id(0x0000001b), helpstring("method MoveWindow")]         HRESULT MoveWindow(                         [in] VARIANT* x,                         [in] VARIANT* y,                         [out, retval] long* res);         [id(0x0000001c), helpstring("method ResizeWindow")]         HRESULT ResizeWindow(                         [in] VARIANT* width,                         [in] VARIANT* height,                         [out, retval] long* res);         [id(0x0000001d), helpstring("method PositionWindow")]         HRESULT PositionWindow(                         [in] VARIANT* x,                         [in] VARIANT* y,                         [in] VARIANT* width,                         [in] VARIANT* height,                         [out, retval] long* res);         [id(0x0000001e), helpstring("method SaveProgram")]         HRESULT SaveProgram(                         [in] BSTR filename,                         [out, retval] long* res);         [id(0x0000001f), helpstring("method Pause")]         HRESULT Pause([out, retval] long* res);         [id(0x00000020), helpstring("method Resume")]         HRESULT Resume([out, retval] long* res);     }; };


I hope you find the possibilities as fascinating as I do ;)

#5 MindTorque

MindTorque

    Seeker

  • Active Members
  • 6 posts

Posted 29 April 2012 - 01:49 PM

Found a typo in one line where it gets the handle for the window.
The corrected line is:
$Handle = WinWait($RR_Ver, "", 15)


#6 MindTorque

MindTorque

    Seeker

  • Active Members
  • 6 posts

Posted 10 May 2012 - 12:34 AM

Martin,

If you want to grab the image to another application you can use the
virtual webcam driver to share it with up to 5 other applications - see
http://www.roborealm.com/help/Virtual_Camera_Driver.php for the
particulars. So far I'm quite impressed with the amount of options
RoboRealm provides although I'm still short on time to experiment
with it, but I've found such things as fiducials very handy.

#7 martin

martin

    ~~\o/~~~/0\=¬''~~~

  • MVPs
  • 7,313 posts

Posted 11 May 2012 - 08:56 PM

Thanks for the link.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

#8 MindTorque

MindTorque

    Seeker

  • Active Members
  • 6 posts

Posted 06 August 2012 - 01:37 PM

Martin,

A couple of other possibilites... images can be written to and read from the clipboard
of course, for a more sophisticated scheme there's http://www.roborealm.com/help/Distributor.php
for farming the work of processing images across multiple computers. Appropirately talented
people can customize RoboRealm via their own plugins: http://www.roborealm.com/help/plugins.php
I haven't gotten that elaborate given that anything I've wanted to do so far has been
adequately addressed by their generous selection of modules.

Cheers :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users