Suggestions please? :)
in
Programming Questions
•
2 years ago
Hi,
I am working on this project for school. It is pretty much working and doing what I want it to do but I thought I would post it here to ask for any suggestions of how I could improve it. This is pretty much my first project so I'm sure there are plenty of things that I could have written differently that might work better. I am in a painting class and this program is going to use a camera to capture my classmates motions/color and then project them onto a blank canvas so they will be creating their own painting with their movements(and creating my painting assignment for me! haha). I plan to have paintbrushes spray painted in different colors available so they can draw in the color that they want. The image gradually resets itself to white when there is no motion. Any suggestions at all are very much appreciated! Also, I am wondering if anyone has suggestions for how I could add sound? I want there to be sound only when there is motion.
Thanks very much.
Oh, and also- how do I flip the final image so it is like a mirror? thanks!!!!
I am working on this project for school. It is pretty much working and doing what I want it to do but I thought I would post it here to ask for any suggestions of how I could improve it. This is pretty much my first project so I'm sure there are plenty of things that I could have written differently that might work better. I am in a painting class and this program is going to use a camera to capture my classmates motions/color and then project them onto a blank canvas so they will be creating their own painting with their movements(and creating my painting assignment for me! haha). I plan to have paintbrushes spray painted in different colors available so they can draw in the color that they want. The image gradually resets itself to white when there is no motion. Any suggestions at all are very much appreciated! Also, I am wondering if anyone has suggestions for how I could add sound? I want there to be sound only when there is motion.
Thanks very much.
Oh, and also- how do I flip the final image so it is like a mirror? thanks!!!!
- import hypermedia.video.*;
OpenCV opencv;
PImage trailsImg;
float threshold = 80f;
void setup() {
size( 800, 600 );
// open video stream
opencv = new OpenCV( this );
opencv.capture( 800, 600 );
trailsImg = new PImage (800, 600);
}
void draw() {
opencv.read(); // grab frame from camera
//image( opencv.image(), 0, 0); // show the original image
PImage camImage;
opencv.absDiff(); // make the difference between the current image and the image in memory
filter(INVERT);
camImage = opencv.image();
opencv.blur (OpenCV.BLUR, 3 );
//opencv.threshold (20);
trailsImg.blend( opencv.image(), 0, 0, 800, 600, 0, 0, 800, 600, SCREEN);
image( trailsImg, 0,0 ); // display the result
filter(INVERT);
opencv.copy (trailsImg);
opencv.blur (OpenCV.BLUR, 4 );
opencv.contrast (0);
opencv.brightness (-2);
trailsImg = opencv.image();
opencv.remember(); // store the actual image in memory
}
void keyPressed() {
}
1