Home

I have used blur function of OpenCV with Processing to create an art work called blur
Here is the code to the artwork


import fullscreen.*;
import hypermedia.video.*;
OpenCV opencv;
FullScreen fs;
PImage camImage;
PImage trailsImg;
int hCycle;

void setup()
{

size( 640, 480 );

opencv = new OpenCV( this );
opencv.capture( 640, 480 );
trailsImg = new PImage( 640, 480 );
fs = new FullScreen(this);
//fs.enter();
hCycle = 0;
}

void draw()
{

opencv.read();
camImage = opencv.image();

opencv.absDiff();
opencv.convert( OpenCV.GRAY );
opencv.blur( OpenCV.BLUR, 3 );
opencv.threshold( 20 );

trailsImg.blend( opencv.image(), 0, 0, 640, 480, 0, 0, 640, 480, SCREEN );

colorMode(HSB);
tint(color(hCycle, 255, 255));
image( trailsImg, 0, 0 );
noTint();
colorMode(RGB);

blend( camImage, 0, 0, 640, 480, 0, 0, 640, 480, SCREEN );

opencv.copy( trailsImg );
opencv.blur( OpenCV.BLUR, 4 );
opencv.brightness( -20 );
trailsImg = opencv.image();

opencv.remember();
println (frameRate);
hCycle++;
if (hCycle > 255) hCycle = 0;
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s