Problem exporting images to the web
in
Contributed Library Questions
•
2 years ago
Hi everyone.
I'm currently writing a simple Processing app that envolves people sharing their faces and then sending the results to the web.
To simplify, here's the code. Give it a try if you're not understanding the concept:
So the program is working exactly how I want it to. People go and click the mouse at a time with their partner and mix up their faces with different expressions. The result is quite interesting.
At the same time, I'm using postToWeb library so that I can send online to my server all the images (print-screens from the sketch) that people generate while using the application.
The problem is that it copies the entire image (the one from the video stream) and the result composed by the 2 parts. Any way, using this library, to only copy the area corresponding to the lower image (with both parts)?
Another problem is that I'd like to automate the insertion of these resulting images on a webpage. The only thing is that I don't know how to do that. My idea is a very simple page where the images generated are posted one after the other without great concerning about design.
Thank you for reading.
João
I'm currently writing a simple Processing app that envolves people sharing their faces and then sending the results to the web.
To simplify, here's the code. Give it a try if you're not understanding the concept:
- import org.seltar.Bytes2Web.*;
import hypermedia.video.*;
OpenCV opencv;
int i=0;
void setup()
{
size(640,710);
smooth();
opencv = new OpenCV(this);
opencv.capture(420,340);
PImage b;
b = loadImage("fundo_processing2.jpg");
background(b);
}
void draw()
{
opencv.read();
image(opencv.image(),110,10);
line(320, 10, 320, 350);
}
void mousePressed()
{
i=i+1;
println(i);
if(i%2==0)
{
copy(320,10,210,340,320,360,210,340);
}
else
{
copy(110,10,210,340,110,360,210,340);
}
}
void keyPressed()
{
String url = "http://joaocunha.alojamentogratuito.com/anotherself/Upload.php";
if ( key == 'j')
{
ImageToWeb img = new ImageToWeb(this);
img.save("jpg",true);
img.post("test",url,"jpg-test",true,img.getBytes(g));
}
}
So the program is working exactly how I want it to. People go and click the mouse at a time with their partner and mix up their faces with different expressions. The result is quite interesting.
At the same time, I'm using postToWeb library so that I can send online to my server all the images (print-screens from the sketch) that people generate while using the application.
The problem is that it copies the entire image (the one from the video stream) and the result composed by the 2 parts. Any way, using this library, to only copy the area corresponding to the lower image (with both parts)?
Another problem is that I'd like to automate the insertion of these resulting images on a webpage. The only thing is that I don't know how to do that. My idea is a very simple page where the images generated are posted one after the other without great concerning about design.
Thank you for reading.
João
1