From 0f7f2899b65343e56b0a1188f703d459d824d398 Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Mon, 16 Nov 2015 03:51:26 +0000
Subject: [PATCH] Fix for cuda 7.5
---
src/image.c | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/image.c b/src/image.c
index 5209328..ac49529 100644
--- a/src/image.c
+++ b/src/image.c
@@ -215,7 +215,7 @@
IplImage *disp = cvCreateImage(cvSize(p.w,p.h), IPL_DEPTH_8U, p.c);
int step = disp->widthStep;
- cvNamedWindow(buff, CV_WINDOW_AUTOSIZE);
+ cvNamedWindow(buff, CV_WINDOW_NORMAL);
//cvMoveWindow(buff, 100*(windows%10) + 200*(windows/10), 100*(windows%10));
++windows;
for(y = 0; y < p.h; ++y){
@@ -494,6 +494,16 @@
return gray;
}
+image threshold_image(image im, float thresh)
+{
+ int i;
+ image t = make_image(im.w, im.h, im.c);
+ for(i = 0; i < im.w*im.h*im.c; ++i){
+ t.data[i] = im.data[i]>thresh ? 1 : 0;
+ }
+ return t;
+}
+
image blend_image(image fore, image back, float alpha)
{
assert(fore.w == back.w && fore.h == back.h && fore.c == back.c);
@@ -612,7 +622,7 @@
float val = (1-dy) * get_pixel(part, c, iy, k);
set_pixel(resized, c, r, k, val);
}
- if(r == h-1) continue;
+ if(r == h-1 || im.h == 1) continue;
for(c = 0; c < w; ++c){
float val = dy * get_pixel(part, c, iy+1, k);
add_pixel(resized, c, r, k, val);
@@ -686,7 +696,7 @@
if( (src = cvLoadImage(filename, flag)) == 0 )
{
- printf("Cannot load file image %s\n", filename);
+ printf("Cannot load image \"%s\"\n", filename);
exit(0);
}
image out = ipl_to_image(src);
@@ -703,7 +713,7 @@
int w, h, c;
unsigned char *data = stbi_load(filename, &w, &h, &c, channels);
if (!data) {
- fprintf(stderr, "Cannot load file image %s\nSTB Reason: %s\n", filename, stbi_failure_reason());
+ fprintf(stderr, "Cannot load image \"%s\"\nSTB Reason: %s\n", filename, stbi_failure_reason());
exit(0);
}
if(channels) c = channels;
--
Gitblit v1.10.0