Talk:Hough transform

From Rosetta Code
Revision as of 19:40, 9 August 2010 by MikeMol (talk | contribs) (→‎Can I get some pseudo-code...and possibly an amen: A little clarification on multiple counts.)

Can I get some pseudo-code...and possibly an amen

I have read about the Hough Transform in an attempt to create a MATLAB implementation, but every resource I use has a different take on this transform. The background theory is the same, but the algorithms that I have seen are different. Even the TCL and C implementations on this site are somewhat different from some other implementations I have found. Can we possibly get some solid pseudo-code to implement to make sure any other solutions provided in different languages conform to some standard specification? Because, at this point, my MATLAB implementation is not going to come close to resembling the algorithm implemented in TCL and C. Can I get an Amen?!--Chris Ferri

Not really. What's important at the surface is that the inputs match and the outputs match. How different examples achieve this will vary by how the problem best maps to each language. MATLAB's implementation should differ, because MATLAB looks at mathematical problems differently from TCL or C. Though, yes, we definitely need more examples. --Michael Mol 18:35, 9 August 2010 (UTC)
But, I thought the point of Rosetta Code was to be able to compare implementations of a common task between languages. I understand that this definition doesn't invalidate your response, but I don't see the point of not specifying a pseudo-code to implement. It would be much easier for: not only novices trying to figure out how to do something using the solutions as examples, but also developers who are confused about how to implement this particular algorithm, if there were pseudo-code to refer to. I say this especially since my implementation requires an "edge-detected" version of the image as the input (a boolean array where the array member at the index of an "edge" pixel is true). And, from what I can tell, the TCL and C solutions don't. So, I am not exactly sure what is going on in those algorithms which allows them to produce valid output. This is why pseudo-code is important.--Chris Ferri
The problem is that pseudocode makes assumptions about implementation. I can write pseudocode that says "do this, then do this, then do this", but that tends to assume an imperative programming paradigm. It may be possible to have a universal pseudocode, but I doubt it. This is what I got the last time I poked around for one. That doesn't leave me hopeful. I've seen what happens when someone creates procedural pseudocode as part of a task description, assuming that it was part and parcel to what the task was supposed to accomplish, and then I've had to deal with reconciling the task's description against its intent and the languages which it accidentally made things structurally difficult for.
As I understand it, Hough depends a great deal on averaging values, which is going to be very difficult if you're only allowing yourself 1 bit of precision. You might try expanding that 1 bit to a larger range (i.e. an integer 0 for false, 255 for true, or a float type with 0 for false, 1 for true) before doing your operations, and then compressing back down to 1 bit prior to output. I'd make suggestions about how to choose range size, but I think that depends a great deal on your use case.) --Michael Mol 19:40, 9 August 2010 (UTC)

PNG Image

I have a small png file available (320x240)to use with this task, created with Inkscape, but I don't know how to upload it to the site. --Rldrenth 21:01, 21 January 2010 (UTC)

Choose “Upload file” in the “toolbox” sidebar, or by any other means go to Special:Upload. —Kevin Reid 21:25, 21 January 2010 (UTC)
Thanks. --Rldrenth 22:20, 21 January 2010 (UTC)
I had to replace that image; it was done with a transparent background rather than a white one, which is highly unhelpful for this task. –Donal Fellows 00:02, 22 January 2010 (UTC)
Running the current Tcl code gives black in the (lower) unaffected area ("#000000" as default fieldColor); (my C impl does so without chance to change it but recompiling). --ShinTakezou 08:42, 6 August 2010 (UTC)

Expand To Print Peaks

Should we expand the scope so the program to determine the location of peaks in the transformed image and then print then r & theta that correspond to the lines? --Rldrenth 21:01, 21 January 2010 (UTC)

Probably better done as another task that builds on top of this one as locating the peaks is not part of the Hough transform itself. –Donal Fellows 00:02, 22 January 2010 (UTC)

I think I am missing something

How is this useful? If I try and implement this, how can I tell if I have implemented it correctly? I look at the description of the task, and then I look at that result image and I look at the references and I feel like I am missing something. --Rdm 15:37, 19 May 2010 (UTC)

Being a type of transform, I suppose I'd try to use it as part of image fingerprinting. Just a rough idea, one could run the transform, find the median value M, max everything there and above M, drop everything below M, find center points and store their relative positions. (I'd probably go back and adjust M until I had a certain fixed number of center points, or as close to it as possible.) --Michael Mol 18:22, 19 May 2010 (UTC)

I must be missing something. Is there a reason the tcl implementation (the only one at this time) is looping theta through two complete circles? --Coderjoe 17:04, 22 July 2010 (UTC)

Semantic MediaWiki

I'm going to use this task as a guinea pig for the new Semantic MediaWiki features. --Michael Mol 10:07, 27 July 2010 (UTC)

Ok, so looking at it, I'm thinking:
  • satisfies the Hough transform task' is a property of the Tcl code example. There should be a way to make this imply that it satisfies the Hough transform task, but I don't know what it is.
  • uses Tk is a property of the Tcl code example
  • demonstrates (Tcl code example identifier) would be a property of the demonstration code.
  • uses Tk is a property of the demonstration code. I'm sure there's a way to tie the library version range in there, but I don't know what it is.
  • uses TkImg is a property of the demonstration code
  • uses (support image identifier) is a property of that support image
  • supports the Hough transform task is a property of that support image
  • explicitly requires the Hough transform is a property of the Hough Transform task
  • example output of (demonstration code) is a property of that demonstration code's example
Those are the properties I'm seeing. I could use some help figuring out how to apply them. --Michael Mol 10:50, 27 July 2010 (UTC)