330
edits
Line 28: | Line 28: | ||
[[File:codeProcessing1.jpg]] | [[File:codeProcessing1.jpg]] | ||
<source lang="Java" line start= "32"> | |||
// ================================================== | |||
// captureEvent() | |||
// ================================================== | |||
void captureEvent(Capture cam) | |||
{ | |||
cam.read(); | |||
newFrame = true; | |||
} | |||
void draw() | |||
{ | |||
if (newFrame) | |||
{ | |||
newFrame=false; | |||
image(cam,0,0,width,height); | |||
img.copy(cam, 0, 0, cam.width, cam.height, | |||
0, 0, img.width, img.height); | |||
fastblur(img, 2); | |||
theBlobDetection.computeBlobs(img.pixels); | |||
drawBlobsAndEdges(true,true); | |||
} | |||
count = theBlobDetection.getBlobNb(); | |||
println(count); | |||
} | |||
</source> | |||
[[File:codeProcessing2.jpg]] | [[File:codeProcessing2.jpg]] |
edits