https://github.com/ad-si/flatcv
Simple computer vision library in pure C
https://github.com/ad-si/flatcv
c cli cli-tool computer-vision grayscale image image-filter image-manipulation image-pipeline image-processing otsu single-header
Last synced: about 2 months ago
JSON representation
Simple computer vision library in pure C
- Host: GitHub
- URL: https://github.com/ad-si/flatcv
- Owner: ad-si
- Created: 2025-06-16T14:59:51.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-16T15:02:49.000Z (about 1 year ago)
- Last Synced: 2025-06-16T16:22:56.403Z (about 1 year ago)
- Topics: c, cli, cli-tool, computer-vision, grayscale, image, image-filter, image-manipulation, image-pipeline, image-processing, otsu, single-header
- Language: C++
- Homepage:
- Size: 4.6 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# FlatCV
Image processing and computer vision library in pure C.
## Features
[Flip](https://flatcv.ad-si.com/flip.html),
[Crop](https://flatcv.ad-si.com/crop.html),
[Trim](https://flatcv.ad-si.com/trim.html),
[Resize](https://flatcv.ad-si.com/resize.html),
[Blur](https://flatcv.ad-si.com/blur.html),
[Draw](https://flatcv.ad-si.com/draw.html),
[Grayscale](https://flatcv.ad-si.com/grayscale.html),
[Binarize](https://flatcv.ad-si.com/binarize.html) \
[Corner-Detection](https://flatcv.ad-si.com/corner-detection.html),
[QR-Code Decoding](https://flatcv.ad-si.com/qr-code.html),
[Segmentation](https://flatcv.ad-si.com/segmentation.html),
[Document-Extraction](https://flatcv.ad-si.com/document-extraction.html)
Check out the [official documentation][docs]
for more details on each feature.
### Cross Platform Support
- Linux (x86 & arm64)
- macOS (x86 & arm64)
- Windows (x86 & arm64)
- PowerPC
- RISC-V
- …
## Usage
FlatCV can either be used as a C library or via its CLI.
You can get the single file version of the code and the CLI binaries
in the release artifacts section of each release:
[github.com/ad-si/FlatCV/releases](https://github.com/ad-si/FlatCV/releases)
### CLI
The CLI supports edit pipelines which sequentially apply all transformations.
```sh
flatcv
```
As commas aren't special characters in shells,
you can write the edit pipeline without quotes.
Both variants yield the same result:
```sh
flatcv i.jpg 'grayscale, blur 9' o.jpg
flatcv i.jpg grayscale, blur 9 o.jpg
```
#### Examples
Check out the [official documentation website][docs]
for more examples and usage instructions.
Command | Input | Output
--------|-------|--------
`flatcv i.jpg grayscale o.jpg` |  | 
`flatcv i.jpg grayscale, blur 9 o.jpg` |  | 
`flatcv i.jpg bw_smooth o.jpg` |  | 
`flatcv i.jpg watershed 0x0 300x200 599x0 o.jpg` |  | 
### Library
```c
#include "flatcv.h"
// Resize an image to 50%
unsigned char const * half_size = resize(
input_width, input_height,
0.5, 0.5,
&out_width, &out_height,
input_data
);
// Do something with the resized image
free(half_size);
```
[docs]: https://flatcv.ad-si.com