-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example for working with hough lines output #138
Comments
Hello, do you have the sample image anywhere? I had a look on the gist, but the dropbox link there is 404-ing for me. |
The docs for http://jcupitt.github.io/libvips/API/current/libvips-arithmetic.html#vips-hough-line I'll try making a sample program. |
Here's a nip2 workspace which demonstrates the libvips hough line transform. You can drag the sliders in the first column to plot a line, then read out the detected line from the last column. https://gist.github.com/jcupitt/4e1593641a24655031080dbad52190df |
Thanks for this. I managed to get a little further with the example and I've fixed the link to the example image which is here: https://dl.dropboxusercontent.com/s/qiayht1abl3ctyv/29_hough.png Running the following example program:
I get the following output image: Where I'm a little confused is that I'd like to extract multiple lines from the output. A few questions I had while working on this:
For that output, is there an easy way of saying which of those is "line angle" and which is "distance from the origin"?
I'm very sorry to take your time with this - feel free to close this out if it's too much trouble. |
Hi, don't worry, discussing Hough transforms is much more fun than the work I ought to be doing.
I wouldn't use PNG: lots of your counts will be truncated at 255 (or 65535). Use a smaller param space and save as TIFF (it supports int32 pixels). I'd use nip2 for looking at the results: it can display image with huge ranges. Doubleclick on an image to open a view window, then View / Toolbar / Display control to add some sliders. Drag the left slider to set the view scale. Click on the settings button next to the left slider to turn on false colour: it'll make seeing peaks easy. |
Do you have the sample image without the red lines? |
Apologies for the delayed response. This one is likely to take me a while to work on! GitHub won't let me upload a tif of the original directly but it's on Dropbox here: https://www.dropbox.com/s/r99wbjq1iym8zye/output2014-000.tif?dl=0 |
I've been looking at this again. I've improved the hough_line operator and I'm now adding a canny edge detector. Hopefully the two of them plus a bit of ruby should do the job. |
I've been doing some work with hough line transforms in ImageMagick to try to identify and segment tables in scanned documents. This is working great so far with the following output:
You can see the red lines where the hough transform has been applied to the original image.
In the interests of doing this on a larger scale in a more efficient way I'd love to benchmark this against an equivalent vips implementation, but I'm having a hard time working out what to do with the output of the
hough_lines
command. So far I have:At this point I'd like to use the output from
hough_line
(assuming it has found the lines) to draw, say, 5px wide red lines onto the original image so that I can validate it. After that point I'd be aiming to segment the image based on those coordinates.If there's any existing documentation or pointers you could offer I'd really appreciate it. The final aim with this is to make some open data relating to company ownership but that's a long way off yet! Thanks in advance.
p.s. my (very bad) image magick code is here for reference https://gist.github.com/xavriley/cda9ddd393ad43676b64
The text was updated successfully, but these errors were encountered: