loading
 
Array Help
Anonymous from United States  [11 posts]
16 year
In the VBScript section I retrieved the array that was created by the circles filter, but i am stuck on how to find out the length of the array, if i try doing doing .Length i get an error saying variable required circles(name ofit in the VB script),so can anyone help me with this?
Anonymous 16 year
In VBScript you use the ubound function to tell the length of an array.

I.e.

list = GetArrayVariable("CIRCLES")

write "The size is " & ubound(list)

STeven.
Anonymous from United States  [11 posts] 16 year
if I do that i get an error saying "error(2) : Type Mismatch: 'unbound' "
Anonymous 16 year

Then you are probably not using the correct GetArrayVariable routine ... use that instead of GetVariable. If you ubound a non-array then you get that error returned. If you are using GetArrayVariable see if you can see the variable using Statements->Watch Variables. Do you see the circles array in there?

STeven.
Anonymous from United States  [11 posts] 16 year
How do i see if its an array in code?
Anonymous 16 year
You can use the VBScript function isArray

if isArray(the_variable_to test) then
' we have an array
end if
Anonymous from United States  [11 posts] 16 year
thank you
Anonymous from United States  [11 posts] 16 year
also,whats the best way to reduce noise from the picture?
Anonymous 16 year
Depends on the type of noise. Normally a Filters->Mean would do it, median is slower but can do a better job. Gaussian blur is also often used (similar to mean) but again is a little slower.

If you include an image that has noise in it we can make a better suggestion.

STeven.
Anonymous from United States  [11 posts] 16 year
The attached image is the picture i have,im trying to get rid of the noise on the right that is caused by lighting differentials and me being too poor to afford a better camera.
Anonymous 16 year
Are you attempting to use this for astronomy studies? Seems like the noise would not be very apparent in a normal lighted image. The reason is that you can use dark light subtraction to remove noise caused by dark lighting for starlight image and other techniques mentioned before to remove noise in regular images.

STeven.
Anonymous from United States  [11 posts] 16 year
this actually isnt for stargaving,its for a multi-touch program,i have a camera mounted underneeth my glass desk and it reads where you touch.the attached .robo file is the file im using and the atached image is an example. In the end i want an array that has all he points of where each finger is touching the desk.

program.robo
Anonymous from United States  [11 posts] 16 year
Ooops,meant to get my hand in there
Anonymous 16 year
Ahh, thanks for the images and description ... that makes much more sense.

The issue you are having is with lighting gradient across the entire image. There are a couple ways to solve that. One is to really blur the image and then subtract that image from the source. That creates an even lighting situation (see robofile include in this message). The other, depending on your task,is to use an adaptive local measure that adjusts to the immediate lighting neighborhood. The Adaptive Threshold has that property.

I've included two robofile programs that accomplish what you want using two totally different techniques. Note that you had the right idea on trying to use the circle finder but you get better results using blob analysis in this case than edge analysis. You can also try Canny instead of Sobel which will give better results.

Anyhow, your problem now is that there are many ways to solve this issue and you'll need to tweak and test each to see which one is the most stable.

Very nice app though! Should be fun to use when done ... are you thinking of connecting it to the mouse control after you're done? Kind of like a large touchpad!

STeven.

program.robo
Anonymous 16 year
Here's the other robofile that uses adaptive thresholding.

STeven.
program.robo
Anonymous from United States  [11 posts] 16 year
ya, i want it to be like a large touchpad and to do a click a press a second finger down on it.The robo files helped some,but with the one with autoThreshold there was a big white spot in the upper left.
Anonymous from United States  [11 posts] 16 year
I got it working pretty good, The attached robo file is what i ended up with,it works ok,but ill prolly need help with the clicking part, and the scripting partis a little broken.
program.robo
Multi Touch
Anonymous
16 year
Try this for increased contrast!  It should make all the preprocessing simpler.

http://tinker.it/now/2007/02/28/multitouch-table-experiment/

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