Line detection in Java

回眸只為那壹抹淺笑 提交于 2019-12-13 06:59:22

问题


My main goal is to detect the little line over the left of the image:

By detecting line I mean I want a line equation of this form: y = ax + b.

In order to find the line, I tried using this Hough Transform java class, which doesn't return the equation I want but at least supposed to find the line, but what happens is that it does not detect the line I want (it actually locates only the horizontal line in the image, and even this is not perfect. The y cord is located perfectly but the x is missed and started from 0, and as you see the line does not start at x=0).

I do not mind detecting all the lines in the image, but at least I have to detect the line I want, the sole line over the left.

I also don't mind using other method than Hough Transform...

P.S already tried this ImageJ code but it didn't work out for me as well. (I used it as is, maybe it needs to be changed, but I don't really understand what the ParticleAnalyzer does)

来源:https://stackoverflow.com/questions/25360544/line-detection-in-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!