I'm getting an error message with my code: Syntax error on token "
filename" , identifier expected
A cursory google search let me know that I must have a misplaced '{' somewhere, but even going through the code multiple times didn't let me find anything, all the curly brackets are closed.
Here is my code so far:
Code:/*
Based on snippets from 'Circle Follow' by Monica Monin
*/
//Import JMyron library
import JMyron.*;
JMyron m; //camera object
//switches
boolean showCamera = true; //Will use this boolean variable to turn the visual of the camera on and off
boolean showBlobs = true;
//threshhold for lighting
int threshold = 255;
void setup(){
size (320,240);
m = new Jmyron(); //new instance of camera object
m.start(width,height); //Capture field of view
m.trackColor (255,255,255,threshold);
m.mindensity(100); //min pixels permitted to form a box
m.maxdensity(10000); // max "
println ("Myron " + m.version());
noFill();
}
void draw(){
m.update(); //update (keep updating camera view)
//camera on/off
if (showCamera) {
drawCamera();//draw the camera to the screen
} else { //showCamera must be false
background(0); //draw the background
}
//glob centers - based on revised Jmyron library by _________
//two arrays
int[][] a; //store the centers of the globs
int[][] b = m.globBoxes(); //will return an array with X,Y position + width+height - rectangles
//store initial area of biggest blob
float biggestBlob = 0;
int d = 0;//this will store the index of our biggest blob in the globBoxes array
//Position 2 and 3 hold the width and height of the glob at index i, times them together to get the area of the blob
float blobSize = b[i][2]*b[i][3];
//If the current blob is bigger, then make it the biggest blob
if (blobSize > biggestBlob) {
biggestBlob = blobSize;
d = i; //store its position in the array
}
//Draw the biggest blob, it will come up red
if (showBlobs) {
stroke(255,0,0);
noFill();
rect( b[d][0] , b[d][1] , b[d][2] , b[d][3] );
}
//fetch the centers of the globs
a = m.globCenters();
//draw the globs
stroke(255,128,128);
fill(128,0,128,128);
//for every blob center
print("i see " + a.length + " blobs\n");
//itterate through all blobs in array to find biggest one
// start at i=1
for(int i=1;i<a.length;i++){
//output to the console which blob this is
print("blob " + i + " : ");
}
//if the blob is not exactly at 0 x 0
//(jmyron may have this quirk, but it only rarely occurs)
if(a[i][1] != 0 && a[i][0] != 0){
//output the x and y coords of the blob to the console
print(a[i][0] + " X " + a[i][1] + "\n");
//draw the exact point of the blob center
point(a[i][0],a[i][1]);
//draw an ellipse around the point to make it easyer to see
//you might also use it as bounds for tracking objects.
ellipse(a[i][0],a[i][1],20,20);
} else {
//(if the blob center was at 0x0)
//output to the console that this blob was skipped
print ("skipped. (0x0) \n");
}
}
If anyone can help out, I would really appreciate it