Thursday, March 12, 2009

Object Classification (Actual Image Segmentation)

Deciding which class (or label) each object belongs to is simple a matter of comparing the results of the Dirichlet equation for each and every pixel in the image.

For each pixel in the image, the Dirichlet equation is implemented n times, once for each of the n user-provided labels. The results of each pixel for each label are then stored in n arrays and then a comparison must be made. Each pixel is cross checked across each of the arrays (i.e. pixel 2x3 will be compared with every other pixel at location 2x3 in the rest of the arrays). A new array will then be created which will contain the highest value of each pixel from all of the arrays (i.e. the highest of all the 2x3 pixels and the highest of all the 4x8 pixels, etc). This array will be the segmented image, or will be the mask of the segmented image.

Thursday, March 5, 2009

Segmentation From 2D to 3D

Using a 2D image, the image is represented initially as a MxN matrix (which is then converted to a (MxN)x(MxN) Laplacian matrix). Each node is connected to the node above it, below it, to the right of it, and to the left of it. These connections are provided using weighted edges. The ultimate representation looks like a grid.

Taking this to the 3D realm, we simple represent the initial image using a MxNxL matrix (which is then converted to a (MxNxL)x(MxNxL) Laplacian matrix).  Each slice of the image would be 1 MxN slice and the entire 3D image would have L slices, again, each consisting of MxN nodes. Each node would then be connected to the node above it, below it, to the right of it, to the left of it, and now, to the front of it and behind it. These connections, again, would be provided using weighted edges and the the would be weighted using the same formula as the 2D image. 

Using this concept, converting a Random Walker algorithm to accomodate 3D images is pretty easy since all that would have to be done is adding MxN matrices to the originally MxNx1 matrix to eventually have an MxNxL matrix; and also adding more edges to each node. 

Again, all the same formulas for the 2D image segmentation would still be applicable.