Contents:
This script aims to detect blue blobs that represent center of cells of an organic tissue.
A Voronoi diagram is drawn over these detected blue blobs in order to represent the cells themselves.
Finally, we would like to simulate a blood flow in animating this diagram by giving a speed to the cells coming from a speed field.
WARNING
The detection is working only if the blobs are blue and nothing else. It cannot be use for doing a General Blob Detection !
For the "Computer Vision", the script uses OpenCV library we choose to use for its efficiency:
Please, check the script's options if you are interested in specifying the parameters of the detection :
python bbd.py -h
which should gives you :
You can try a first detection by using the image organic.tif :
python bbd.py -i images/organic.tif
The processed image organic_processed should be generated and you should see the following stdout :
You can modify some parameters like the connectivity of the detection, the color of the Voronoi diagram etc...
In order to be able to execute the Python script from Matlab, you have to :
Add the git folder Blue-Blob-Detection containing bbd.py script to the PythonPath :
Add a path to PythonPath in Windows
Add a path to PythonPath in Linux
python_return_value = py.bbd.main('ABSOLUTE_PATH_OF_THE_IMAGE\images\organic.tif');
python_arrays = python_return_value{1};
facets_number = size(python_arrays, 2);
matlab_cell = cell(facets_number,1);
for i = 1:facets_number
temp_array = python_arrays{i};
matlab_cell{i} = double(py.array.array('d',py.numpy.nditer(temp_array)));
end
matlab_cell variable should contain a list of coordinates for each polygone of the Voroinoi diagram which can be use in the simulation model of organic cells developed at Centre Universitaire d'Informatique.