May 7

segment.PNG

Source paper:
Efficient Graph-Based Image Segmentation.
(with Daniel Huttenlocher)
International Journal of Computer Vision, Vol. 59, No. 2, September 2004.
[PDF text]

Project Code:
Rebecca-E-0.10.1.jar
Rebecca-E-0.10.1

segment2.PNG

May 2

This Pipe is a compilation of the JMF examples provided by David Fischer (http://www.mutong.com/fischer/java/usbcam/) and the sun.com.

The Pipe performs fast image capturing from web-camera.
The process contains next steps:

  • Init camera
  • Capture the last frame from a camera to a BufferedImage, put it to the output slot every time you run the Execute() method;
  • Shutdown camera

Shortcoming: provides empty frames for 2-3 seconds after start.

Code:
CameraCapture.java

May 1

There is an example of a simple image processing code.
The process contains next steps:

  • loading image,
  • cloning it,
  • performing some operations with the first copy
  • and showing results on the user screen.

Project files: Rebecca-E-0.9.zip
Project dir: Rebecca-E-0.9
ImageLoaderDialog.java

screenshot:
ss2.png

the pipeline’s scheme:

the pipeline’s code:

package Run;

import java.awt.image.BufferedImage;
import rebecca.e9.core.*;
import rebecca.e9.pipes.*;

public class SimpleImageProcessingPipeline extends PipeLine {

public SimpleImageProcessingPipeline() {
super(“Simple image processing pipeline”);

//Load image—————————————————–
Slot bi = new Slot();
Pipe imageLoader=new ImageLoaderDialog(bi);

//Clone image—————————————————–
Slot bi1 = new Slot();
Slot bi2 = new Slot();
Pipe clone=new ImageClone(bi,bi1,bi2);

//Convert it to vector-function implemented by ObrazC3 (3 channels)
Slot c31 = new Slot();
Pipe convert2obrazC3=new Image2ObrazC3(bi1,c31);

//Do some code we provided in our “DoSomeImageOperations” pipe—
Slot c33 = new Slot();
Pipe MyTestPipe=new DoSomeImageOperations(c31,c33);

//Convert image back———————————————
Slot ib = new Slot();
Pipe C2=new Obraz2Image(c33,ib);

//Plug in user screen to see the results————————–
Pipe S=new Screen(“After”,ib);
Pipe D=new Screen(“Before”,bi2);

//Register all pipes———————————————-
this.registerPipe(imageLoader);
this.registerPipe(clone);
this.registerPipe(convert2obrazC3);
this.registerPipe(MyTestPipe);
this.registerPipe(C2);
this.registerPipe(S);
this.registerPipe(D);

}
}

image processing code:

package rebecca.e9.pipes;

import rebecca.e9.core.*;

public class DoSomeImageOperations extends Pipe {

private ObrazC3 tempO1=null;
private ObrazC3 tempO2=null;
private Slot in;
private Slot out;

public DoSomeImageOperations(Slot input,Slot output) {
super(“Image Processing…”);
if (input!=null&output!=null)
{
this.in=input;
this.out=output;
this.registerInSlot(input);
this.registerOutSlot(output);

}else{this.setDamage();}

}

public void Init() {
}

public void ShutDown() {
}

public void Execute() {

tempO2 = in.GetDATA(this);

int H=tempO2.getHeight();
int W=tempO2.getWidth();
tempO1 = new ObrazC3(H,W);

char r=0;
char g=0;
char b=0;
char w=0;

for(int i=0;i
for(int j=0;j

r=tempO2.getR(i, j);
g=tempO2.getG(i, j);
b=tempO2.getB(i, j);

tempO1.setR(i, j, 255-r);
tempO1.setG(i, j, 0);
tempO1.setB(i, j, (g+b)/2);

}}

this.out.PushDATA(tempO1, this);

}

}