{"id":21201716,"url":"https://github.com/oleander/ransac-and-hough-transform-java","last_synced_at":"2025-07-10T06:31:56.001Z","repository":{"id":6307687,"uuid":"7542501","full_name":"oleander/ransac-and-hough-transform-java","owner":"oleander","description":"Java implementation of the Hough transform and RANSAC algorithm","archived":false,"fork":false,"pushed_at":"2013-01-25T23:15:10.000Z","size":580,"stargazers_count":6,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-04-10T09:39:52.014Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oleander.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-10T14:41:55.000Z","updated_at":"2020-11-21T00:11:31.000Z","dependencies_parsed_at":"2022-08-27T11:51:15.847Z","dependency_job_id":null,"html_url":"https://github.com/oleander/ransac-and-hough-transform-java","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleander%2Fransac-and-hough-transform-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleander%2Fransac-and-hough-transform-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleander%2Fransac-and-hough-transform-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleander%2Fransac-and-hough-transform-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oleander","download_url":"https://codeload.github.com/oleander/ransac-and-hough-transform-java/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225622846,"owners_count":17498168,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T20:10:43.489Z","updated_at":"2024-11-20T20:10:44.318Z","avatar_url":"https://github.com/oleander.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RANSAC and Hough Transform\n\nJava implementation of the Hough transform and RANSAC algorithm\n\n## RANSAC\n\n- The constructor reads the data points from a text file into a list\n- showCanvas calls execute\n\t- for (maxIter iterations)\n\t\t- The execute method chooses 3 points from the data list at random. Their indices are stored in the concensusSet.\n\t\t- A circle that passes through all 3 points is chosen as the current circle model\n\t\tfor (all points in the data set)\n\t\t\t- getoffset is responsible for calculating the difference between the points and the circumference of the circle\n\t\t\t- Points that are within *threshold* distance are added to the consenus set \n\t\t- The best model so far (as determined by the highest number of points in the consenus set) is kept track on during the iteration\n\t- The best model is returned\n- showCanvas draws the data points, the best circle and the smallest width annulus on a canvas and displays the result to the user\n\n\n### Methods\n\n- (+) showCanvas() *Displays the data points and the calculated circles on a canvas.*\n- (+) execute() *Runs the RANSAC algorithm.*\n- (-) getOffset() *Calculate the distance between a point and the center of a circle*\n- (-) getCircle() *Find the circle that passes through the three given points*\n- (-) getNPoints() *Choose n data points at random* \n\n### Illustrations\n\nPoints from *points.r.data* are being used.\n\n- Cirlces (x, y, r, number of points)\n  - 20, 100, 100, 100\n- Noise: 900 points randomly selected between -200 and 200\n- smallestRadius=92.17273473900397\n- highestRadius=111.01668853035679\n- 18.843953791352817\n\n![PS1](http://i.imgur.com/fs2WgVy.png)\n\n![PS2](http://i.imgur.com/U5HaP7R.png)\n\n![PS3](http://i.imgur.com/RR8M50p.png)\n\n## Hough Transform\n\n- The constructor reads the data points from a text file into a list\n- A wrapped 3D array - the accumulator - is used to store information about potential circles. A circle is identified by pixel ranges for x, y and radius\n- execute()\n\t- for (all points)\n\t\t- all circles that could have *point* on its circumference are calculated\n\t\t- for (all circles)\n\t\t\t- the cell in the accumulator is incremented for the given circle\n- filterNeighbours removes circles that lie too close to each other. Circles with a high count are preferred.\n- showCanvas draws the points and the identified circles \n\nThe smallest width annuli for the Hough circle suffers from some offset problems, possibly caused by rounding errors.\n\n\n### Methods\n\n- (+) execute() *Executes the Hough Transform algorithm.*\n- (+) showCanvas() *Render view based on this.pixels.*\n- (-) getCircles() *Finds every other circle that has @point.getY() and @point.getX() as its center*\n\n### Illustrations\n\nPoints from *points.ht.data* are being used.\n\n- Circles (x, y, r, number of points)\n  - 0, 0, 50, 50\n  - 100, 140, 110, 50\n  - 0, 50, 50, 50\n  - 20, 100, 100, 100\n- Noise: 120 points randomly selected between -200 and 200\n\n![PS1](http://i.imgur.com/rYqX67O.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleander%2Fransac-and-hough-transform-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foleander%2Fransac-and-hough-transform-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleander%2Fransac-and-hough-transform-java/lists"}