{"id":15695908,"url":"https://github.com/0xibra/imagerie","last_synced_at":"2026-05-13T20:34:04.785Z","repository":{"id":37651057,"uuid":"271872006","full_name":"0xIbra/imagerie","owner":"0xIbra","description":"Useful computer vision functions and operations","archived":false,"fork":false,"pushed_at":"2022-06-22T02:15:48.000Z","size":751,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-06T16:18:28.181Z","etag":null,"topics":["computer-vision","image-processing","opencv","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xIbra.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":"2020-06-12T19:09:05.000Z","updated_at":"2020-10-23T10:31:41.000Z","dependencies_parsed_at":"2022-09-15T14:12:58.516Z","dependency_job_id":null,"html_url":"https://github.com/0xIbra/imagerie","commit_stats":null,"previous_names":["ibragim64/imagerie"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/0xIbra/imagerie","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xIbra%2Fimagerie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xIbra%2Fimagerie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xIbra%2Fimagerie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xIbra%2Fimagerie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xIbra","download_url":"https://codeload.github.com/0xIbra/imagerie/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xIbra%2Fimagerie/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265191134,"owners_count":23725266,"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","image-processing","opencv","python"],"created_at":"2024-10-03T19:05:21.747Z","updated_at":"2026-05-11T08:12:02.640Z","avatar_url":"https://github.com/0xIbra.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Imagerie\n========\n\u003e Lightweight python package grouping together useful computer vision functions and operations\n\nThis package was initially created for myself to extract some of the most useful important functions,  \nfrom packages like `scipy`, `skimage`, etc...  \n\nThis was done in order to expose all these very useful computer vision functions,  \nand be able to use them in a **Serverless** environment.\n\nDocumentation\n-------------\n\nPrerequisites\n-------------\nThis package only supports `python3` today.\n\nOnly tested on `python3.6` and `python3.7`\n\nInstallation\n------------\nInstall using pip `pip install imagerie`.\n\nFunctions\n---------\n\n##### [`imagerie.get_rotation(pt1, pt2)`](#)\nReturns the rotation value in degrees between 2 (x,y) points.\n\n##### [`imagerie.order_points(points)`](https://github.com/ibragim64/imagerie/blob/ec9087742d165ecf116856574988874b39274325/imagerie/imagerie.py#L20)\nYou've guessed it, this function simply sorts a list of 4 [x, y] coordinates in a clockwise manner, starting from the top-left.\n\n##### [`imagerie.remove_lonely_small_objects(grayscale)`](https://github.com/ibragim64/imagerie/blob/ec9087742d165ecf116856574988874b39274325/imagerie/imagerie.py#L235)\nThis function removes small white objects from a binary mask.  \n\n##### [`imagerie.remove_smaller_objects(grayscale)`](https://github.com/ibragim64/imagerie/blob/ec9087742d165ecf116856574988874b39274325/imagerie/imagerie.py#L247)\nFinds all contours and removes them all except the biggest one.\n\n##### [`imagerie.biggest_contour(grayscale)`](https://github.com/ibragim64/imagerie/blob/ec9087742d165ecf116856574988874b39274325/imagerie/imagerie.py#L39)\nFinds and retrieves the biggest contour from a grayscale image.\n\n##### [`imagerie.get_biggest_contour(contours)`](https://github.com/ibragim64/imagerie/blob/ec9087742d165ecf116856574988874b39274325/imagerie/imagerie.py#L47)\nSimply retrieves and returns the biggest contour from a given list of contours.\n\n##### [`imagerie.closest_point(point: tuple, points)`](https://github.com/ibragim64/imagerie/blob/ec9087742d165ecf116856574988874b39274325/imagerie/imagerie.py#L62)\nReturns the closest (x, y) point from a given list of (x, y) points/coordinates.\n\n##### [`imagerie_lite.midpoint(ptA, ptB)`](#)\nCalculates the X,Y middle points from provided 2 points.\n\n##### [`imagerie_lite.line_intersection(line1: tuple, line2: tuple)`](#)\nReturns the intersection point between two lines.\n\n##### [`imagerie.get_corners(grayscale, middle_points=False, centroid=False, max_corners=4, quality_level=0.01, min_distance=15)`](https://github.com/ibragim64/imagerie/blob/ec9087742d165ecf116856574988874b39274325/imagerie/imagerie.py#L79)\nReturns the (x, y) coordinates of the 4 corners of a rectangular shaped object from binary mask by default.\nHowever, you can also calculate the top and bottom middle coordinates by providing `middle_points=True`.\nAnd by providint `centroid=True`, you can get the (x, y) coordinates of the center.\n\n##### [`imagerie.warp_perspective(image, src_pts: list, dst_pts: list)`](https://github.com/ibragim64/imagerie/blob/ec9087742d165ecf116856574988874b39274325/imagerie/imagerie.py#L134)\nPerforms a `cv2.warpPerspective()` operation and expects 2 lists of (x, y) corner points of the source \nand destination image.  \n\n##### [`imagerie.warp_homography(image, src_pts: list, dst_pts: list, method=cv2.RANSAC, reproj_threshold=5.0)`](https://github.com/ibragim64/imagerie/blob/ec9087742d165ecf116856574988874b39274325/imagerie/imagerie.py#L149)\nPerforms a `cv2.warpPerspective()` operation after `cv2.findHomography()`.\n\n##### [`imagerie.image_composite_with_mask(to_add: PIL.Image.Image, destination: PIL.Image.Image, mask: PIL.Image.Image)`](https://github.com/ibragim64/imagerie/blob/ec9087742d165ecf116856574988874b39274325/imagerie/imagerie.py#L164)\nCombines the `to_add` and `destination` images, `to_add` image will be added on top of `destination` image\nand only the white area from the `mask` image will be retained from `to_add` image.\n\n##### [`imagerie.combine_two_images_with_mask(background_img, foreground_img, mask)`](https://github.com/ibragim64/imagerie/blob/ec9087742d165ecf116856574988874b39274325/imagerie/imagerie.py#L174)\nCombines the images with the help of the provided mask.\nNote that only the white area of the mask will be selected from the `foreground_img`.\n\n##### [`imagerie.prepare_for_prediction_single(img, shape=(768, 768), as_array=True)`](https://github.com/ibragim64/imagerie/blob/ec9087742d165ecf116856574988874b39274325/imagerie/imagerie.py#L208)\nLoads and resizes a single image to a given shape (default: 768, 768) and returns it by default as a numpy array.\n\n##### [`imagerie.prepare_for_prediction(imgs, shape=(768, 768))`](https://github.com/ibragim64/imagerie/blob/ec9087742d165ecf116856574988874b39274325/imagerie/imagerie.py#L222)\nDoes the same thing as `imagerie.prepare_for_prediction_single` but for multiple images.\n\n##### [`imagerie.fill_holes(gray_img: ndarray, min=200, max=255)`](https://github.com/ibragim64/imagerie/blob/ec9087742d165ecf116856574988874b39274325/imagerie/imagerie.py#L261)\nFills black pixel holes that reside inside of a binary object.  \n\n\u003e `min` represents the `thresh` used in `cv2.threshold(gray, thresh=200, ...)`.  \n\u003e\n\u003e `max` represents the `maxval` used in `cv2.threshold(gray, maxval=255, ...)`.\n\n##### [`imagerie.img_as_uint(img)`](https://github.com/ibragim64/imagerie/blob/ec9087742d165ecf116856574988874b39274325/imagerie/operations/img.py#L226)\nConverts image to 16 bit unsigned integer format.\n\n##### [`imagerie.img_as_float(img)`](https://github.com/ibragim64/imagerie/blob/ec9087742d165ecf116856574988874b39274325/imagerie/operations/img.py#L233)\nConvert an image to floating point format.\n\n##### [`imagerie.normalize_binary_img(img: np.ndarray)`](https://github.com/ibragim64/imagerie/blob/97b21586a8928a75870d71ac25a43f85e83489f8/imagerie/imagerie.py#L343)\nVery useful when re-converting a predicted binary mask img to original grayscale format.\n\nCredits\n-------\n - [Ibragim Abubakarov](https://www.ibragim.fr) \u003c[ibragim.ai95@gmail.com](mailto:ibragim.ai95@gmail.com)\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xibra%2Fimagerie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xibra%2Fimagerie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xibra%2Fimagerie/lists"}