Skip to content

Ruslan3584/graph_algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Graph Algorithms in Computer Vision

Labs for University Course

Lab 1 - MaxFlow-MinCut implementation

Image Denoising

Examples

cd lab1/
mkdir build/
cd build/
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=native -mtune=native" .. && cmake --build .

pass parameters: path_to_input_image binary_penalty output_image

run:

./maxflow ../test_images/input.png 50 ../test_images/result.png

Lab 2 - alpha-Expansion implementation

Image Segmentation

Examples

cd lab2/
mkdir build/
cd build/
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=native -mtune=native" .. && cmake --build .

pass parameters: path_to_input_image epsilon n_iter output_image

run:

./alpha_expansion ../input.png 15 3 ../out.png

Lab 3 - MaxFlow implementation (Hiroshi Ishikawa)

Image Segmentation

Examples

C++ version (from scratch)
cd lab3/cpp
mkdir build/
cd build/
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=native -mtune=native" .. && cmake --build .

pass parameters: path_to_input_image beta output_image

run:

./maxflow_ishikawa ../../test_images/input.png 15 out.png
Python (using PyMaxflow)

pass parameters: path_to_input_image beta n_labels output_image

run:

python3 py/ishikawa_maxflow.py ../test_images/input.png 15 5 out.png

Lab 4 - d-shortest paths

Image (string) Recognition

Examples

python3 lab4/d_shortest_paths.py input_string noise_level number_of_best_paths

python3 d_shortest_paths.py "row" 0.1 3
python3 d_shortest_paths.py "all" 0.2 3