Team project - Cyfrowe techniki rozpoznawania obrazów (pl. "Digital image recognition methods") 2016/2017
In our “perfect” world there is more and more electronic devices that use discrete data as an input or/and output. The best example is digital camera, that saves recorded image as a binary numbers. Because output informations are numbers, and nowadays processors are powerful, so digital techniques could be used to extract some data from all samples - for example, to speed up some production or medical diagnosis processes.
The main purpose of this project is to detect shape’s borders in images. It is based on “active contour without edges” model (proposed by Chan-Vase) using level set method. Implementation based on
- Pascal Getreuer, Chan-Vese Segmentation, Image Processing On Line, 2 (2012), pp. 214–224
- Tony F. Chan, Luminita A. Vese Active Contours Without Edges IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 10, NO. 2, FEBRUARY 2001
“Active contour without edges” model is an evolution form of “active contour” model - also named as a “snake” model.
But snake model is not ideal one, because there have to be known edge of an object beforehand to properly segment data, that is why Chan-Vase used level set method to achieve that.
Level set method is not easy, especially looking at it's equation.
where C is enclosed area dividing image on three parts:
- laying outside C area
- laying on a border of C area
- laying inside C area
c1 is an average value of all pixels inside C area, and c2 is an average value of rest pixels. Other parameters like 𝜇, λ, ν, controls precisions and speed of calculations. The main ingredient of level set method is level set function φ(x) that determines shape of C area. The starting initialization function φ(x) can be anything type, but the typical one are function for circle of radius:
and sine:
that gives a chessboard shape as a start initialization area, and what is more - have fast convergence.
The principle of operation of level set method is based on evolving only φ(x) function that equally change C area.
The numerical equation is denote as:
Where A and B are coefficients specified as:
As said before parameters 𝜇, λ, ν, have huge impact on final effect - precision of segmentation. Too small or too big value can result in no segmentation at all.
Here are some examples, how curvature of φ(x) function, changes with iterations:
And here is an effect of our work:
##C++11
Why do we need C++11?
Image(Image const&) = delete;
Image(Image const&&) = delete;
Although there is no need for explicitly deleting (since we do not create new objects based on object created earlier), it could be good for documentation. C++11 allows to disabling these. In previous standards copy constructor could be defined as private, so the compiler woludn't allow to call it.
TBD
using Flags = std::map<std::string, std::string>;
Safer than MACROs
TBD
float sum_inside{}; // inside or on border
TBD
TBD
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4317.pdf
for (auto& i : flags)
TBD
$ mkdir -p build
$ cd build
$ cmake .. # or cmake -DBUILD_TESTS=ON if you want to build gtests
$ make
$ ./level-set -i ../test-images/001.jpg
Ifstead of cmake ..
type cmake -DBUILD_TESTS=ON
if you want to build gtests.
28.11.2016
- start16.01.2017
- project will have been finished by this date23.01.2017
- presentation
TBD