Binarize
Convert images to black and white.
Process:
- Convert the image to grayscale.
- Remove low frequencies (e.g. shadows)
- Apply threshold with OTSU's method
Smart Black & White
| Input | Output |
|---|---|
![]() | ![]() |
$ ./flatcv imgs/page.png bw_smart imgs/page_bw_smart.png
Loaded image: 384x256 with 1 channels
Executing pipeline with 1 operations:
Applying operation: bw_smart
→ Completed in \d+.\d+ ms \(output: 384x256\) (regex)
Final output dimensions: 384x256
Successfully saved processed image to 'imgs/page_bw_smart.png'
$ git diff --quiet imgs/page_bw_smart.png
Smart and Smooth (Anti-Aliased) Black & White
| Input | Output |
|---|---|
![]() | ![]() |
$ ./flatcv imgs/page.png bw_smooth imgs/page_bw_smooth.png
Loaded image: 384x256 with 1 channels
Executing pipeline with 1 operations:
Applying operation: bw_smooth
→ Completed in \d+.\d+ ms \(output: 384x256\) (regex)
Final output dimensions: 384x256
Successfully saved processed image to 'imgs/page_bw_smooth.png'
$ git diff --quiet imgs/page_bw_smooth.png
Otsu Threshold
Apply Otsu's method to automatically find the optimal threshold value for binarization.
| Input | Output |
|---|---|
![]() | ![]() |
$ ./flatcv imgs/parrot.jpeg threshold imgs/parrot_threshold.png
Loaded image: 512x384 with 3 channels
Executing pipeline with 1 operations:
Applying operation: threshold
→ Completed in \d+.\d+ ms \(output: 512x384\) (regex)
Final output dimensions: 512x384
Successfully saved processed image to 'imgs/parrot_threshold.png'
Sobel Edge Detection
Detect edges in an image using the Sobel operator, which calculates the gradient of image intensity at each pixel.
| Input | Output |
|---|---|
![]() | ![]() |
$ ./flatcv imgs/parrot.jpeg sobel imgs/parrot_sobel.png
Loaded image: 512x384 with 3 channels
Executing pipeline with 1 operations:
Applying operation: sobel
→ Completed in \d+.\d+ ms \(output: 512x384\) (regex)
Final output dimensions: 512x384
Successfully saved processed image to 'imgs/parrot_sobel.png'





