A template that bootstraps a full Randomized Hough transform implementation. The basic primitives required are as follows.
Randomized Hough Transform for lines
1 2 // Load an image from filesystem. 3 Image image = imread("/path/to/image.png"); 4 5 // Calculate edges by use of canny algorithm 6 auto edges = image 7 .sliced 8 .rgb2gray 9 .as!float 10 .slice 11 .conv(gaussian!float(1.0f, 3, 3)) 12 .canny!ubyte(100); 13 14 // Setup RHT line extraction context 15 auto lines = RhtLines().epouchs(50).iterations(250).minCurve(25); 16 17 // Lazily iterate and detect lines in pre-processed image 18 foreach(line; lines(edges)) { 19 // do stuff with lines.. 20 }
For more elaborated module description visit the RHT example.
$(LINK3 http://www.boost.org/LICENSE_1_0.txt, Boost Software License - Version 1.0).
Copyright © 2016, Dmitry Olshansky
Module introduces Randomized Hough Transform implementation.