From my experience change from `ang` to `n*theta` will slightly shift the output of algorithm. Also please see my commit 16687a2 - casting to double is needed to make results consistent between all platforms. Our tests have identified the problem only for case of simple version by I think that the same is applicable for all variations of hough.