{"id":17193717,"url":"https://github.com/ankitdhall/vanishing-point-detector","last_synced_at":"2025-04-13T19:31:48.065Z","repository":{"id":36648885,"uuid":"40955177","full_name":"ankitdhall/Vanishing-Point-Detector","owner":"ankitdhall","description":"Vanishing Point detection for images and videos using Least Squares in C++","archived":false,"fork":false,"pushed_at":"2017-07-28T13:53:09.000Z","size":9,"stargazers_count":76,"open_issues_count":0,"forks_count":18,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-27T10:21:20.017Z","etag":null,"topics":["detector","image-analysis","image-processing","least-square-regression","least-squares","linear-algebra","regression","vanishing-points","vector","video"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ankitdhall.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-18T06:37:30.000Z","updated_at":"2024-11-20T18:26:22.000Z","dependencies_parsed_at":"2022-09-21T06:46:18.653Z","dependency_job_id":null,"html_url":"https://github.com/ankitdhall/Vanishing-Point-Detector","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankitdhall%2FVanishing-Point-Detector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankitdhall%2FVanishing-Point-Detector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankitdhall%2FVanishing-Point-Detector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankitdhall%2FVanishing-Point-Detector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ankitdhall","download_url":"https://codeload.github.com/ankitdhall/Vanishing-Point-Detector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248767954,"owners_count":21158563,"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":["detector","image-analysis","image-processing","least-square-regression","least-squares","linear-algebra","regression","vanishing-points","vector","video"],"created_at":"2024-10-15T01:44:48.417Z","updated_at":"2025-04-13T19:31:47.749Z","avatar_url":"https://github.com/ankitdhall.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vanishing Point Detection using Least Squares\n\n![](https://cloud.githubusercontent.com/assets/8938083/9835917/7c594192-5a1f-11e5-986f-5877b56e1fe6.png)  \n\nDetector on sample footage.  \nRed colored lines were considered for estimating the vanishing point. The black circle marks the region of interest, where the center of the circle is the approximate vanishing point.\n\n1. [Dependencies](#dependencies)\n2. [Speed](#speed)\n3. [Algorithm](#algorithm)  \n\n\n### Citing `Vanishing-Point-Detector`\nPlease cite our work if `Vanishing-Point-Detector` and our approach helps your research.  \n\n```\n@Misc{Vanishing-Point-Detector,\n  author = {{Dhall*}, A. and {Chandak*} Y.}\n  title = \"{Vanishing Point Detection using Least Squares}\",\n  howpublished = {\\url{https://github.com/ankitdhall/Vanishing-Point-Detector}},\n  year = {2015}\n}\n```\n\n## Dependencies\n* OpenCV for C++\n* Armadillo\n\n## Speed\nAverage performance: 21 fps\n\n## Algorithm\n* The algorithm starts by computing `dx` and `dy` of the image.\nThen the edge vectors are formed which encodes the direction\nand magnitude at each pixel.  \n\n* This field is segmented into connected regions of pixels that\nshare the same vector direction up to a certain tolerance.  \n\n* The principal axis of the bounding box enclosing this region\ngives a single pixel thick straight line. Then, `x`, `y` co-ordinates of\neither ends are stored.  \n\n* Then the lines are converted to the `ax + by = c` form.  \n\n* These co-efficients `(a, b, c)` are stored in the matrix `A`, `B` in the\nfollowing format:  \n```\n     A = [a1 b1  \n          a2 b2  \n            ..  \n            ..  \n         an bn]    \n     B = [c1 c2 ... cn ]'  \n```\n* Solve for vector `X` in `AX = B` with the concept of least\nsquare approximation of the answer. Where `X = [x y] T`\n\n* For each pair of lines in the matrix A, their point of intersection\n`X’ = [x y] T` is found. This is multiplied with the matrix `A` and\nthen `B` is subtracted to get the error vector `E`.\n```\n    E = AX’ – B\n```\n* The squared sum of error vector is computed and whichever\n`X’` gave the least summation of errors is chosen as the\nvanishing point in the image.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fankitdhall%2Fvanishing-point-detector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fankitdhall%2Fvanishing-point-detector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fankitdhall%2Fvanishing-point-detector/lists"}