From ccde487525fc89a1d4bc3e1cf11a18971e8451c9 Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@users.noreply.github.com>
Date: Sat, 11 Jul 2015 00:33:24 +0000
Subject: [PATCH] Create README.md

---
 src/image.c |   48 +++++++++++++++++++-----------------------------
 1 files changed, 19 insertions(+), 29 deletions(-)

diff --git a/src/image.c b/src/image.c
index 4591103..046de0c 100644
--- a/src/image.c
+++ b/src/image.c
@@ -59,6 +59,14 @@
     }
 }
 
+void draw_box_width(image a, int x1, int y1, int x2, int y2, int w, float r, float g, float b)
+{
+    int i;
+    for(i = 0; i < w; ++i){
+        draw_box(a, x1+i, y1+i, x2-i, y2-i, r, g, b);
+    }
+}
+
 void flip_image(image a)
 {
     int i,j,k;
@@ -179,6 +187,7 @@
 {
     int x,y,k;
     image copy = copy_image(p);
+    constrain_image(copy);
     rgbgr_image(copy);
     //normalize_image(copy);
 
@@ -199,7 +208,8 @@
         }
     }
     free_image(copy);
-    if(disp->height < 448 || disp->width < 448 || disp->height > 1000){
+    if(0){
+    //if(disp->height < 448 || disp->width < 448 || disp->height > 1000){
         int w = 448;
         int h = w*p.h/p.w;
         if(h > 1000){
@@ -577,46 +587,26 @@
 void test_resize(char *filename)
 {
     image im = load_image(filename, 0,0, 3);
-    image small = resize_image(im, 65, 63);
-    image big = resize_image(im, 513, 512);
-    image crop = crop_image(im, 50, 10, 100, 100);
-    image crop2 = crop_image(im, -30, -50, 291, 400);
-    image rot = rotate_image(big, .02);
-    image rot2 = rotate_image(big, 3.14159265/2.);
-    image test = rotate_image(im, .6);
     image gray = grayscale_image(im);
 
     image sat2 = copy_image(im);
     saturate_image(sat2, 2);
 
     image sat5 = copy_image(im);
-    saturate_image(sat5, 5);
-
-    image sat10 = copy_image(im);
-    saturate_image(sat10, 10);
+    saturate_image(sat5, .5);
 
     image exp2 = copy_image(im);
-    saturate_image(exp2, .5);
     exposure_image(exp2, 2);
 
     image exp5 = copy_image(im);
-    saturate_image(exp5, .5);
     exposure_image(exp5, .5);
 
-    show_image(im, "original");
-    show_image(gray, "gray");
-    show_image(sat2, "sat2");
-    show_image(sat5, "sat5");
-    show_image(sat10, "sat10");
-    /*
-       show_image(small, "smaller");
-       show_image(big, "bigger");
-       show_image(crop, "crop");
-       show_image(crop2, "crop2");
-       show_image(rot, "rot");
-       show_image(rot2, "rot2");
-       show_image(test, "test");
-     */
+    show_image(im, "Original");
+    show_image(gray, "Gray");
+    show_image(sat2, "Saturation-2");
+    show_image(sat5, "Saturation-.5");
+    show_image(exp2, "Exposure-2");
+    show_image(exp5, "Exposure-.5");
     #ifdef OPENCV
     cvWaitKey(0);
     #endif
@@ -673,7 +663,7 @@
     int w, h, c;
     unsigned char *data = stbi_load(filename, &w, &h, &c, channels);
     if (!data) {
-        printf("Cannot load file image %s\n", filename);
+        fprintf(stderr, "Cannot load file image %s\nSTB Reason: %s\n", filename, stbi_failure_reason());
         exit(0);
     }
     if(channels) c = channels;

--
Gitblit v1.10.0