![]() ![]() Here's my problem: I don't want it to work with my built-in webcam, but with a PS3 EYE cam.Īpparently, PS3 EYE only works on Processing 1.5. Translate to the location, set fill and stroke, and draw the rect Calculate a z position as a function of mouseX and pixel brightnessįloat z = (nbPixelsBlancs / (float(width)) * brightness(img.pixels)/-800) įloat w = (nbPixelsBlancs / (float(width)) * brightness(img.pixels)/-5000) Int loc = x + y*img.width // Pixel array locationĬolor c = img.pixels // Grab the color Int y = j*cellsize + cellsize/2 // y position Int x = i*cellsize + cellsize/2 // x position ![]() py(video,0,0,video.width,video.height,0,0,video.width,video.height) // Before we read the new frame, we always save the previous frame for comparison! Save previous frame for motion detection!! Rows = img.height / cellsize // Calculate # of rows Img = loadImage("fougeres.jpg") // Load the imageĬolumns = img.width / cellsize // Calculate # of columns PrevFrame = createImage(video.width,video.height,RGB) Int largeur,hauteur,largeurInit,hauteurInit,echelle=1,nbPixelsBlancs=0,nbPixelsNoirs=0,saut=10 Int columns, rows // Number of columns and rows in our system Int cellsize = 2 // Dimensions of each cell in the grid I managed to get my first code to work (written on Processing 2.1.1): it detects motion via my mac built-in webcam, and applies a reverse-explode effect on an image. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |