{"id":23288363,"url":"https://github.com/sebrovater/pycvutils","last_synced_at":"2026-04-30T14:37:33.484Z","repository":{"id":181160034,"uuid":"655284454","full_name":"SEBROVATER/PyCVutils","owner":"SEBROVATER","description":"A bunch of useful wrappers around opencv-python library","archived":false,"fork":false,"pushed_at":"2025-02-05T13:24:39.000Z","size":107,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-29T05:04:14.423Z","etag":null,"topics":["computer-vision","cv","opencv","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SEBROVATER.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-18T12:54:44.000Z","updated_at":"2025-02-05T13:24:42.000Z","dependencies_parsed_at":"2024-11-02T02:32:15.462Z","dependency_job_id":null,"html_url":"https://github.com/SEBROVATER/PyCVutils","commit_stats":null,"previous_names":["sebrovater/cv_utils","sebrovater/pycvutils"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SEBROVATER/PyCVutils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SEBROVATER%2FPyCVutils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SEBROVATER%2FPyCVutils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SEBROVATER%2FPyCVutils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SEBROVATER%2FPyCVutils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SEBROVATER","download_url":"https://codeload.github.com/SEBROVATER/PyCVutils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SEBROVATER%2FPyCVutils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32468009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","cv","opencv","python"],"created_at":"2024-12-20T03:17:00.047Z","updated_at":"2026-04-30T14:37:33.464Z","avatar_url":"https://github.com/SEBROVATER.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyCVutils\nA bunch of useful wrappers around opencv-python library\n\n### Installation:\n\n`pip install pycvutils`\n\nYou can install `opencv` separately. But just for fun, some extra options exist:\n\n`pip install pycvutils[opencv]` - adds `opencv-python` as a subdependency.\n\n`pip install pycvutils[headless]` - adds `opencv-python-headless` as a subdependency.\n\n`pip install pycvutils[contrib]` - adds `opencv-contrib-python` as a subdependency.\n\n`pip install pycvutils[contrib-headless]` - adds `opencv-contrib-python-headless` as a subdependency.\n\n\u003e Be aware that different `opencv` versions are incompatible with each other.\n\n\n### Examples:\n\nLet's work with such binary image:\n\n![face_large.png](docs%2Fimg_samples%2Fface_large.png)\n\n```Python\nimport cv2\nfrom pycvutils import convert\nfrom pycvutils.blobs import get_bright_rect\n\nface_img = cv2.imread(\"docs/img_samples/face.png\")\nassert get_bright_rect(face_img) == (1, 2, 10, 7)\n\n# works with 3 channels arrays and boolean arrays too\nface_img = convert.bgr_to_gray(face_img)\nassert get_bright_rect(face_img) == (1, 2, 10, 7)\n```\n\n```Python\nimport cv2\nfrom pycvutils.blobs import get_all_borders\n\nface_img = cv2.imread(\"docs/img_samples/face.png\", flags=cv2.IMREAD_GRAYSCALE)\nface_img = face_img.any(axis=0)\nassert tuple(get_all_borders(face_img)) == ((3, 6), (7, 10))\n```\n\n```Python\nimport cv2\nfrom pycvutils.brightness import crop_bright_area_and_pad\n\nface_img = cv2.imread(\"docs/img_samples/face.png\")\n# useful for colored images\nassert crop_bright_area_and_pad(face_img, pad_size=5).shape == (15, 19, 3)\n```\n\n![face_crop_pad.png](docs%2Fimg_samples%2Fface_crop_pad.png)\n\n\n```Python\nimport cv2\nfrom pycvutils.brightness import has_any_bright_border, has_any_bright_corner\n\nface_img = cv2.imread(\"docs/img_samples/face.png\")\n# returns True if any border has non-zero pixel\nassert not has_any_bright_border(face_img)\n# returns True if any corner pixel is non-zero\nassert not has_any_bright_corner(face_img)\n```\n\n```Python\nimport cv2\nfrom pycvutils.channels import split_view\n\nface_img = cv2.imread(\"docs/img_samples/face.png\")\n# works like cv2.split, but returns views instead of copies\nviews = split_view(face_img)\nassert isinstance(views, tuple)\nassert len(views) == 3\nassert (views[0].base == face_img).all()  # 'is' doesn't work for some reason\n```\n\n```Python\nimport cv2\nfrom pycvutils.filling import brighten_areas_near_borders, flood_fill_binary\n\nface_img = cv2.imread(\"docs/img_samples/face.png\", flags=cv2.IMREAD_GRAYSCALE)\n# wrapper around cv2.floodFill\nassert (flood_fill_binary(face_img, x_y=(1, 1)) == 255).all()\n# fills with white any black area touching borders of image\nassert (brighten_areas_near_borders(face_img) == 255).all()\n```\n\n```Python\nimport cv2\nfrom pycvutils.matching import compare_one_to_one, compare_with_crop\n\nface_img = cv2.imread(\"docs/img_samples/face.png\")\ntemplate = face_img[5:-2, 6:-2]\n\n# makes small crop before making comparison\nassert compare_with_crop(face_img, template, crop_ratio=0.1) == 1.0\n# resize template to size of original img before making comparison\nassert compare_one_to_one(face_img, template) != 1.0\n```\n\n```Python\nimport cv2\nfrom pycvutils import padding\n\nface_img = cv2.imread(\"docs/img_samples/face.png\", flags=cv2.IMREAD_GRAYSCALE)\n\npadded = padding.unequal(face_img, value=125, top=2, left=2, right=1)\nassert padded.shape[0] == face_img.shape[0] + 2\nassert padded.shape[1] == face_img.shape[1] + 3\n```\n\n![face_padded.png](docs%2Fimg_samples%2Fface_padded.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebrovater%2Fpycvutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsebrovater%2Fpycvutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebrovater%2Fpycvutils/lists"}