Jump to content

Hough transform: Difference between revisions

Updated D entry
(Updated D entry)
Line 72:
Image!Gray houghTransform(in Image!Gray im,
in size_t hx=460, in size_t hy=360)
/*pure nothrow*/ in {
assert(im !is null);
assert(hx > 0 && hy > 0);
Line 86:
foreach (immutable y; 0 .. im.ny) {
foreach (immutable x; 0 .. im.nx) {
// if (im[x, y] == Gray.maxwhite) // Not pure.
if (im[x, y] == Gray(255))
continue;
foreach (immutable iTh; 0 .. hx) {
Line 102 ⟶ 101:
 
void main() {
auto im = (new Image!RGB;)
.loadPPM6(im, "Pentagon.ppm")
.rgb2grayImage()
.houghTransform()
Cookies help us deliver our services. By using our services, you agree to our use of cookies.