diff --git a/TODO b/TODO index edc4b583..3b17676d 100644 --- a/TODO +++ b/TODO @@ -1,11 +1,13 @@ - python: - - try + - draw_circle() etc. should copy() the image before writing, and + return the copy - python test_arithmetic.py -v TestArithmetic.test_histfind + accidental segvs are too easy otherwise :( - segv + draw.c should declare arg as VIPS_ARGUMENT_REQUIRED_INPUT_OUTPUT + maybe? - could import like this: diff --git a/libvips/arithmetic/hough_circle.c b/libvips/arithmetic/hough_circle.c index f084c5e1..620345e1 100644 --- a/libvips/arithmetic/hough_circle.c +++ b/libvips/arithmetic/hough_circle.c @@ -262,7 +262,7 @@ vips_hough_circle_class_init( VipsHoughClass *class ) static void vips_hough_circle_init( VipsHoughCircle *hough_circle ) { - hough_circle->scale = 3; + hough_circle->scale = 1; hough_circle->min_radius = 10; hough_circle->max_radius = 20; } diff --git a/python/test_arithmetic.py b/python/test_arithmetic.py index f79ebb37..77dc3059 100755 --- a/python/test_arithmetic.py +++ b/python/test_arithmetic.py @@ -342,5 +342,21 @@ class TestArithmetic(unittest.TestCase): self.assertAlmostEqualObjects(hist.getpoint(0,0), [0]) self.assertAlmostEqualObjects(hist.getpoint(1,0), [50000]) + def test_histfind_ndim(self): + im = Vips.Image.black(100, 100) + [1, 2, 3] + + for fmt in noncomplex_formats: + hist = im.cast(fmt).hist_find_ndim() + + self.assertAlmostEqualObjects(hist.getpoint(0,0)[0], 10000) + self.assertAlmostEqualObjects(hist.getpoint(5,5)[5], 0) + + hist = im.cast(fmt).hist_find_ndim(bins = 1) + + self.assertAlmostEqualObjects(hist.getpoint(0,0)[0], 10000) + self.assertEqual(hist.width, 1) + self.assertEqual(hist.height, 1) + self.assertEqual(hist.bands, 1) + if __name__ == '__main__': unittest.main()