January 18, 2013

Michael Scott Today

 I was bored, so I made a new Twitter account: @MScottToday.  It's about plot points that would exist if Michael Scott were still on The Office.

Check it out!

December 14, 2012

Using ImageJ in Your Own Application



One of the coolest things I've gotten to do at my current job is image analysis and feature extraction.  The goal of one of our projects was to isolate single fly embryos from images taken from labs.  Doing it is pretty simple and requires very little advanced mathematics, but to do it well, it takes some advanced pixel manipulation.

The Requirements
The Solution
An Example

  1. Make the image grayscaled.
  1. Apply a threshold on it to only get the dark areas. This assumes the lines will always be near black.
  1. Apply a Particle Analyzer to find Ellipses on the image.
  1. Loop through the "Particles" to find ones that fit our criteria.
  1. Get the angle from our Particle.

The major requirement was that the application be available on Mac, Linux, or PC; thus, we chose Java as our language.  Likewise, all components of the application needed to be in Java. 

Before I had arrived to the group, someone had already rewritten some MATLAB code that was able to extract embryo images from laboratory photos; and so the first step was that the Java code be able to reproduce the results from the MATLAB code.  Originally, we had investigated the possibility of simply using the MATLAB code and distributing that, but not every one has MATLAB (especially with its price tag).  We then found out about a MATLAB to Java compiler that did little more than just wrap the MATLAB code in a class; in fact, you still needed to have the MATLAB environment running, and on top of that, you needed to recompile the Java code for all platforms you wanted to distribute the application on.  It was a horrible mess, so we quickly dismissed MATLAB as the means of distributing the code, and thus, it was agreed that all MATLAB code would need to be rewritten in Java.

With all this in mind, we decided to go with ImageJ.  ImageJ is a Java application that focuses on image analysis and processing.  Since it was already written in Java, we didn't need to write very much on our own.  All we needed to do was download the application, read the license, and use the ij.jar file in our application.  The documentation is pretty good online for the library as well.

http://stackoverflow.com/q/11461910/759316

The question was asked "How do I get the angle of these black bars?"
120 degrees image


In the link above, you can see the actual code and solution to this question that works the following way:


How the code works:
  1. Make the image grayscaled.
  2. Apply a threshold on it to only get the dark areas. This assumes the lines will always be near black.
  3. Apply a Particle Analyzer to find Ellipses on the image.
  4. Loop through the "Particles" to find ones that fit our criteria.
  5. Get the angle from our Particle.


December 12, 2012

Joined YouSayToo

I just rejoined YouSayToo and I'm really fucking confused as to what it is supposed to be.  From a first glance, it looks like it has something to do with blogs; but I'm really not sure.  It feels like StumbleUpon without the fun.  At least StumbleUpon has some cool websites once and a while; you know, if you feel like clicking "Stumble" one hundred and one times.

What ever, here's my referral link or something.  I'm not exactly sure what the fuck it does.  Something about boosting ranking or something.


November 16, 2012

Twinkies Reborn

The company, Hostess, that owns and produces Twinkies has declared bankruptcy and will liquidate its assets.  For those who do not know about business, this does not mean the end for Twinkies.  When the company sells its assets, it sells it trademarks and recipes, including the Twinkie trademark.  The highest bidder will get the rights to the Twinkie trademark and will continue to sell Twinkies.

If I remember correctly, this is actually how Hostess got the rights to Twinkies in the first place.