Program written in C using no additional libraries, providing a toolset used to count objects where no overlapping occurs (e.g. cells, coins) and specific constraints are set. (mainly based on colour)
The program implements several image-processing tools which can be used independently. The intended workflow for counting objects is:
- Threshold the input image, using a well-chosen thresholding interval
- Apply the necessary morphological operations (dilation, closing, opening, erosion)
- Use the labelling algorithm and count the objects
The project is made with no additional libraries, being created with a learning purpose in mind.
- BMP file interface, able of I/O and general access
- Implementations of data structures such as
vector
,set
- Interfaces for various image types such as
binary
orgrayscale
- Implementation of morphological operators, used for detail enhancing or impurity removal
- Basic image processing specific kernel functionality
- Colour based two-pass labelling algorithm
Simply clone the project through your preferred IDE or by using the bash command
git clone git@github.com:thesstefan/countbro.git
After closing the repository, write your customized main.cpp
(see some examples in extra/
) and
modify the Makefile
to suit your needs (specify input/output image file paths). Next,
compile the project and count the objects in the image by executing (assuming a shell environment)
make -jX && make run
where X
is the desired number of jobs to be ran in parallel.
- Counting (1033) and detection of stars using
extra/main_sky.c
as source anddata/sky_input.bmp
as input.
- Counting (10) and detection of some coins using
extra/main_coins.c
as source anddata/coins_input.bmp
as input.
- Counting and detection (~184 with overlapping cells errors) of blood cells in a scan (the original purpose of the project), using
extra/main_cells.c
as source andextra/data_input.bmp
as input.
- Implement colour-range thresholding for finer detection control
- Transition everything to shader & GPU implementations for performance improvements