We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpVideo Capture,  Movie Playback,  Vision Libraries › Trying to move image of blob x and y. Help req
Page Index Toggle Pages: 1
Trying to move image of blob x and y. Help req (Read 474 times)
Trying to move image of blob x and y. Help req
Nov 17th, 2006, 12:36am
 
I'm moving on thin ice here so any help is _so_ welcome:) What I'm trying to do is to get lupe.jpg's x and y repeatedly at the blobs x and y. Here are the code:

import processing.video.*;
import blobDetection.*;

Capture kamera;
BlobDetection klattSok;

void setup()
{
 size(320, 240);
 background(255, 255, 255);

 kamera = new Capture(this, 80, 60, 10);
 klattSok = new BlobDetection(kamera.width, kamera.height);
 klattSok.setPosDiscrimination(false);
 klattSok.setThreshold(0.5f);

}

void draw()
{
 kamera.read();
 klattSok.computeBlobs(kamera.pixels);

 tegnLupe();
}

void tegnLupe()
{
 Blob klatt;
 float lupeX = 0, lupeY = 0;
 PImage lupe = loadImage("lupe.jpg");

 for(int v=0; v<klattSok.getBlobNb(); v++)
 {
   klatt = klattSok.getBlob(v);
   klatt.x = lupeX;
   klatt.y = lupeY;
   image(lupe, lupeX, lupeY, lupe.width, lupe.height);
   redraw();
 }
}

End of code. The code consists of some borrowing from the blobDetection_webcam example. I think I didn't understood every aspect. Needless to say, it doesn't work:/ I'm new at this so break it down easy please. Thanks!
Page Index Toggle Pages: 1