Research Log of Web Science Students

Computer Science is not simply programming

try and try until it’s inverted!

leave a comment »

After our thesis presentation, we we’re given an ulitmatum.. TO INVERT THE IMAGE BY MONDAY. O_o

So right after the presentation, we started searching for possible (and efficient way) to invert our webcam capture. We were very worried that this can make our program slower since every time we capture an image, it must undergo an inversion.

First option was Java Advanced Imaging (Sir Rom’s suggestion)

The Java Advanced Imaging API (JAI) provides a set of object-oriented interfaces that supports a simple, high-level programming model which allows images to be manipulated easily in Java applications and applets

JAI can invert an image with a single command

 PlanarImage output = JAI.create("invert", input);

We just have to convert the PlanarImage to BuffereedImage and then paint it to our screen.  BUT for some irritating reason, we can’t make JAI work with eclipse. We have already installed the JRE and JDK for JAI, set the environment variables and made sure that eclipse library contains jai_codec.jar, jai_cor.jar and mlibwrapper_jai.jar. It still won’t work.

Second Option was to convert the image manually using java2d. We found a code to invert a BufferedImage in http://www.gidforums.com/

This code would have work fine if our BufferedImages were initialize to TYPE_BYTE. But all our BufferedImages are of type_int.

BufferedImage.TYPE_INT_ARGB

We’ll try to work around this.

And finally..

Third Option was to get our webcam capture’s reflection. Got this idea from http://www-rohan.sdsu.edu. Dr.Mahmoud Tarokh’s CS599 — Chapter 3:Image Manipulation and Enhancement

Reflection: This operation can be performed in place by reversing the ordering of pixels in the row or column. The reflection of the image f(x, y) about x = w/2 axis, where w is the width of the image.

Hopefully, this method will work.

Advertisements

Written by izelderamos

November 24, 2009 at 3:03 am

Posted in EEG

Tagged with , ,

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: