From 49aac21adca1b192bb4ef7c70f5ace3ce055beae Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 3 Nov 2010 13:43:42 +0000 Subject: [PATCH] morph oops --- TODO | 19 ++++++++++++------- libvips/convolution/im_sharpen.c | 2 +- libvips/morphology/morphology.c | 4 ++-- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/TODO b/TODO index 07aa9dfa..5d5d579d 100644 --- a/TODO +++ b/TODO @@ -2,20 +2,25 @@ - could do small masks in a single pass -- im_sharpen() won't use Vector, since it normalises to 100 and will clip - - try using a smaller norm factor in sharpen, and maybe nip2 as well for sep - conv gen there? +- try using a smaller norm factor in nip2 for sep conv gen there? - Lan's c4_stats.ws is broken, I guess due to vector stuff - how much time are we spending setting sources by name, profile! +- morph benchmarks: + $ time vips --vips-novector im_dilate wtc1bit.v wtc2.v morph.mor + real 0m0.727s + user 0m0.730s + sys 0m0.290s + $ time vips im_dilate wtc1bit.v wtc2.v morph.mor + real 0m0.453s + user 0m0.150s + sys 0m0.260s + $ -- test fits reader more ... colour? - - + update News section of the vips website, when it comes back - maybe im_draw_smudge() is too slow :-( also, we had a sanity failure with it, argh diff --git a/libvips/convolution/im_sharpen.c b/libvips/convolution/im_sharpen.c index 38dc176c..70aba1af 100644 --- a/libvips/convolution/im_sharpen.c +++ b/libvips/convolution/im_sharpen.c @@ -208,9 +208,9 @@ sharpen_mask_new( int radius ) im_free_imask( base ); #ifdef DEBUG -#endif /*DEBUG*/ printf( "sharpen_mask_new: created mask:\n" ); im_print_imask( line ); +#endif /*DEBUG*/ return( line ); } diff --git a/libvips/morphology/morphology.c b/libvips/morphology/morphology.c index 64339355..aca920a9 100644 --- a/libvips/morphology/morphology.c +++ b/libvips/morphology/morphology.c @@ -782,7 +782,7 @@ im_dilate( IMAGE *in, IMAGE *out, INTMASK *mask ) im_embed( in, t1, 1, mask->xsize / 2, mask->ysize / 2, in->Xsize + mask->xsize - 1, in->Ysize + mask->ysize - 1 ) || - morphology( in, out, mask, DILATE ) ) + morphology( t1, out, mask, DILATE ) ) return( -1 ); out->Xoffset = 0; @@ -813,7 +813,7 @@ im_erode( IMAGE *in, IMAGE *out, INTMASK *mask ) im_embed( in, t1, 1, mask->xsize / 2, mask->ysize / 2, in->Xsize + mask->xsize - 1, in->Ysize + mask->ysize - 1 ) || - morphology( in, out, mask, ERODE ) ) + morphology( t1, out, mask, ERODE ) ) return( -1 ); out->Xoffset = 0;