Tuesday, May 29, 2007

I implemented some preprocessing stuff on the image of the blood sample.

· Threshold

· Filter – Median Filter

Threshold value is decided by taking the average of the pixel values of blood cells provided by the user. Median Filter is used to filter the image after applying the threshold. From that we can remove most of the dust particles and the back ground, but not the air bubbles.

The problem is how to remove air bubbles? Air bubbles are big but have the same pixel values as blood cells.

As Omega suggested, I tried to get the contour areas and remove the bigger ones. But to have them removed I have to get their coordinates or any other method to locate them.

So I took an easier approach. First I dilate the image. This will remove the remaining dust particles. Then I erode the image…

Then only blood cells and air bubbles will remain in the image. So I count contours which have area less than a value which is I get from trial and error. These will be the blood cells. There are some errors though. Some blood cells splits and appear as two contours.

I have to check it for several other real images as well. Let’s see how it will behave for other images.


Friday, April 27, 2007

Identifying the Blood cell types

I have currently developed a method to identify the blood cells using Invariant Moments.

To find the Invariant moments first it has to calculate the 3rd order Central moments. Then it is necessary to calculate the Normalized Central Moments. By using the Normalized central moments it is able calculate the Invariant Moments.

Moment Invariants are useful features in pattern recognition problems. Using N moments, for the instance the image can be represented as a point in a N-dimensional vector space.

For the moment I have used only the first Invariant Moment to identify the blood cell types. And it was little bit succeed. And now I am considering with all seven moments to identify the cell types. Mean while I am also trying to get the typical values of the areas of the blood cells and try to identify the blood cell types using those typical values.

Code related to this is updated in Google Group related to the LOHITHA.

Thursday, April 26, 2007

Interactive Counting Algorithm

Hi All,
I've completed the Interactive counting algorithm. (Oshi actually it is the interactive counting one) The algorithm I implemented is not an exact mapping of the matlab code to C++. Anyway now it is giving the count result as 2533, which is close to 2610, the result given by the Matlab algorithm. If I could check the algo for the actual images I would be able to see whether the algo is working fine. For that I have to get the coordinates of the center of several blood cells on the image, which I do not know how to do up to now. I guess it can be done using a program like, photoshop, or else we have to develop the "mouse clicking on the image" part. Anyway as Oshi said my immediate next step would be to put my code into a class and break that into functions.
Vidakna

26 April - Standard Count (almost done)

Actually this is a post on behalf of Vidakna. Today she was trying very hard to get her algorithm on standard count working. Just now I got an SMS from her saying that her count gives a result of 2268!! Yey!!

The matlab code gives a count of 2610 which we can assume to be the correct answer. I believe we can fine tune her algo and get the best possible. This is a very big improvement since today morning, as we were getting a count of 0 no matter what we do to fix it!
Well done Vidakna! Please try to upload your code once it's cleaned up into the classes as in our design doc.

As for my progress... I have been having tough luck with C++ memory management when I try to share data structures (especially vectors and cvRects) between methods. Tomorrow I am planning to give it a fresh look, and hopefully I'd be able to figure out what is wrong. If these problems persist, I hope to get some professional help :-).

In the mean time, I was trying out my creative abilities... and thought I should try and design a logo for us - (I know Omega wanted a pro to do the job, please go ahead with that... these were just for fun)



Which one would you like the most?

Interactive and Standard counting

Hi all,
My algorithm for Interactive counting is not working well. If I do not get it correct by tomorrow I'll try it out using a MatLab dll. From today morning Oshani and I were trying to implement the Standard count. We tried it using back ground elimination and Contour processing first like what Omega has done. but the count result was not correct. Then I tried several other options such as, erode, but they also failed.
Anyway tonight I'll again be focusing on Interactive count, again. I'm now loading my code of the interactive counting algorithm to Lohitha google group.
We talked about the Final report as well. I will create a draft first so that you can review that and give suggestions to improve. And we can add things as we go along....

Vidakna

Thursday, April 19, 2007

20 April - Issue in WBC Background Removal

Hi all,

My algorithm for background removal doesn't seem to be working for the actual images we got using the microscopes in Materials dept.

As you all can see (in the images), the RBC to WBC ratio in the images we got from the internet, is very low compared to that of the images we got in the Materials dpt. As a result, the algo doesn't seem to work on them.

So I have to write a second algorithm to segment the cells using purely the color profile which is guaranteed to work.

Anyway, the contrast stretching based one would work well in the long run, coz the actual images that we supposed to get with the correct magnificaton, are very close to the ones we got from the net. But as a fail safe, we'll have two algos for doing this.

This doesn't prevent the continuation of work, since the out put of the background elimination is a set of cvRect s. So others can proceed. At the same time, we can fine tune the background elimination algorithm.

- Omega

Tuesday, April 17, 2007

17 April: Standard Count - Square Identification Done


The output so far is something like this. (Note: red lines indicate all the lines identified with the Hough transform and the thick green lines indicate the squares the MLT would prefer to do counting on - I've implemented a simple algorithm to do this).

However there is one simple caveat in my algorithm. Remember that the actual counting chamber we used in taking the images had 3x3 small squares fitted into 3x3 larger squares? So, according to my algo, the user - MLT, would have to input the configuration (whether it's 3x3 or 4x4). Since I used the above picture for testing, I used the default value of 4.

May be we could use some sort of a heuristic algorithm to find out whether it's 3x3, 4x4 or whatever. But at the moment, I am really not up for it :-).

If Vidakna needs the coordinates of the crossing points of the squares detected as in the above diagram for her algorithm on counting the cells, I believe it is possible. Although earlier I said that we could use cvSeq for data exchange between our classes/functions as a standard, I now believe we could get the job done with familiar data types with less overhead. Anyway let's discuss about this further tomorrow.

I've committed the code in the svn and you are free to review and comment on it.