Detecting and coloring edges according to their direction using NxN kernel convolutions' implementation.
Examples
Kernel convolutions' implementation
Usage
Input | Long Flags | Short Flags | Output |
---|---|---|---|
--colored --threshold 9 22 |
-c -t 9 22 |
||
--colored --threshold 9 22 --stroke 1 |
-c -t 9 22 -s 1 |
||
--threshold 9 22 | -t 9 22 |
Instead of padding the image with black pixels i'm cropping the kernel to fit available pixels.
For example:
Given a kernel of 5x5 dimensions, on the first pixel (0, 0) theres no pixels before it to accommodate the kernel thus it is cropped for only available pixels and applied for the (0,0) pixel.
+
->
git clone https://github.com/MingaudasVagonis/edge-detection-coloring.git
cd edge-detection-coloring
python3 main.py [filename] [flags]
Long Flags | Short Flags | Description |
---|---|---|
--threshold | -t | One or two numbers representing lower and upper thresholds. |
--colored | -c | Set this in order to apply color to the edges according to their direction. |
--stroke | -s | A number representing the width of the output edge. |