27 #ifndef _CV_LIB_VISION_IMAGE_H
28 #define _CV_LIB_VISION_IMAGE_H
void image_copy(struct image_t *input, struct image_t *output)
Copy an image from inut to output This will only work if the formats are the same.
void image_show_points(struct image_t *img, struct point_t *points, uint16_t points_cnt)
Show points in an image by coloring them through giving the pixels the maximum value.
uint32_t buf_size
The buffer size.
void image_show_flow(struct image_t *img, struct flow_t *vectors, uint16_t points_cnt, uint8_t subpixel_factor)
Shows the flow from a specific point to a new point This works on YUV422 and Grayscale images...
uint16_t h
height of the cropped area
void image_add_border(struct image_t *input, struct image_t *output, uint8_t border_size)
This function adds padding to input image by mirroring the edge image elements.
void pyramid_next_level(struct image_t *input, struct image_t *output, uint8_t border_size)
This function takes previous padded pyramid level and outputs next level of pyramid without padding...
void image_subpixel_window(struct image_t *input, struct image_t *output, struct point_t *center, uint32_t subpixel_factor, uint8_t border_size)
This outputs a subpixel window image in grayscale Currently only works with Grayscale images as input...
uint16_t y
Start position y (vertical)
uint16_t x
Start position x (horizontal)
uint32_t x
The x coordinate of the point.
uint32_t pprz_ts
The timestamp in us since system startup.
void image_switch(struct image_t *a, struct image_t *b)
This will switch image *a and *b This is faster as image_copy because it doesn't copy the whole image...
uint16_t w
Width of the cropped area.
uint8_t buf_idx
Buffer index for V4L2 freeing.
void image_gradients(struct image_t *input, struct image_t *dx, struct image_t *dy)
Calculate the gradients using the following matrix: [0 -1 0; -1 0 1; 0 1 0].
void image_draw_line(struct image_t *img, struct point_t *from, struct point_t *to)
Draw a line on the image.
int16_t flow_x
The x direction flow in subpixels.
int32_t image_multiply(struct image_t *img_a, struct image_t *img_b, struct image_t *mult)
Calculate the multiplication between two images and return the error This will only work with image g...
void image_yuv422_downsample(struct image_t *input, struct image_t *output, uint16_t downsample)
Simplified high-speed low CPU downsample function without averaging downsample factor must be 1...
uint32_t image_difference(struct image_t *img_a, struct image_t *img_b, struct image_t *diff)
Calculate the difference between two images and return the error This will only work with grayscale i...
void * buf
Image buffer (depending on the image_type)
struct point_t pos
The original position the flow comes from.
uint32_t y
The y coordinate of the point.
void image_calculate_g(struct image_t *dx, struct image_t *dy, int32_t *g)
Calculate the G vector of an image gradient This is used for optical flow calculation.
uint16_t image_yuv422_colorfilt(struct image_t *input, struct image_t *output, uint8_t y_m, uint8_t y_M, uint8_t u_m, uint8_t u_M, uint8_t v_m, uint8_t v_M)
Filter colors in an YUV422 image.
void pyramid_build(struct image_t *input, struct image_t *output_array, uint8_t pyr_level, uint8_t border_size)
This function populates given array of image_t structs with wanted number of padded pyramids based on...
struct timeval ts
The timestamp of creation.
void image_free(struct image_t *img)
Free the image.
UYVY format (uint16 per pixel)
void image_create(struct image_t *img, uint16_t width, uint16_t height, enum image_type type)
Create a new image.
Grayscale image with only the Y part (uint8 per pixel)
void image_to_grayscale(struct image_t *input, struct image_t *output)
Convert an image to grayscale.
An image gradient (int16 per pixel)
int16_t flow_y
The y direction flow in subpixels.
An JPEG encoded image (not per pixel encoded)
enum image_type type
The image type.