{"id":20485894,"url":"https://github.com/sangamprashant/document-scanner","last_synced_at":"2025-03-05T16:29:22.347Z","repository":{"id":226808563,"uuid":"769692527","full_name":"sangamprashant/Document-Scanner","owner":"sangamprashant","description":"The Document Scanner is a Python project that automates the process of enhancing poorly scanned documents. It detects document corners, applies perspective transformation, sharpens the image, and enhances readability using OpenCV.","archived":false,"fork":false,"pushed_at":"2024-03-10T12:36:51.000Z","size":5441,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-16T04:43:23.215Z","etag":null,"topics":["document-scanner","documet","opencv","python","scan","scanner"],"latest_commit_sha":null,"homepage":"","language":"Python","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/sangamprashant.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-09T19:36:40.000Z","updated_at":"2024-09-07T12:58:01.000Z","dependencies_parsed_at":"2024-11-15T16:44:32.929Z","dependency_job_id":null,"html_url":"https://github.com/sangamprashant/Document-Scanner","commit_stats":null,"previous_names":["sangamprashant/document-scanner"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sangamprashant%2FDocument-Scanner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sangamprashant%2FDocument-Scanner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sangamprashant%2FDocument-Scanner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sangamprashant%2FDocument-Scanner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sangamprashant","download_url":"https://codeload.github.com/sangamprashant/Document-Scanner/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242060856,"owners_count":20065620,"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":["document-scanner","documet","opencv","python","scan","scanner"],"created_at":"2024-11-15T16:34:07.489Z","updated_at":"2025-03-05T16:29:22.320Z","avatar_url":"https://github.com/sangamprashant.png","language":"Python","readme":"# Document Scanner\n\n### An interactive document scanner built in Python using OpenCV\n\nThe scanner takes a poorly scanned image, finds the corners of the document, applies the perspective transformation to get a top-down view of the document, sharpens the image, and applies an adaptive color threshold to clean up the image.\n\n#### Here are some examples of images before and after scan:\n\n\u003cimg src=\"./images/image1.png\"\u003e\n\n## Usage\n\n### clone the project \n```\ngit clone https://github.com/sangamprashant/Document-Scanner.git\n```\n\n### Without input\n\n```\npython scan.py (--images \u003cIMG_DIR\u003e | --image \u003cIMG_PATH\u003e) [-i]\n```\n\n- The `-i` flag enables interactive mode, where you will be prompted to click and drag the corners of the document. For example, to scan a single image with interactive mode enabled:`python scan.py --image uploads/sam.jpg -i`\n\n![alt text](images/image2.png)\n\n- Alternatively, to scan all images in a directory without any input:\n  `python scan.py --image uploads/sam.jpg`\n  check the output folder.\n\n### With Inputs\n\nCreate a virtual environment:\n`python -m venv \u003cenv-name\u003e`\nActivate the virtual environment:\n\n```\ncd \u003cenv-name\u003e/Scripts\n.\\activate\ncd ../..\n```\n\nInstall the requirements:\n\n```\npip install -r requirements.txt\n```\n\nRun the server :\n\n```\npython main.py\n```\n\n- Open index.html in a browser and ensure that the path to the server is correct.\n- Select the image to upload and see the magic happen.\n\n\u003cimg src=\"./images/before_after.gif\"\u003e\n\n\n# Links\n\n* [live link](https://sangamprashant.github.io/Document-Scanner/)\n\u003chr\u003e\n\n- output [server link](https://document-scanner-5nnp.onrender.com/) + response.data.result_path\n- imput [server link](https://document-scanner-5nnp.onrender.com/scan)\n\n![](./images/image3.png)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsangamprashant%2Fdocument-scanner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsangamprashant%2Fdocument-scanner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsangamprashant%2Fdocument-scanner/lists"}