image.h
Go to the documentation of this file.
00001 #ifndef IMAGE_H
00002 #define IMAGE_H
00003 
00004 #include <stdlib.h>
00005 #include <stdio.h>
00006 #include <float.h>
00007 #include <string.h>
00008 #include <math.h>
00009 #include "box.h"
00010 
00011 #ifdef OPENCV
00012 #include "opencv2/imgproc/imgproc_c.h"
00013 #endif
00014 
00015 typedef struct {
00016     int h;
00017     int w;
00018     int c;
00019     float *data;
00020 } image;
00021 
00022 float get_color(int c, int x, int max);
00023 void flip_image(image a);
00024 void draw_box(image a, int x1, int y1, int x2, int y2, float r, float g, float b);
00025 void draw_box_width(image a, int x1, int y1, int x2, int y2, int w, float r, float g, float b);
00026 void draw_bbox(image a, box bbox, int w, float r, float g, float b);
00027 void draw_label(image a, int r, int c, image label, const float *rgb);
00028 void write_label(image a, int r, int c, image *characters, char *string, float *rgb);
00029 void draw_detections(image im, int num, float thresh, box *boxes, float **probs, char **names, image **labels, int classes);
00030 image image_distance(image a, image b);
00031 void scale_image(image m, float s);
00032 image crop_image(image im, int dx, int dy, int w, int h);
00033 image random_crop_image(image im, int w, int h);
00034 image random_augment_image(image im, float angle, float aspect, int low, int high, int size);
00035 void random_distort_image(image im, float hue, float saturation, float exposure);
00036 image resize_image(image im, int w, int h);
00037 image resize_min(image im, int min);
00038 image resize_max(image im, int max);
00039 void translate_image(image m, float s);
00040 void normalize_image(image p);
00041 image rotate_image(image m, float rad);
00042 void rotate_image_cw(image im, int times);
00043 void embed_image(image source, image dest, int dx, int dy);
00044 void saturate_image(image im, float sat);
00045 void exposure_image(image im, float sat);
00046 void distort_image(image im, float hue, float sat, float val);
00047 void saturate_exposure_image(image im, float sat, float exposure);
00048 void hsv_to_rgb(image im);
00049 void rgbgr_image(image im);
00050 void constrain_image(image im);
00051 void composite_3d(char *f1, char *f2, char *out, int delta);
00052 int best_3d_shift_r(image a, image b, int min, int max);
00053 
00054 image grayscale_image(image im);
00055 image threshold_image(image im, float thresh);
00056 
00057 image collapse_image_layers(image source, int border);
00058 image collapse_images_horz(image *ims, int n);
00059 image collapse_images_vert(image *ims, int n);
00060 
00061 void show_image(image p, const char *name);
00062 void show_image_normalized(image im, const char *name);
00063 void save_image_png(image im, const char *name);
00064 void save_image(image p, const char *name);
00065 void show_images(image *ims, int n, char *window);
00066 void show_image_layers(image p, char *name);
00067 void show_image_collapsed(image p, char *name);
00068 
00069 void print_image(image m);
00070 
00071 image make_image(int w, int h, int c);
00072 image make_random_image(int w, int h, int c);
00073 image make_empty_image(int w, int h, int c);
00074 image float_to_image(int w, int h, int c, float *data);
00075 image copy_image(image p);
00076 image load_image(char *filename, int w, int h, int c);
00077 image load_image_color(char *filename, int w, int h);
00078 image **load_alphabet();
00079 
00080 float get_pixel(image m, int x, int y, int c);
00081 float get_pixel_extend(image m, int x, int y, int c);
00082 void set_pixel(image m, int x, int y, int c, float val);
00083 void add_pixel(image m, int x, int y, int c, float val);
00084 float bilinear_interpolate(image im, float x, float y, int c);
00085 
00086 image get_image_layer(image m, int l);
00087 
00088 void free_image(image m);
00089 void test_resize(char *filename);
00090 
00091 #ifdef OPENCV
00092 image ipl_to_image(IplImage *src);
00093 #endif
00094 
00095 #endif
00096 


rail_object_detector
Author(s):
autogenerated on Sat Jun 8 2019 20:26:30