@@ -12,7 +12,7 @@ If you don't have a webcam, pick some video and use **--file some-video.mp4** in
...
@@ -12,7 +12,7 @@ If you don't have a webcam, pick some video and use **--file some-video.mp4** in
```
```
> cv-cat --file some-video.mp4 "view;null"
> cv-cat --file some-video.mp4 "view;null"
```
```
# basic input/output and image filters
## basic input/output and image filters
If you don't specify **null** the images **cv-cat** reads from your camera will be output to stdout in a simple binary format (see **image data format** section below). Try:
If you don't specify **null** the images **cv-cat** reads from your camera will be output to stdout in a simple binary format (see **image data format** section below). Try:
```
```
...
@@ -32,8 +32,8 @@ Play back saved images
...
@@ -32,8 +32,8 @@ Play back saved images
```
```
> cat images.bin | cv-cat "view;null"
> cat images.bin | cv-cat "view;null"
```
```
# image data format
## image data format
## example
### example
In previous example **cv-cat** plays back the images as fast as it can, not in realtime.
In previous example **cv-cat** plays back the images as fast as it can, not in realtime.
To play back in realtime, let us use [**csv-play**](https://gitlab.com/orthographic/comma/-/wikis/csv/getting-started:-basic-data-manipulations,-ascii-and-binary-data).
To play back in realtime, let us use [**csv-play**](https://gitlab.com/orthographic/comma/-/wikis/csv/getting-started:-basic-data-manipulations,-ascii-and-binary-data).
...
@@ -52,13 +52,13 @@ Now, let's play back **images.bin** in real time:
...
@@ -52,13 +52,13 @@ Now, let's play back **images.bin** in real time:
@@ -80,7 +80,8 @@ Outputting number of rows, columns, and image type with each image may look redu
...
@@ -80,7 +80,8 @@ Outputting number of rows, columns, and image type with each image may look redu
- by having image size and type, each image record is self-contained
- by having image size and type, each image record is self-contained
- each image can be of different size and type (see examples in **image files and file lists** section below)
- 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)
- header is optional (see examples in **\<image\>** section below)
### \<image\>
#### \<image\>
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**)
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.
Try to output your camera feed without header, i.e. images only.