Monday, August 29, 2011

Document done

So I cleaned up the document a little. I decided mainly to skim the important details of the blog and the current program rather than have a near-replica of the blog.

I fixed a few of the bugs that were found in the program (context menu opens on right click dragging while joining, etc.)

and I have now started the presentation; will be recording the program in use and possibly ImageJ as well to show the differences in the amount of time they take and the differences in how to actually segment and measure the items.

Tuesday, August 23, 2011

Program and Help Doc completion

I think now the program is in a stage of completion. Or it is very close, I have no troubles with it; it works quickly and functions well. With less than a week left to work on it I may tackle the last few remaining implementations.

I have saved a copy of the program in this state and it's also up to date on the SVN as of now.

I'm working on written documentation, and writing a document on the steps taken from the beginning to this step. This document will probably be similar to the blog, but a bit more step oriented and thought out. Covering everything from initial planning stages to the current stage.

I am going to email a copy of the helpdoc zipped so it can be seen without running the program.

Friday, August 19, 2011

Error Handling added

I fixed up some bugs with the program, and added some error handling.

So if an image hasn't been opened and you try to hit "next image" it will report back an error and tell the user that they must open up a directory. If the file that's being opened from the directory isn't an image it gives an error, if the user tries to perform an action and an image hasn't been opened it gives an error.

All the errors are covered in the help document as well.

There is now a button on the program that will open the help file up as well.

Code is on SVN

Wednesday, August 17, 2011

HTML Doc Completed

The HTML doc is now complete. I think it covers everything in the program; but should be simple to change if left out or if the wording is ambiguous.

Fixed a bug where the program was crashing (out of memory) again.

Monday, August 15, 2011

HTML Doc, Split/Join, and Tablet

I have made a few changes.

The HTML doc now is up to date with the changes that were made to the program. Things were reworded to account for the auto-processing that is done. The table now has the new tools in it + the old tools removed (that aren't on the toolbar).

Split and Join has been changed slightly now; the ink canvas now has a different cursor that looks like a pen. In addition when using the stylus, by using the eraser on the stylus you can actually join the diatoms now. i will probably swap this so that split is the eraser, and the pen tip is join. With the stylus the line you are drawing is visible on both split and join. But it is not yet functioning with the right click.

SVN contains this code.

Friday, August 12, 2011

Help Doc - progress bar

New photos, changed background to white and text to black. The window can now be re sized and the HTML re sizes accordingly.

The progress bar functions much better now, a lot less jumpy across the page. It's not perfect though.

the repo has been updated with this code.

Wednesday, August 10, 2011

Progress bar

A progress bar has been implemented to show the user that progress is being made, but the progress bar is a bit jumpy right now. I would really like to smoothen it out at least a little bit.

I'm going to remove the run button and keyboard shortcut and set it to run automatically when an image is loaded. You are also now able to remeasure items to update the data.

So if you forgot to set the species you can now remeasure it with the species added and it will reset the measurement file.

Monday, August 8, 2011

Help file

Started working on the help file again, I will need to do up new images since the program has changed looks (tool bar items deleted, context menu changed). Not much is required I don't think for doing the how to run the program. The steps should be straight forward.

Also going to explain what all the new files are that are created in the directory.

Still looking at the threading for the processing step, I can't see it being difficult to implement. Should be simple to place the component in a thread.

Thursday, August 4, 2011

Identify

Identification now functions when you are zoomed into the image.

Identifying now adds the species to the index list, so when the program is opened all species that you have identified get added to the list. This is per-directory; in addition to the species being added to this list the file also contains properties information (Threshold, red green and blue coefficients for grayscale, the number of pixels per micron, and the blob filtering controls.)

Wednesday, August 3, 2011

Help doc built in

The program now has a built in help documentation which is viewable by pressing Ctrl + H. The documentation is not yet complete.

the context menu was changed, the mouse controls were dropped from it. Likewise the toolbar has also been changed and the buttons to delete, dilate, erode, or measure the blobs has been removed.

an addition to the context menu includes identifying the species of the blob. Instead of left clicking a blob to identify it's species you now right click it in the same fashion as other functions. The tap is still implemented for the tablet control.

Friday, July 29, 2011

Context Menu

The context menus zoom now functions (custom value zoom). There is also a button that will put you right to 100%.

I think the context menu is complete now. There may be a few required changes for it.

Program

Help file has been started as a office (Open Office) file. I am thinking that an HTML file may be easier to use, and easier to show the images and descriptions then the Open Office file can.

The context menu has been simplified and now has an added menu for a custom level of zoom (X %). Although the custom level input isn't yet functioning.

Fixed a bug with the image saving. The "Holes Filled" image was incorrect, and was the same as the labeled image.

Next things to work on aside from fixing up the previous problems, and continuing the help file is redo functionality.

Thursday, July 28, 2011

more implemented

When the program has completed running it now automatically overlays the image.

Program filters files from the open dialog. Two settings:

(Image Files - JPG, BMP, TIF, GIF, PNG)
(All Files)

Measurements setting was added.

[         ] pixels per micron.

Default value is set to 9.064

The context menu is partially functioning. You can right click on the image to open a menu and switch modes from there, zoom in or out, and delete, erode, dilate, or measure blobs.

Next:

Make the context menu work better
Add a zoom factoring item (100%, 200%, ...)
Help system - with graphical walkthroughs, etc.

Monday, July 25, 2011

update, more implementations + more to do

 List of items in the system. [!] is things being worked on [*] is completed.

 * Show current filename being edited and the index in the list [*]
 * Visible ruler on the bottom of the image shows the scale
 * Filter files in the open dialog [!]
 * Automatically set the viewing to X% opacity and current/original images once processed. [!]
 * Remove the dropdown on the top right [*]
 * Add scrollbars for when you are zoomed in.
 * Zoom scale in a dropdown box - 100, 200, 300, 50, etc.
 * Measurements - allow the user to set the pixels/measure (100px/1nanometer)
 * Add separators, logically group the buttons. [*]
 * Save user settings - properties, window size, etc.
 * Help system
 * Put processing step in worker thread and invoke when opening an image.
 * Gesture control while zoomed in or out. [*]
 * Save the state of each image into the directory so each image can be reproduced. [*]
 * Some gestures to be implemented with shortcuts. [*]
 * All gestures to be implemented with toolbar buttons. [*] make all toolbar buttons actually function (add keyboard shortcuts for new toolbar buttons as well [*]) [!]
 * Use altkey controlling for zooming [* control] and moving the image [* Ctrl + Alt]. [use shortcuts for zoom/unzoom as well [*]].
 * Create a single CSV text file in the main directory which will contain tab and line separated data for all measurements made from all images. [*]
 * Allow user to view blob details in the program.
 * Making user controls better[*]
 * Splitting while zoomed in. [*]
 * Ink Canvas remains the same at all times (Doesn't change location or size) [*]
 * Speed on (larger?) images - if the issue is this [*]
 * Opening a directory to where you left off [*]

Friday, July 22, 2011

More improvements and more bugs!

The program has had many new improvements fully implemented the past few days.

- zooming in and out is finally -fully- working for splitting and joining in all situations. You can zoom in, zoom out, translate and the splits and joins are still correctly aligned on the bitmap from the ink canvas.

- zooming in and out functions for deleting blobs, you can delete blobs while zoomed in or zoomed out. This is not functioning for any other gestures (erode dilate etc.).

- Icons are now implemented and some of the tool tips have been added. Zoom in and out now have buttons. Additional buttons will be erode, dilate, delete, measure.

- Window now resizes along with he aspect ratio so there is no white space on the sides of the image.

- Tablet works for all usable tools.

- Tablet buttons (set up in windows tablet control) - can do zoom in and out, and switch between the three modes (gesture, split, move). The tablet buttons by default are "not an actual key on the keyboard (2 of these), Left Control, System, Left Shift" so I changed them in the tablet properties menu.

I think that's everything.

Next:

More icons for tools, remove unused icons/buttons if required, erode, dilate and measure to function with zooming features.

Wednesday, July 20, 2011

WPF Completed from previous list.

 * Some gestures to be implemented with shortcuts.
 * Use altkey controlling for zooming [* control] and moving the image [* Ctrl + Alt]. [use shortcuts for zoom/unzoom as well [*]].

Completed with some tools. Others will be added a long with the toolbar.

Undo - Ctrl + Z
Redo - Ctrl + Y [NYI]
Gesture Control - Ctrl + G
Split/Join - Ctrl + X
Move Image - Ctrl + Alt
Zoom in = Ctrl + +
zoom out = Ctrl + -


* Create a single CSV text file in the main directory which will contain tab separated data for all measurements made from all images. [*]

Creates it in the same directory as the "index.txt" file.

Will be meeting with the user on friday to look for more things to better implement.

I did find a new bug when it comes to splitting and joining with the zoom feature. Because the system keeps it in the aspect ratio there is sometimes some white space on the sides/top and bottom. This can't be there for split to work when zoomed in or transitioned. I'll be working on translating back by the amount of whitespace that is there. Just trying to figure out how to calculate that value.

Next things I would like to work on and finish:

 * Allow user to view blob details in the program.[!]
 * Save the state of each image into the directory so each image can be reproduced. [!]

Tuesday, July 19, 2011

Update of new things to implement

 * Put processing step in worker thread and invoke when opening an image.
 * Save the state of each image into the directory so each image can be reproduced.
 * Some gestures to be implemented with shortcuts.
 * All gestures to be implemented with toolbar buttons.
 * Use altkey controlling for zooming and moving the image. [use shortcuts for zoom/unzoom as well].
 * Create a single CSV text file in the main directory which will contain tab separated data for all measurements made from all images.
 * talk with user to see what controls are bad/hard to use
 * Allow user to view blob details in the program.

For the viewing of blob details in the actual program I want to look at various ways. I don't think having them directly written over the image is a good idea (maybe a properties menu under the toolbar). I think there should be a way to indicate which blob is being viewed in the properties menu preferably by indicating the color of the blob. I think that would be simpler to implement and would not interfere with the bitmaps.

Monday, July 18, 2011

Zooming now works entirely.

Splitting and joining while zoomed in now works entirely, with no bugs and misalignment's while doing many different zoom and translation functions. The image realigns whenever you zoom in or out.

Some of the exception handling has been added.

Going to implement the info that gets placed on the blobs (measurements) next.

Thursday, July 14, 2011

Next to complete

So I am posting now to cover what is next to complete in the program. There are still a few minor bugs to do with the zoom/translation/resizing feature and splitting and joining the image.


 * Making user controls better
 * talk with user to see what controls are bad/hard to use
 * Lower amount of buttons on the screen
 * Fix bugs
 * add exception handling
 * Allow user to view blob details in the program.
 * Splitting after translations - unzooming etc.
 * Tapping on the screen to indicate which blobs not to delete (Delete everything not intersecting a point)

Lots of these are to make the program easier to use, and run better. Things that will be useful for the program but require some amount of recoding and design are.

Erosion and Dilatation bug

at this time no other bugs jump out at me, but most new stuff is refining the design

Tuesday, July 12, 2011

Zooming

The zooming and translating now works with the cutting. There are a few times when it bugs out and an offset occurs. I noticed this occurs when you try moving the image (but it doesn't move). So part of the "move the image" code is run which translates my current position, and the other part which actually moves the image isn't. Even though they are in the same code block.

Working on figuring out how to fix this issue.

Monday, July 11, 2011

zoom

Can now cut while zoomed in correctly. You have to actually orient the image at the 0,0 location at this time. When the image zooms in it is automatically zooming into the origin (Center of the screen); so this throws off the translations.

So I am trying to think of how to figure out the translation from the origin to the corner of the imaging panel. This way I can use that distance to know how much I have moved (from the start).

Friday, July 8, 2011

WPF

Speed is now fixed on the images, splitting works fine on them.

all overlay issues are fixed.


Next problem that I want to get fixed is allowing splitting while zoomed in/translated. I think this is the most important item at this moment.

Wednesday, July 6, 2011

WPF

The program only crashes under one situation now (when you are deleting items). It appears to happen somewhat at random while deleting.

Doesn't crash at any other time (ran through, and cut out and measured diatoms in 16 images) before deleting multiple things on the screen and having it crash.

Tuesday, July 5, 2011

WPF

Worked out the overlaying issues, and most of the previous bugs. The program does not crash as much as previous. Runs quickly. Still a few weird things to work out with the overlay, such as editing the image while overlay is on. Plus there are still some problems with editing the image while zoomed in.

These are what I'm working on now.

Thursday, June 30, 2011

WPF

A few new bugs have popped up but some have been fixed.

Program can now cycle through a directory next/back and run on each item. Infrequently crashes (at random) due to Generic Error in GDI+, COM Dead Lock, or Argument Exceptions.

Trying to pinpoint why this is.

Tuesday, June 28, 2011

WPF

Lots of bug fixes. It appears all memory managing has been fixed. The program only crashes for Argument exception when the bitmap is -somehow- blank/full of errors. Or the generic error occurring in GDI+.

On one occasion the program crashed due to a COM deadlock.

The program now creates a directory, and in it places the final processed image. Text files for measurements made along with a JPG/thumbnail of what the blob looks like in the original imaged named in a unique way which can always be converted back to the blob found.

Monday, June 27, 2011

Zoom and panning works

You are able to zoom and pan the image, but using the splitting / gestures on diatoms that you have zoomed into doesn't work yet.

When you zoom in you can still use the overlay, and view the original image, etc.

User had a hard time with gestures (on the tablet) but said that they would get used to the controls, Everything functions to what is needed. But it erases some smaller diatoms that they would need (by default). So I have lowered the default min blob width/height.

Wednesday, June 22, 2011

WPF

Program save button removed - On measure, the program will automatically save a thumbnail of the diatom.

Perimeter works (Accuracy unknown) - Uses convex hull.

Erosion and Threshold functions work much better now. Still bugs with overlapping diatoms currently.

Tried a few different grayscaling algorithms, but none have worked. I tried using histograms (Red, Green, and Blue) to get which there were more of for the normal Grayscale. Still, doesn't function on one entire set of images.

Can now open images after another image has been opened. Program frees unused memory and clears garbage collection. But even with that it still has out of memory errors. There must be something that I am creating that isn't being disposed.

Idea for running on an entire folder of images.

If all the images are similar user can "calibrate" the program on the first image.
-set up the grayscale coefficients, and the threshold that gives the best result.

Then the program can run with this information, placing copies in a folder named after the original (-processed added to the end).

Then the user can do the calculations/actions required on each image. Because the original and new images are both accessible the overlay will still work (but not for Edge Detection, Fill Holes, Grayscale, etc.)

Tuesday, June 21, 2011

WPF

Got some more bugs now. I figured out why they are happening, but I'm not sure about how to go about fixing.

Threshold by selection is completed and functions (you draw a square - gesturewise)

Erode single diatoms functions (bug if blobs are overlapping)

Main bug is that when ever I clone an image (from bitmap source) it gives me an out of memory exception.

Bitmap Source --> Bitmap Image (Clone[Rectangle, Bitmap Image Pixel Format])

I was told this error in C# doesn't necessarily mean Out of Memory. But that you could have an unsupported pixel format (How to fix this I'm not sure)

Monday, June 20, 2011

WPF

Some bugs have returned with implementations/changes.

Threshold by selection is partially implemented. This is done by drawing a square twice (after pressing the threshold button). It then runs the method to perform the threshold calculations.

Eroding is partially implemented as well done by a "down-up" gesture. Possibly implement dilate as the reverse (up-down gesture). I don't think there are any mask tools in AForge itself, so I'm looking at other ways to cut out the blob.

You can identify the species of the blobs on the screen, once identified the program saves the identification. You can quickly drop down to it instead of typing it in every time. (Right now this opens as a new window) I would like to get this so it has a small drop down menu at the mouse. I think that species and genera need to be separated, so I may have two separate lists.

Thinking of

List of Genera

Dictionary of <Genera, List>

Where the list will be the types of species each genera has.

Measurements (Area) works. Perimeter and others to be done up next.

Friday, June 17, 2011

WPF Bug fixes

Fixed all bugs that I could find in the program, memory seems good for the program.

Implemented importance gestures, the gesture (Sometimes) marks things not in the circle which I'm not sure why. As of now when you circle something it saves a single point (at the center of the circle) signifying importance. The program also draws a small marker on it.

With these points I plan on pulling out those blobs right away (Anything not near these points can be automatically considered garbage (?)

For delete gesture, it runs much faster as well (on large blobs) and doesn't crash if drawn across the entire blob (if the blob is large).

Wednesday, June 15, 2011

WPF - Progress

Lots of progress has been made with the current program.

Splitting - Now implemented
Joining - Now Implemented
(There appears to be *some* problems with using the stylus here but the mouse works fine)
Gestures - Delete & Undo - Implemented
Quick gestures to delete the blob that it crosses, or undo something.
 Swapping between images (Original, Grayscale, Edge Detection, etc.) - Implemented
Overlay of two images - Implemented
You can alter the image while overlay is being performed.

Program at this time is much quicker to get to the same area. a button press and a few swipes, and you are done.

Next to be completed:

Threshold by selections (either by point or box)
Important sections - Gesture to signify important objects on the bitmap (before program runs)
Erode - Erode the selected blob
Measurements
Identify

(For future)

Measurements output automatically into a spreadsheet for the python / DB.
Program can run on a large section of images (saving the basic copy it makes) [?] - then the user can run through these images and make the necessary changes/alterations.
Grayscale to work well on all images (find a way to set the coefficients up so that the grayscale gives a better image average - don't run into problems like large chunks of blobs in the middle)
Even more intuitive controls (?)

Monday, June 13, 2011

WPF Continued

Some advances in the program including can now split and join blobs, gestures correctly fire out console messages (but don't do anything else yet).

Left Click - Split
Right Click - Join (While joining the line that you are drawing isn't visible)

I plan on building the viewing of old images, undo list, and overlaying 2 images next. Then will work on making gestures actually execute some code.

Friday, June 10, 2011

New WPF program

So started the new program; I'm trying to make this much more simplified.

There are 5 basic buttons - Open and Save, Gesture Commands, Run the program, and properties.

if no button is selected you will be able to split (by eraser with stylus) or join (by drawing with stylus).

I have the program looking a bit crisper, simplified look (done entirely in XAML via designer).

XAML works quite good for designing the GUI, very useful I found, made changing things very simple.


The properties menu is a new window, which will allow you to set everything from grayscale coefficients to desired threshold values, to blobs filtering widths/heights.



I changed the idea for selecting the threshold to make it even quicker. Not yet implemented, but to allow the user to tap on the screen to set a small box at the location (one in the biggest chunk of foreground, other in biggest chunk of background) then just using a set square size to measure the histograms.

Basic gesture ideas (Diagonal Slash - Delete, < symbol - Undo, Circle - (before program runs important object), X - Erode the object)

I'm not sure about how to erode a single blob though, I'm sure there is some way to do it.

Thursday, June 9, 2011

WPF

Just started reading the textbook "Windows Presentation Foundation - Adam Nathan, Daniel Lehenbauer"

Got further into altering the actual XAML code to make the program look different, integrated changed Bitmap into BitmapSource and back the other way. Still had problems with the "pixel format" giving me errors when trying to perform certain functions in AForge, this ended up fixing itself.

Found a new filter "FillHoles" morphology is no longer required.

Program runs quickly, and shows all the blobs with some blob filtering. There is no human interaction, measuring, etc yet. That will be worked on tomorrow, probably in a newer program to more better design the actual GUI.

Tuesday, June 7, 2011

WPF

It appears you can only get stylus, pressure, other info using WPF. this is what I'm working on learning better since everything works differently). ANN still can't classify even the most simple set ups with the genera data. So this may be because they are unclassifiable like this, or really hard to classify. There are some other functions you can use for the ANN classifier, but I don't really understand what difference any of these make.

WPF looks simple enough, and the tablet works fine and calibrated well on my laptop. Tested using an ink canvas, but I haven't been able to do much. I found a way to open images but they have to be BMP (I see a way to convert them, but I can't find many tutorials on these tools).

Will hopefully learn much more for WPF tomorrow, shouldn't be hard to transfer the program over since it will be the same algorithms and concepts.

Tuesday, May 31, 2011

ANN Works for any file in the right format.

Any file passed to the ANN can be processed in the right format.

Currently the ANN just trains on the file given, then tests on the same file.

XOR works:


Ratio of Area and Perimeter.

Monday, May 30, 2011

ANN (Works only for the testing file I used?)

Cleaned up the testing data to be much more simplified, and now the ANN won't use it. The format of the file is entirely identical, and everything gets set up correctly but it won't run the learner.

Did up some graphs to see distribution







Friday, May 27, 2011

ANN Updated

I gave the program now able to parse the text files and set up the appropriate (array of arrays).

Lots of problems with the text parsing, and the array of arrays. Had no idea how difficult an array of arrays would be vs 2D arrays.

Had trouble with blank lines in the text files (the program still does not like those) or lines with tabs and spaces but no data.

Will have to make sure to have the ANN sent only lines with data on it (No Species)

It gets stuck with an epoch of 16,479.5-- Always, so I'm not sure why this is, or what the difference is.

Thursday, May 26, 2011

C# + ANN

ANN still only does XOR; but now it succeeds at classifying XOR every time, before it would get stuck with an epoch of .25 ~ .6

The ANN itself now actually allows you to change the number of hidden nodes, before it was a set number for the XOR function.

The main program now allows a user to specify a species to a blob, and identify it as being that species. When measurements (soon to be written to a space separated text file) are performed it gives the species name as well.

Small presentation this morning  the readings required were read.

There are still some things about the functionality for the ANN in AForge. I don't fully understand, their tutorials on the ANN class aren't really that helpful for it. I don't know how it will react to such a large data set.

Text file format for ANN is as follows:

Training File---
#Of-Columns #Of-Classes(Species) #Lines
Data
Data
.
.
.

Testing File--- (Actual data that needs to be classified)
#Lines
Data
.
.


I don't know how well ANN will do at classifying, or if it even can (I was thinking only classifying genera (?))

The perimeter may be solvable by taking the area of the "outline" (it appears to be a constant width line) so might be able to divide by some factor instead of dealing with the jumbled up blob points list.

Tuesday, May 24, 2011

ANN, and "Diatom Segmenter"

One bug left to worry about in updating the map with the current bitmap. the current bitmap should change every time it's changed but doesn't appear to.

Program can now let you overlay/blend two images together, but will revert back to the old image when you try to make an alteration (splitting/deletion)

You can now connect two blobs together via the "blob splitter" by using right click instead of left click. just fill in the hole(s).

ANN is started, simple ANN built; using AForges Machine Learning, and Neuro classes. ANN is just an XOR Classifier, where you can adjust the weights of momentum, and learning rate.

GUI using WFA allows all these controls.

It appears (right now) that the classification may have to be put in itself, by the number the program returns. 1.0 = species A, 2.0 = species B, etc.

Thursday, May 19, 2011

Program

Undo added [with button] max of 15 steps back.

Program uses a lot more memory now, especially when the undo list is filled (800 Mb)
Once you perform 15 undos in a row the size drops down to the regular 150-300 Mb

Now have the option to view each step by itself.

Have an overlay option for any step with any other step by some percentage (very slow - doesn't seem to work quite right).

Get blob points gives me a list of all the edge points of a blob. But in no order that makes sense, or makes it easy to measure or even outline the blob. Working on figuring out a way to sort this list.

Tuesday, May 17, 2011

Program Continued

Console now has colors in its output.

Delete button and graphic for it added.
Can delete single blobs (a few bugs here with deleting incorrect blobs) (Center of Gravity)

A blob inside a blob may get deleted by accident.

The program now performs the area measurement (still isn't being correctly modified to microns)

Small other chunks changed, more comments.

Program doesn't appear to have the memory leak anymore but still uses 300 megs of memory when it peaks.

Monday, May 16, 2011

C#

Program now runs much faster for the same results.

You can now decide how you wish for a selected blob to be displayed:

As shown currently (filled in)
Outline only
Original (The original image)

The toolbar buttons have an actual image associated with them.

Code is better commented.


Console outputs useful information about what the program is currently doing.

Thursday, May 12, 2011

More implementation in C#

More has been added to the C# program.

You can now slice apart junk and diatoms. If you slice up junk into small chunks it gets removed.

The objects now get filled in fully, and if you view them with the blob selector it provides an outline of the blob.

Still a few unknown bugs, and the program seems to sometimes crash due to out of memory errors. So I may have a memory leak(?). I try disposing everything I can. But sometimes that causes more errors (Argument Exception) I still get (less often) that a "Generic error occurred in the GDI+"

Wednesday, May 11, 2011

C# + Reading

More work has been completed these past 2 days in c#. The program is coming along nicely. Lots of buggy sections right now but a lot has been fixed. The program now allows the user to click a blob (correctly) and display it larger. This is where a user will split the junk off/circle the diatom (if required).

You can now select to squares to set the value for the binarization.

Will be working on a "Delete" (Stroke - for now a button) that when the user signals that a certain hitbox is full of only junk it is removed from the current set. (Not sure on how to remove a specific blob from the current bitmap at this time)

A current bug is with the clicking to view one blob, if there are any overlapping blobs (by hitbox) no matter where you click, all overlapping segments recursively get put into one large hitbox (or so it seems) these all come up to be viewed larger instead of the one you clicked on. Not sure why this would happen.


Finished reading the Falko-Raven Chapter 1, quite a bit confusing. Maybe tomorrow will help clarify a little more.

Read both papers:
http://plankt.oxfordjournals.org/content/18/3/393.short
http://plankt.oxfordjournals.org/content/25/6/669.short

Seems like this may be useful in a bit, to look at some alterations to the C# program to better segment the image.

Monday, May 9, 2011

C#

Started a better more full application in C#. Does nearly everything the old application does and a little bit more, still some bug fixes to be done. Program is up in the repository.

Program allows the user to select a blob to look at it more closely (this is where the user can split these blobs into more than one blob if need be).

This program doesn't yet perform the measurements.

Friday, May 6, 2011

After finding a C# .NET Library for Image Processing (and more) last night. I had decided to try it out.

.NET Library and source - http://www.aforgenet.com/framework/
Image Processing Lab built with the library - http://www.codeproject.com/KB/GDI-plus/Image_Processing_Lab.aspx

It was very quick and easy to convert between bitmap and save files in C#. Quick example of flow of the test program made.


GUI once opened

Open Image - Normal File Dialog

Binarize by threshold

Filter blobs less than a desired size.


Detect the blobs by color.

Label the blobs' bounding box and show the area the blob has imposed on the original image.

Thursday, May 5, 2011

Measurements Made + JMF and Marvins Framework

Method        -    AREA    PERIM        FERET    F-X    F-Y    F-THETA    MIN-FERET

Python        -   233.129    65.752        19.683    87.820    1.765    93.857    17.166

Java Plugin -    217.050    78.701        20.173    79.545    10.591    163.151    16.680

ImageJ      -    336.494    104.861        30.466    70.278    8.605    162.943    21.498

Actual      -     282.742    60.301        20.122    86.055    23.610    78.936    18.275


The method of using Python seems to be very close to the actual on this particular image.

Python Method -

Convert the image in python to a binary image with a threshold of 128.
Open image into ImageJ and convert to Binary (ImageJ requires inverted colors)
Fill Holes.
Dilate and Erode (for this particular image 3 times each).

There are a few areas where things can vary if you change the numbers (threshold, and dilate and erode). But Python works well (slide-000)

Python was not always the best for other slides, but the less complicated slides (with very little to no junk surrounding the diatom) appear to work best with Python.

Java Media Framework(JMF) and Marvins Framework, don't appear to be useful for this. They have no more tools for use than ImageJ Libraries supply.

Images showing the diatom that was measured for slide-000.


ImageJ

Python

Original

Java Plugin

Wednesday, May 4, 2011

Programming

Finished reading the tutorial documentation for python. Finally found a 64bit version of JIL for python 2.6.

Ran through some of the documentation for that, and got a little ways.

It appears Python is very useful for images, quick short commands to change what you need. I don't know how well anything else will work in python when it comes to trying to measure the images' segmented objects; if it can even segment the objects.

Original Image



Image converted to grayscale, and then converted to binary with a threshold of 128.

im = Image.open("image.tif").convert("L").point(lambda i: i >= 128 and 255 or 0)

Another way of converting to binary/gray scale. Image didn't go all white and black.

im = Image.open("image.tif").convert("1").point(lambda i: i >= 128 and 255 or 0)
Image remained RGB, did the threshold of 128.
im = Image.open("image.tif").point(lambda i: i >= 128 and 255 or 0)


I tried working with JMF, and "Marvin's Framework"

http://marvinproject.sourceforge.net/en/index.html

There is a lot of documentation; it could be useful, will look at getting this set up to use and test.

Built a plugin usable for ImageJ; The plugin doesn't do much other than converting the image to grayscale, finding the edges, and converting that to binary with a threshold of 128.



Java built ImageJ Plugin function ran. See code.


Seems like it's an easy to use utility, documentation is well written for ImageJ.

        IJ ij = new IJ();
        Image i = ij.getImage().getImage();
       
        BufferedImage buffImage = new BufferedImage(i.getWidth(null),i.getHeight(null),BufferedImage.TYPE_BYTE_GRAY);
        Graphics g = buffImage.getGraphics();
        g.drawImage(i,0,0,null);
        g.dispose();
        Image im = buffImage;
        ij.getImage().setImage(im);
       
        ImageProcessor IP = ij.getImage().getProcessor();
        IP.findEdges();
        ByteProcessor BP = (ByteProcessor) IP.convertToByte(false);
        BP.threshold(128);
        ij.getImage().repaintWindow();

ImageJ Harder Image

Here is a run through with the harder image in order. All the junk becomes selected in one large block. Maybe some more can be done at a different step to pull it into smaller chunks.

Original Image

Background added

Image converted to binary.

  
Overlay of the two images

Tuesday, May 3, 2011

Python

Started learning the more advanced stuff in Python to be ready and jump into Python Imaging Library(PIL) to see what can be done with that in means of image segmentation. Just ran through python documentation chapters 1 through 8. Set up Python to work in Eclipse IDE and worked on doing modules (which I had never done).

Used to the syntax now, seems like there may be some usefulness to it. Simplistic data structures that can be used to hold all the images.

More ImageJ

After reading the chapter on binary images in the text book, and trying a few more things in ImageJ I found a process where "adding" a background worked nicely.


Original Image

Image with background added.


Image converted to binary.

Overlay of original and binary image.

Monday, May 2, 2011

ImageJ

I have found a way to build new plugins for ImageJ; I don't know how well this will work with using other Java features at the same time though.

Using a little bit in ImageJ I found that doing certain processes in order does have a positive effect on possibly grabbing at some of the diatoms.

 
Original Image
Image with background removed (Process in ImageJ).
Image with background removed, converted to binary.

Image with find edges process, converted to binary, with holes filled in.
Image with background removed, converted to binary, and holes filled in.




The images still select a lot of garbage, but they select the diatoms as well.

By performing a Gaussian blur and then reconverting to binary you get much more defined blobs.