I've done this before. And it doesn't use any libraries, it's quite simple.
First off you need a specific color for your background. One which is guaranteed to clash with all visitors. Then you need to examine the change in color of the pixels and draw a line at the highest point. The following code illustrates this principle but examines the pixels on screen. You're going to have to modify it to work with a camera.
To use it with a camera you need to be checking "myCapture.pixels" as opposed to pixels.
Code:
int threshold = 100; // set this higher to make it less sensitive
void setup() {
size(640, 480);
loadPixels();
stroke(255);
}
void draw(){
background(0);
ellipse(mouseX, mouseY, 50, 50);
int y = diffMountain();
line(0, y, width, y);
}
// This method uses XOR to find the difference between two colors
// (At least I think it does)
int diffMountain(){
int peak = height;
int speed = 16;
int [] oldPixels = new int[pixels.length];
arraycopy(pixels, oldPixels);
loadPixels();
for(int y = 0; y < height; y++){
int diff = 0;
for(int x = 0; x < width; x+=speed){
diff += oldPixels[x + y * width]^pixels[x + y * width];
}
if(diff > threshold){
peak = y;
// println(diff); // This line can help you judge what threshold you should be using
break;
}
}
return peak;
}
Notice how the horizontal line only appears when you move the mouse.
Try experimenting with different threshold values, those will help counter the auto-adjust on most webcams.
If you get stuck just ask again.