Generate and algorithm in Matlab for counting cells
## Deliverables
The algorithm must have th?s structure:
*function [images,results] = algorithm(img);
**images{1} = struct2cell(descImage(img));**
[I2 Ig] = forground_adapted(img);
level = graythresh(I2);
%bw = im2bw(I2,level);
bw = im2bw(I2,0.2);
bw = imcomplement(bw);
bw = bwareaopen(bw,12);
bw = imclearborder(bw(3:end-2,3:end-2), 8);
cc = bwconncomp(bw, 8);
Ncells = [login to view URL];
**results{1} = struct2cell(struct('type','double','value',Ncells));***
**results{2} =** ***struc****t2cell(struct('type','double','value',NdarkBlue));***
Look at the images and results variables: this is the way to return middle values. results has two values and images must have a lot of images (depending of the algorithm) just for diagnostic tasks.
We provide you of descImage.m function. And as you can see we need an algorithm for count the number of normal cells and the dark blue cells as a second parameter in results variable.