You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
2.7 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef IMAGE_H
  2. #define IMAGE_H
  3. #include <stdlib.h>
  4. #include <stdio.h>
  5. #include <float.h>
  6. #include <string.h>
  7. #include <math.h>
  8. #include <darknet.h>
  9. #include "box.h"
  10. namespace DN{
  11. //#ifndef __cplusplus
  12. #ifdef OPENCV
  13. int fill_image_from_stream(CvCapture *cap, image im);
  14. image ipl_to_image(IplImage* src);
  15. void ipl_into_image(IplImage* src, image im);
  16. void image_into_ipl(image im, IplImage* dst);
  17. void flush_stream_buffer(CvCapture *cap, int n);
  18. void show_image_cv(image p, const char *name, IplImage *disp);
  19. #endif
  20. //#endif
  21. float get_color(int c, int x, int max);
  22. void draw_box(image a, int x1, int y1, int x2, int y2, float r, float g, float b);
  23. void draw_bbox(image a, box bbox, int w, float r, float g, float b);
  24. void draw_label(image a, int r, int c, image label, const float *rgb);
  25. void write_label(image a, int r, int c, image *characters, char *string, float *rgb);
  26. image image_distance(image a, image b);
  27. void scale_image(image m, float s);
  28. image rotate_crop_image(image im, float rad, float s, int w, int h, float dx, float dy, float aspect);
  29. image center_crop_image(image im, int w, int h);
  30. image random_crop_image(image im, int w, int h);
  31. image random_augment_image(image im, float angle, float aspect, int low, int high, int w, int h);
  32. augment_args random_augment_args(image im, float angle, float aspect, int low, int high, int w, int h);
  33. void letterbox_image_into(image im, int w, int h, image boxed);
  34. image resize_max(image im, int max);
  35. void translate_image(image m, float s);
  36. void embed_image(image source, image dest, int dx, int dy);
  37. void place_image(image im, int w, int h, int dx, int dy, image canvas);
  38. void saturate_image(image im, float sat);
  39. void exposure_image(image im, float sat);
  40. void distort_image(image im, float hue, float sat, float val);
  41. void saturate_exposure_image(image im, float sat, float exposure);
  42. void rgb_to_hsv(image im);
  43. void hsv_to_rgb(image im);
  44. void yuv_to_rgb(image im);
  45. void rgb_to_yuv(image im);
  46. image collapse_image_layers(image source, int border);
  47. image collapse_images_horz(image *ims, int n);
  48. image collapse_images_vert(image *ims, int n);
  49. void show_image_normalized(image im, const char *name);
  50. void show_images(image *ims, int n, char *window);
  51. void show_image_layers(image p, char *name);
  52. void show_image_collapsed(image p, char *name);
  53. void print_image(image m);
  54. image make_empty_image(int w, int h, int c);
  55. void copy_image_into(image src, image dest);
  56. float get_pixel(image m, int x, int y, int c);
  57. float get_pixel_extend(image m, int x, int y, int c);
  58. void set_pixel(image m, int x, int y, int c, float val);
  59. void add_pixel(image m, int x, int y, int c, float val);
  60. float bilinear_interpolate(image im, float x, float y, int c);
  61. image get_image_layer(image m, int l);
  62. };
  63. #endif