{"id":15938334,"url":"https://github.com/nelson-gon/pyautocv","last_synced_at":"2025-03-25T07:31:07.373Z","repository":{"id":51769947,"uuid":"249137364","full_name":"Nelson-Gon/pyautocv","owner":"Nelson-Gon","description":"(Semi) Automated Image Processing","archived":false,"fork":false,"pushed_at":"2022-08-10T20:08:31.000Z","size":36092,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-08T05:21:51.267Z","etag":null,"topics":["computer-vision","edge-detection","filters","image-analysis","image-classification","image-clustering","image-processing","image-recognition","image-segmentation","imagedata","laplace","object-detection","pypi","python-package","python3","segmentation","sobel-filter","thresholded-binary","thresholding"],"latest_commit_sha":null,"homepage":"https://pyautocv.readthedocs.io/en/latest/","language":"Python","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/Nelson-Gon.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-22T07:52:51.000Z","updated_at":"2022-01-02T20:05:21.000Z","dependencies_parsed_at":"2022-08-27T05:40:34.057Z","dependency_job_id":null,"html_url":"https://github.com/Nelson-Gon/pyautocv","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nelson-Gon%2Fpyautocv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nelson-Gon%2Fpyautocv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nelson-Gon%2Fpyautocv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nelson-Gon%2Fpyautocv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nelson-Gon","download_url":"https://codeload.github.com/Nelson-Gon/pyautocv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222047565,"owners_count":16922196,"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":["computer-vision","edge-detection","filters","image-analysis","image-classification","image-clustering","image-processing","image-recognition","image-segmentation","imagedata","laplace","object-detection","pypi","python-package","python3","segmentation","sobel-filter","thresholded-binary","thresholding"],"created_at":"2024-10-07T05:21:59.391Z","updated_at":"2024-10-29T12:41:35.718Z","avatar_url":"https://github.com/Nelson-Gon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# (Semi) Automated Image Processing with pyautocv\n\n[![PyPI version fury.io](https://badge.fury.io/py/pyautocv.svg)](https://pypi.python.org/pypi/pyautocv/)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3766956.svg)](https://doi.org/10.5281/zenodo.3766956)\n![Stage](https://www.repostatus.org/badges/latest/active.svg) \n![Actions](https://github.com/Nelson-Gon/pyautocv/workflows/Test-Package/badge.svg)\n[![Codecov](https://codecov.io/gh/Nelson-Gon/pyautocv/branch/master/graph/badge.svg)](https://codecov.io/gh/Nelson-Gon/pyautocv?branch=master)\n[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Nelson-Gon/pyautocv/blob/master/LICENSE)\n[![Documentation Status](https://readthedocs.org/projects/pyautocv/badge/?version=latest)](https://pyautocv.readthedocs.io/en/latest/?badge=latest)\n[![PyPI license](https://img.shields.io/pypi/l/pyautocv.svg)](https://pypi.python.org/pypi/pyautocv/)\n[![Total Downloads](https://pepy.tech/badge/pyautocv)](https://pepy.tech/project/pyautocv)\n[![Monthly Downloads](https://pepy.tech/badge/pyautocv/month)](https://pepy.tech/project/pyautocv)\n[![Weekly Downloads](https://pepy.tech/badge/pyautocv/week)](https://pepy.tech/project/pyautocv)\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/Nelson-Gon/pyautocv/graphs/commit-activity)\n[![GitHub last commit](https://img.shields.io/github/last-commit/Nelson-Gon/pyautocv.svg)](https://github.com/Nelson-Gon/pyautocv/commits/master)\n[![GitHub issues](https://img.shields.io/github/issues/Nelson-Gon/pyautocv.svg)](https://GitHub.com/Nelson-Gon/pyautocv/issues/)\n[![GitHub issues-closed](https://img.shields.io/github/issues-closed/Nelson-Gon/pyautocv.svg)](https://GitHub.com/Nelson-Gon/pyautocv/issues?q=is%3Aissue+is%3Aclosed)\n\n\n**Project Aims**\n\nThe goal of `pyautocv` is to provide a simple computer vision(cv) workflow that enables one to automate \nor at least reduce the time spent in image (pre)-processing. \n\n**Installing the package**\n\nFrom PyPI\n\n```shell\n\npip install pyautocv\n\n```\nFrom GitHub\n\n```shell\npip install git+https://github.com/Nelson-Gon/pyautocv.git\n#or\n# clone the repo\ngit clone https://www.github.com/Nelson-Gon/pyautocv.git\ncd pyautocv\npython3 setup.py install\n\n```\n\n\n\n**Example Usage**\n\n**Note**: Although these methods can be run via this script, the script is less flexible and might be useful for quick\nexploration but not extended analysis. \n\n\nTo run the script at the  commandline, we can do the following\n\n```shell\n\npython -m pyautocv -d \"images/cats\" -s \"png\" -m \"thresh_to_zero\" -o \"threshold\" -mt 200 -t 100\n\n```\n\nSample Result\n\n![Command Line Script](https://github.com/Nelson-Gon/pyautocv/blob/master/sample_results/sample_script.png?raw=true)\n\n\nTo perform edge detection\n\n```shell\n\npython -m pyautocv -d \"images/biology\" -s \"jpg\" -o \"detect_edges\" -m \"sobel_vertical\" -k 3\n```\n\n![Bio Script](https://github.com/Nelson-Gon/pyautocv/blob/master/sample_results/bioscript.png?raw=true)\n\n\nTo smooth images\n\n```shell\npython -m pyautocv -d \"images/houses\" -s \"jpg\" -o \"smooth\" -m \"gaussian\" -k 5 5 --sigma 0.7\n```\n\n![Houses Smooth](https://github.com/Nelson-Gon/pyautocv/blob/master/sample_results/houses_smooth.png?raw=true)\n\nTo get help\n\n```shell\n\npython -m pyautocv -h \n\n\n\n```\n\nFurther exploration is left to the user.\n\n---\n\nThe following section shows how to use the more flexible class/methods approach\n\n* Image Gra(e)ying\n\nTo grey an image directory\n\n```python\nfrom pyautocv.segmentation import Segmentation, gray_images, show_images\n\nimages_list=Segmentation(\"images/cats\")\nshow_images(gray_images(images_list.read_images()), images_list.read_images(), number=2)\n\n```\n![Grayed](https://github.com/Nelson-Gon/pyautocv/blob/master/sample_results/cats_gray.png?raw=true)\n\n* Smoothing\n\nTo smooth a directory of images, we can use `EdgeDetection`'s `smooth` method as\nfollows\n\n```python\n\nimages_list=Segmentation(\"images/cats\")\nshow_images(images_list.smooth(), images_list.read_images(),number=2)\n\n```\n\nThis will give us\n\n![Smooth](https://github.com/Nelson-Gon/pyautocv/blob/master/sample_results/cats_smooth.png?raw=true)\n\nThe above uses default parameters including an `rgb` color mode. For biological images which are often in \ngrayscale, one can set `color_mode` to gray as shown below. All other operations will remain the same.\n\n```python\nimages_list_gray_mode=Segmentation(\"images/dic\", image_suffix =\"tif\", color_mode = \"gray\")\nshow_images(images_list_gray_mode.read_images(), images_list_gray_mode.threshold_images(), number = 4)\n```\n\nResult\n\n![Sample Gray](https://github.com/Nelson-Gon/pyautocv/blob/master/sample_results/gray_mode.png?raw=true)\n\n\nTo use a different filter\n\n```python\n\nimages_list = Segmentation(\"images/cats\")\nshow_images(images_list.read_images(), images_list.smooth(mask=\"median\", kernel_shape=(7, 7)))\n\n```\n\n![Cats-Median-Smooth](https://github.com/Nelson-Gon/pyautocv/blob/master/sample_results/cat_median_smooth.png?raw=true)\n\n\n* Edge Detection \n\nTo detect edges in a directory of images, we can use `Segmentation`'s `detect_edges`. \n\n```python\n\nshow_images(images_list.read_images(), images_list.detect_edges(operator=\"roberts\", mask=\"gaussian\", sigma=0.8))\n\n```\n\nThe above will give us the following result\n\n\n![Sample_colored](https://github.com/Nelson-Gon/pyautocv/blob/master/sample_results/cats_gauss_edge.png?raw=true)\n\n\nTo use a different filter e.g Laplace,\n\n```python\n\nshow_images(images_list.read_images(), images_list.detect_edges(operator=\"laplace\", mask=\"gaussian\", sigma=0))\n\n```\n\nThis results in\n\n![Laplace](https://github.com/Nelson-Gon/pyautocv/blob/master/sample_results/cats_laplace_gaussian.png?raw=true)\n\n\n\n* Thresholding\n\nTo perform thresholding, we can use the method `threshold_images`.\n\n\n\n```python\nto_threshold = Segmentation(\"images/biology\")\nshow_images(to_threshold.read_images(),to_threshold.threshold_images())\n\n```\n\n![Threshold](https://github.com/Nelson-Gon/pyautocv/blob/master/sample_results/bio_thresh.png?raw=true)\n\nTo use a different thresholding method.\n\n```python\n\nshow_images(to_threshold.read_images(),to_threshold.threshold_images(threshold_method=\"otsu\"))\n\n```\n\nThe above gives us:\n\n![otsu](https://github.com/Nelson-Gon/pyautocv/blob/master/sample_results/bio_thresh_otsu.png?raw=true)\n\nFor cat lovers, here's thresholding with inverse binary.\n\n```python\n\nshow_images(images_list.read_images(),images_list.threshold_images(threshold_method=\"binary_inverse\"))\n\n```\n\nResult:\n\n![Cats](https://github.com/Nelson-Gon/pyautocv/blob/master/sample_results/cats_bin_inverse.png?raw=true)\n\n\n\nThresholding applied to images of houses.\n\n```python\nimages_list=Segmentation(\"images/houses\")\nshow_images(images_list.read_images(), images_list.threshold_images(threshold_method=\"thresh_to_zero\"))\n```\n\n![Threshold-Houses](https://github.com/Nelson-Gon/pyautocv/blob/master/sample_results/houses_thresh.png?raw=true)\n\n```python\nimages_list=Segmentation(\"images/potholes\")\nshow_images(images_list.read_images(), images_list.threshold_images(\"binary\"))\n```\n\n![Potholes](https://github.com/Nelson-Gon/pyautocv/blob/master/sample_results/potholes.png?raw=true)\n\n\nThese and more examples are available in [example.py](https://github.com/Nelson-Gon/pyautocv/blob/1bc67af448ea0bab00ea7223354619f7e9a5d42c/examples/example.py). Image sources are\nshown in `sources.md`. If you feel attribution was not made, please file an issue and cite the violating image.\n\n\n\n\n**Citation**\n\nNelson Gonzabato(2021) pyautocv: (Semi) Automated Image Processing, https://github.com/Nelson-Gon/pyautocv.\n\n\n```shell\n@misc {Gonzabato2021,\nauthor = {Gonzabato, N},\ntitle = {pyautocv: (Semi) Automated Image Processing},\nyear = {2021},\npublisher = {GitHub},\njournal = {GitHub repository},\nhowpublished = {\\url{https://github.com/Nelson-Gon/pyautocv}},\ncommit = {7fe2e0f7894e8be4588a22758e8097c247cd1cd9}\n\n```\n\n\u003eThank you very much\n\n\u003e “A language that doesn't affect the way you think about programming is not worth knowing.”\n― Alan J. Perlis\n\n\n---\n\n**References**\n\n* [Bebis](https://www.cse.unr.edu/~bebis/CS791E/Notes/EdgeDetection.pdf)\n\n* [Standford, author unknown](https://ai.stanford.edu/~syyeung/cvweb/tutorial3.html)\n\n* [Funkhouser et al.,2013](https://www.cs.princeton.edu/courses/archive/fall13/cos429/lectures/05-segmentation1)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnelson-gon%2Fpyautocv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnelson-gon%2Fpyautocv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnelson-gon%2Fpyautocv/lists"}