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 › How to show a portion of a picture/movie
Page Index Toggle Pages: 1
How to show a portion of a picture/movie ? (Read 396 times)
How to show a portion of a picture/movie ?
Nov 27th, 2008, 5:47pm
 
hi

i'm currently trying to make a sketch that will make your face disapear and for this i need to be able to show a portion of a picture/movie instead of the entire picture/movie.

i use the opencv library to track the face http://ubaa.net/shared/processing/opencv/
and the face_detection example as beginning for the code

i'm currently working on it so i can't post my code now but the aim is to take a snapshot of the background and then show a portion of the background following the position of the rectangle made by the face detection


the only way i know to show picture is :

image(img, x, y, width, height)  

but with this i can only specify the size and position of the entire picture.


i think it could work if if could use somekind of alpha mask to hide the part i don't want to see in the picture

if anyone have an idea to help me ? Smiley



Re: How to show a portion of a picture/movie ?
Reply #1 - Nov 27th, 2008, 6:09pm
 
you can use:

PImage tmp=currentFrame.get(xpos,ypos,chunkWidth,chunkHeight);
image(tmp,x,y);
Re: How to show a portion of a picture/movie ?
Reply #2 - Nov 29th, 2008, 6:50pm
 
great !


thank you Smiley
Page Index Toggle Pages: 1