2013-11-04 23:11:01 +04:00
|
|
|
#ifndef IMAGE_H
|
|
|
|
#define IMAGE_H
|
|
|
|
|
2015-06-10 10:11:41 +03:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <float.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <math.h>
|
2015-08-25 04:27:42 +03:00
|
|
|
#include "box.h"
|
2017-06-02 06:31:13 +03:00
|
|
|
#include "darknet.h"
|
2013-11-04 23:11:01 +04:00
|
|
|
|
2018-09-14 02:53:20 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
2017-03-30 06:27:54 +03:00
|
|
|
#endif
|
2018-09-14 02:53:20 +03:00
|
|
|
|
|
|
|
#ifdef OPENCV
|
|
|
|
void *open_video_stream(const char *f, int c, int w, int h, int fps);
|
|
|
|
image get_image_from_stream(void *p);
|
|
|
|
image load_image_cv(char *filename, int channels);
|
|
|
|
int show_image_cv(image im, const char* name, int ms);
|
2017-03-30 06:27:54 +03:00
|
|
|
#endif
|
|
|
|
|
2015-02-24 05:52:05 +03:00
|
|
|
float get_color(int c, int x, int max);
|
|
|
|
void draw_box(image a, int x1, int y1, int x2, int y2, float r, float g, float b);
|
2015-08-25 04:27:42 +03:00
|
|
|
void draw_bbox(image a, box bbox, int w, float r, float g, float b);
|
2016-09-25 09:12:54 +03:00
|
|
|
void write_label(image a, int r, int c, image *characters, char *string, float *rgb);
|
2014-02-25 00:21:31 +04:00
|
|
|
image image_distance(image a, image b);
|
2014-01-29 04:28:42 +04:00
|
|
|
void scale_image(image m, float s);
|
2017-05-28 07:41:55 +03:00
|
|
|
image rotate_crop_image(image im, float rad, float s, int w, int h, float dx, float dy, float aspect);
|
2016-08-06 01:27:07 +03:00
|
|
|
image random_crop_image(image im, int w, int h);
|
2017-05-28 07:41:55 +03:00
|
|
|
image random_augment_image(image im, float angle, float aspect, int low, int high, int w, int h);
|
|
|
|
augment_args random_augment_args(image im, float angle, float aspect, int low, int high, int w, int h);
|
2017-04-30 23:54:40 +03:00
|
|
|
void letterbox_image_into(image im, int w, int h, image boxed);
|
2016-11-19 08:51:36 +03:00
|
|
|
image resize_max(image im, int max);
|
2014-04-17 04:05:29 +04:00
|
|
|
void translate_image(image m, float s);
|
2015-04-10 01:18:54 +03:00
|
|
|
void embed_image(image source, image dest, int dx, int dy);
|
2017-03-27 09:42:30 +03:00
|
|
|
void place_image(image im, int w, int h, int dx, int dy, image canvas);
|
2015-04-15 10:32:32 +03:00
|
|
|
void saturate_image(image im, float sat);
|
|
|
|
void exposure_image(image im, float sat);
|
2016-09-02 02:48:41 +03:00
|
|
|
void distort_image(image im, float hue, float sat, float val);
|
2015-04-15 10:32:32 +03:00
|
|
|
void saturate_exposure_image(image im, float sat, float exposure);
|
2017-03-27 09:42:30 +03:00
|
|
|
void rgb_to_hsv(image im);
|
2015-04-15 10:32:32 +03:00
|
|
|
void hsv_to_rgb(image im);
|
2017-03-27 09:42:30 +03:00
|
|
|
void yuv_to_rgb(image im);
|
|
|
|
void rgb_to_yuv(image im);
|
2015-09-23 03:34:48 +03:00
|
|
|
|
2015-04-10 01:18:54 +03:00
|
|
|
|
2013-12-03 04:41:40 +04:00
|
|
|
image collapse_image_layers(image source, int border);
|
2014-04-17 04:05:29 +04:00
|
|
|
image collapse_images_horz(image *ims, int n);
|
|
|
|
image collapse_images_vert(image *ims, int n);
|
2013-11-04 23:11:01 +04:00
|
|
|
|
2016-03-14 09:18:42 +03:00
|
|
|
void show_image_normalized(image im, const char *name);
|
2014-04-11 12:00:27 +04:00
|
|
|
void show_images(image *ims, int n, char *window);
|
2013-11-04 23:11:01 +04:00
|
|
|
void show_image_layers(image p, char *name);
|
2013-12-03 04:41:40 +04:00
|
|
|
void show_image_collapsed(image p, char *name);
|
2015-04-10 01:18:54 +03:00
|
|
|
|
2013-12-03 04:41:40 +04:00
|
|
|
void print_image(image m);
|
2013-11-04 23:11:01 +04:00
|
|
|
|
2015-04-10 01:18:54 +03:00
|
|
|
image make_empty_image(int w, int h, int c);
|
2017-04-30 23:54:40 +03:00
|
|
|
void copy_image_into(image src, image dest);
|
2015-04-10 01:18:54 +03:00
|
|
|
|
2013-11-04 23:11:01 +04:00
|
|
|
image get_image_layer(image m, int l);
|
|
|
|
|
2018-09-14 02:53:20 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-11-04 23:11:01 +04:00
|
|
|
#endif
|
|
|
|
|