Skip to content

module core

Tianshu Huang edited this page Oct 22, 2018 · 3 revisions

Core Vision Module

Maintainers

Slack Github
Tianshu @thetianshuhuang @thetianshuhuang

Related Issues

Usage

For a complete description, see the rust doc (cargo build).

Create images

Todo (image ingest routines and python interface TBD)

Data type

The image data type is given as an Image struct:

pub struct Image {
    width: u32,
    height: u32,
    data: Vec<u32>
}

Width and height store the dimensions of the image, while the data is contained in a flattened, packed 32-bit vector (see the algorithms notes for a more detailed description).

Access and modify images

Access pixels with Image.acess(x, y) or Image.unpack(idx). This returns a Pixel struct:

pub struct Pixel { h: i32, s: i32, v: i32, mask: i32 }

In order to write back to the image, use Image.pack(pixel, idx) to pack the pixel and return it to the source image.

Clone this wiki locally