darknet/src/image.h

66 lines
2.2 KiB
C
Raw Normal View History

2013-11-04 23:11:01 +04:00
#ifndef IMAGE_H
#define IMAGE_H
2014-04-17 04:05:29 +04:00
2013-11-04 23:11:01 +04:00
#include "opencv2/highgui/highgui_c.h"
#include "opencv2/imgproc/imgproc_c.h"
typedef struct {
int h;
int w;
int c;
float *data;
2013-11-04 23:11:01 +04:00
} image;
2014-02-25 00:21:31 +04:00
image image_distance(image a, image b);
void scale_image(image m, float s);
2014-04-17 04:05:29 +04:00
void translate_image(image m, float s);
2013-11-04 23:11:01 +04:00
void normalize_image(image p);
2013-12-03 04:41:40 +04:00
void z_normalize_image(image p);
void threshold_image(image p, float t);
2013-11-04 23:11:01 +04:00
void zero_image(image m);
void rotate_image(image m);
void subtract_image(image a, image b);
float avg_image_layer(image m, int l);
2013-12-03 04:41:40 +04:00
void embed_image(image source, image dest, int h, int w);
void add_into_image(image src, image dest, int h, int w);
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);
image get_sub_image(image m, int h, int w, int dh, int dw);
2013-11-04 23:11:01 +04:00
void show_image(image p, char *name);
void save_image(image p, char *name);
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);
2014-04-17 04:05:29 +04:00
void show_images_grid(image **ims, int h, int w, char *window);
void test_grid();
image grid_images(image **ims, int h, int w);
2013-12-03 04:41:40 +04:00
void print_image(image m);
2013-11-04 23:11:01 +04:00
image make_image(int h, int w, int c);
2013-11-13 22:50:38 +04:00
image make_empty_image(int h, int w, int c);
2013-11-04 23:11:01 +04:00
image make_random_image(int h, int w, int c);
image make_random_kernel(int size, int c, float scale);
image float_to_image(int h, int w, int c, float *data);
2013-11-04 23:11:01 +04:00
image copy_image(image p);
2014-02-14 22:26:31 +04:00
image load_image(char *filename, int h, int w);
image ipl_to_image(IplImage* src);
2013-11-04 23:11:01 +04:00
float get_pixel(image m, int x, int y, int c);
float get_pixel_extend(image m, int x, int y, int c);
void add_pixel(image m, int x, int y, int c, float val);
void set_pixel(image m, int x, int y, int c, float val);
2013-11-04 23:11:01 +04:00
image get_image_layer(image m, int l);
2013-12-03 04:41:40 +04:00
void two_d_convolve(image m, int mc, image kernel, int kc, int stride, image out, int oc, int edge);
2013-11-04 23:11:01 +04:00
void upsample_image(image m, int stride, image out);
2013-12-03 04:41:40 +04:00
void convolve(image m, image kernel, int stride, int channel, image out, int edge);
void back_convolve(image m, image kernel, int stride, int channel, image out, int edge);
void kernel_update(image m, image update, int stride, int channel, image out, int edge);
2013-11-04 23:11:01 +04:00
void free_image(image m);
#endif