OPENCV diffent blur values in one sketch
in
Contributed Library Questions
•
9 months ago
hello everybody,
i´m new to processing, i´ve done a few things but there is still alot i often don´t understand or get to work.
i wonder if or how it is possible to have two objects in a sketch which will blur in a different way by using opencv.
first if tried this:
...and later i found the allocate statement and tried the following, but i don´t get it to work.
it always just uses the lowest blur value.
can you explain me how to use the allocate statement right or maybe another way to have multiple images in a sketch that all blur in a diffent value.
thanks alot, stefan
i´m new to processing, i´ve done a few things but there is still alot i often don´t understand or get to work.
i wonder if or how it is possible to have two objects in a sketch which will blur in a different way by using opencv.
first if tried this:
- import hypermedia.video.*;
OpenCV opencv,opencv2;
void setup(){
size( 1200, 1600 );
opencv = new OpenCV(this);
opencv2 = new OpenCV(this);
}
void draw(){
float myVar = mouseY;
myVar= map(myVar,0,1200,0,60);
opencv.loadImage("mein_zimmer1_nachvorn_00.png");
opencv.blur( OpenCV.BLUR, 50);
image( opencv.image(), 0, 0 );
opencv2.loadImage("mein_zimmer1_NURvorn_00.png");
opencv2.blur( OpenCV.BLUR, int(myVar));
image( opencv2.image(), 0, 0 );
}
...and later i found the allocate statement and tried the following, but i don´t get it to work.
it always just uses the lowest blur value.
- import hypermedia.video.*;
OpenCV opencv,opencv2;
void setup(){
size( 1200, 1600 );
opencv = new OpenCV(this);
opencv.allocate(width,height);
opencv2 = new OpenCV(this);
opencv2.allocate(width,height);
}
void draw(){
float myVar = mouseY;
myVar= map(myVar,0,1200,0,60);
opencv.loadImage("mein_zimmer1_background_00.png");
opencv.copy("mein_zimmer1_background_00.png");
opencv.ROI( 550, 300, 200, 500 );
opencv.blur( OpenCV.BLUR, int(myVar) );
image( opencv.image(), 0, 0 );
opencv2.loadImage("mein_zimmer1_background_00.png");
opencv2.copy("mein_zimmer1_background_00.png");
opencv2.ROI( 250, 300, 200, 200 );
opencv2.blur( OpenCV.BLUR, mouseY );
image( opencv2.image(), 0, 0 );
}
can you explain me how to use the allocate statement right or maybe another way to have multiple images in a sketch that all blur in a diffent value.
thanks alot, stefan
1