Skip to content
Update getting started with image streams authored by Vsevolod Vlaskine's avatar Vsevolod Vlaskine
......@@ -77,7 +77,21 @@ Outputting number of rows, columns, and image type with each image may look redu
- each image can be of different size and type (see examples in **image files and file lists** section below)
- header is optional (see examples in **\<image\>** section below)
### \<image\>
The image part of the **snark** image format is simply an uncompressed binary image representation.
The image part of the **snark** image format is simply an uncompressed binary image bitmap. E.g. an 8-byte RGB image 20x10 would have 20x10x3=600 bytes, each 3 bytes representing blue, green, and red components of the pixel. (Why blue-green-red rather than red-green-blue? Because, this is the byte order used in **OpenCV** and originally stipulated by **Microsoft**. Sigh. Fortunately, if you need to change pixel byte order, **cv-cat** has filters for that, e.g. **convert-color=bgr,rgb**)
Try to output your camera feed without header, i.e. images only.
Work out your image size (480 rows, 640 columns, 3-byte RGB in my case below):
```
> cv-cat --camera --output header-only | csv-from-bin t,3ui | head -n1
20201119T233156.986452,480,640,16
```
Output just raw images without header and then read and view them:
```
> cv-cat --camera --output no-header | cv-cat --input "rows=480;cols=640;type=3ub;no-header" "view;null"
```
You can load it as a **numpy** array or **cv.mat**/**cv::Mat** in **OpenCV**.
## image filters
...
......
......