loading
 
Setvariable RGB filter colour
Baghdad_boy from New Zealand  [11 posts]
14 year
Hello all,

What a great program :D And a useful forum too.

I have been able to track colours and moving objects etc but now I wanted to be able to track a specific object then track another.

For example, to track a red object then hit a button and start tracking blue objects. Is there any way of accessing the colour being filtered by the RGB filter Module? Either through VBScript or otherwise.

Thank you in advance for the help and three thumbs up for the awesome software :D
Baghdad_boy from New Zealand  [11 posts] 14 year
Ah, by the way I am going to start using sockets with Visual C++ (wish me luck I'm very new) but I want to know how to access variables of modules that don't seem to appear on the list of available variables. Such as the colur being filtered by RGB Filter.

I hope I'm on the right track in using sockets if I want to make my own gui.
Anonymous 14 year
Yes, if you want to make your own GUI then using the socket based API is the way to go.

To change the RGB color you could use more than one module and surround all with an If_statement module which would cause only the one that should execute to do so. I.e. the If_statement would test something like "mode=1" and then run the first RGB_Filter, "mode=2" then run the second, etc.

Or you could use the SetParameter function from VBScript (or python later this week) to change the checkbox in the RGB Filter module.

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

Or as you are indicating you can use the API to set the channel in the RGB filter XML code as in

rr.execute("<RGB_Filter><hue_value>50</hue_value><hysteresis>0</hysteresis><min_value>100</min_value><channel>1</channel></RGB_Filter>");

for red and 2 for green, etc. You can see this XML when saving a .robo file and just loading that into a text editor.

Always more than one way to do things in RR!

STeven.

Baghdad_boy from New Zealand  [11 posts] 14 year
Awesome! I never tried to open the .robo files in a text editor to see whats in them. Their structure is so simple to follow.

<RGB_Filter>
  <channel>256</channel>
  <hysteresis>0</hysteresis>
  <result_type>4</result_type>
  <min_value>40</min_value>
  <hue_value>0</hue_value>
</RGB_Filter>

Thats awesome so I can manipulate the modules down to their last setting just using the XML code.

From what I saw on the plugins links on the website before, I thought the structure was like this:
SetVariable "RGB_Filter", some value.

But I didn't know what that value corresponded to. Now it makes sense after seeing the inners of the file.

Thanks heaps for the help STeven.

I'll post up some tutorial on the youtube account to show how to manipulate the variables now that I get it.

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