|
» codelab : http://codelab.fr/accueil » Forum : openFrameworks : http://codelab.fr/openframeworks » Webcam effet miroir : http://codelab.fr/2467 Ceci est la version imprimable d'un sujet du forum, pour retourner à la version complète : Webcam effet miroir |
| matthieu — 2011-05-14 13:03:27 |
Salut à tous, void testApp::update(){
vidGrabber.grabFrame();
if (vidGrabber.isFrameNew()){
unsigned char * pixels = vidGrabber.getPixels();
for(int j = 0; j < camWidth; j++){
for (int i = 0; i < camHeight*3; i++){
videoInverted[i*camWidth+j*3] = pixels[((camWidth - (j*3-1)) + i*camWidth)];
//c'est ici qu'il manque un petit quelque chose
}
}
videoTexture.loadData(videoInverted, camWidth,camHeight, GL_RGB);
}
}Avis avisés bienvenus;) |
| cdriko — 2011-05-14 17:11:27 |
hello |
| cdriko — 2011-05-14 17:14:01 |
rectification |
| matthieu — 2011-05-16 14:01:26 |
Merci pour ton aide mais j'ai besoin de faire le *3 et c'est là qu'est la difficulté. |
| Honkytong — 2011-12-04 23:29:47 |
Il y aura toujours des gens pour réinventer la roue.... |
| Honkytong — 2011-12-04 23:33:05 |
Mille excuses je pensais que c'était sur Processing... |
| matthieu — 2011-12-05 11:23:28 |
Y'a pas de mal ;), |
| Turboconnard — 2012-01-13 21:01:36 |
Bonsoir, |
| Makio135 — 2012-01-13 23:43:18 |
Encore une technique P5 mais sûrement transposable et sans manip de pixel: |
| matthieu — 2012-01-16 18:57:35 |
Ok, merci, j'ai pas le temps d'essayer pour le moment mais dès que je peux, je vous tiens au courant. |
| cgiles — 2012-02-21 11:21:21 |
as tu regarder si il n'y a pas sur ce site ce qu'il te faut ? |
| matthieu — 2012-02-21 16:10:54 |
Bonne idée, |
| cgiles — 2012-02-22 07:57:31 |
et les wrapper opencv, ils ne possèdent pas la fonction mentionner plus haut ? |
| cgiles — 2012-02-23 14:52:22 |
Je suis tombé la dessus en cherchant un tuto pour débutter openframework en parralèle de ma découverte du c++ |
| matthieu — 2012-02-24 16:25:23 |
Super, merci beaucoup :) void testApp::update(){
vidGrabber.grabFrame();
if (vidGrabber.isFrameNew()){
unsigned char * pixels = vidGrabber.getPixels();
for(int i = 0; i < camHeight; i++){
for (int j = 0; j < camWidth*3; j+=3){
int pix1 = (i*camWidth*3) + j;
int pix2 = (i*camWidth*3) + (j+1);
int pix3 = (i*camWidth*3) + (j+2);
// mirror pixel number
int mir1 = (i*camWidth*3)+1 * (camWidth*3 - j-3);
int mir2 = (i*camWidth*3)+1 * (camWidth*3 - j-2);
int mir3 = (i*camWidth*3)+1 * (camWidth*3 - j-1);
// swap pixels
videoInverted[pix1] = pixels[mir1];
videoInverted[pix2] = pixels[mir2];
videoInverted[pix3] = pixels[mir3];
}
}
videoTexture.loadData(videoInverted, camWidth,camHeight, GL_RGB);
}
}Si tu veux je suis tombé dernièrement sur de chouettes tutos pour openframeworks, dont un pour débuter et un très complet sur openCv : |