{"id":21864156,"url":"https://github.com/shamiul5201/selfie_app_features_application","last_synced_at":"2026-05-04T13:33:53.805Z","repository":{"id":261998606,"uuid":"885932607","full_name":"shamiul5201/selfie_app_features_application","owner":"shamiul5201","description":"OpenCV project to build skills in image processing: features include Cartoonify and Pencil Sketch effects in a Jupyter Notebook, blemish removal in a Python script, and chroma keying for videos. Perfect for exploring creative and practical computer vision techniques.","archived":false,"fork":false,"pushed_at":"2024-11-27T20:03:05.000Z","size":20192,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-14T07:39:58.429Z","etag":null,"topics":["computer-vision","numpy","opencv","python"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/shamiul5201.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-11-09T19:16:13.000Z","updated_at":"2024-11-27T20:09:00.000Z","dependencies_parsed_at":"2025-01-26T15:37:25.479Z","dependency_job_id":null,"html_url":"https://github.com/shamiul5201/selfie_app_features_application","commit_stats":null,"previous_names":["shamiul5201/selfie_app_features_application"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shamiul5201/selfie_app_features_application","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shamiul5201%2Fselfie_app_features_application","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shamiul5201%2Fselfie_app_features_application/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shamiul5201%2Fselfie_app_features_application/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shamiul5201%2Fselfie_app_features_application/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shamiul5201","download_url":"https://codeload.github.com/shamiul5201/selfie_app_features_application/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shamiul5201%2Fselfie_app_features_application/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32609747,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"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","numpy","opencv","python"],"created_at":"2024-11-28T04:07:41.829Z","updated_at":"2026-05-04T13:33:53.785Z","avatar_url":"https://github.com/shamiul5201.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Selfie App Features Application\nWelcome to this repository! This project showcases a variety of image processing features implemented using Python. Below, you'll find an overview of the three key features included in this repository:\n\n   \n\u003cimg width=\"1057\" alt=\"Screenshot 2024-11-10 at 2 20 18 pm\" src=\"https://github.com/user-attachments/assets/89457c95-003b-4b97-8fe9-f7c77a557195\"\u003e\n\n3. Blemish Removal output\n\nhttps://github.com/user-attachments/assets/bfd299eb-ed15-4f58-ae57-2fc2414e2e41\n\n\n4. Chroma Keying Output\n   \nhttps://github.com/user-attachments/assets/e6b96933-6904-46da-a102-698107a35f2b\n\n## Blemish Removal\n\n### Overview\nThe blemish removal tool is an interactive image-editing utility designed to remove unwanted spots or blemishes from an image. It allows users to click on a blemish in the image, automatically identifies the best replacement patch, and blends the patch seamlessly into the selected area. This is achieved through gradient-based patch selection and seamless cloning using OpenCV.\n\n\n### Key Functions and Their Purposes\n1. **`sobel_filter(crop_img)`**  \n   - Calculates gradients in the x and y directions for a given image patch using the Sobel operator.  \n   - These gradients are used to identify texture changes, which help find smooth patches for replacement.  \n\n2. **`append_dictionary(x, y, r, source)`**  \n   - Extracts a patch from the image and calculates its gradients using `sobel_filter`.  \n   - Returns the gradient information, which helps assess the patch's smoothness.  \n\n3. **`identify_best_patch(x, y, r, source)`**  \n   - Searches for candidate patches around the blemish location.  \n   - Compares patches and selects the one with the smoothest gradients (lowest combined x and y gradients) for replacement.  \n\n4. **`selected_blemish(x, y, r, source)`**  \n   - Wrapper function that calls `identify_best_patch` and returns the optimal patch location for a blemish.  \n\n5. **`blemish_removal(action, x, y, flags, userdata)`**  \n   - Handles mouse events, allowing the user to select blemishes interactively:  \n     - **Left Mouse Click:** Selects a blemish and replaces it with the best-matching patch using OpenCV's `seamlessClone`.  \n     - **Mouse Release:** Updates and displays the modified image.  \n\n6. **Main Loop**  \n   - Sets up the OpenCV window and listens for user actions:  \n     - **Key 'C':** Resets the image to its original state.  \n     - **Esc Key:** Exits the application.  \n   - Displays the interactive blemish removal tool.\n\n### Usage and Prerequisites\n#### Prerequisites\n1. Install OpenCV and NumPy:\n   ```python\n   pip install opencv-python numpy\n   ```\n2. Execute the script:\n   ```python\n   python 02_blemish_removal.py\n   ```\n\n#### Example Use Case\n- **Removing small imperfections in portrait images for photo editing.**\n\n---\n\n\n##  Chroma Keying  \n\n### Overview\n\nThe chroma keying tool replaces a specific color (e.g., green screen) in a video or image with a new background. This technique is widely used in video editing, film production, and real-time streaming to create visually dynamic content.\n\n### Key Functions and Their Purposes  \n\n1. **`chroma_key(foreground_frame, background_frame, lower_color, upper_color, softness=0)`**  \n   - Implements the chroma key (green screen) effect by performing the following steps:  \n     - Converts the foreground image to HSV color space.  \n     - Creates a binary mask to isolate the specified color range (e.g., green screen).  \n     - Optionally applies Gaussian blur to soften the edges of the mask.  \n     - Extracts the subject from the foreground using the inverted mask.  \n     - Resizes the background to match the size of the foreground frame.  \n     - Replaces the masked area with the resized background.  \n\n2. **Main Loop**  \n   - Reads frames from the foreground (green screen) and background videos.  \n   - Applies the `chroma_key` function frame-by-frame.  \n   - If the background video runs out of frames, loops it to ensure continuous playback.  \n   - Displays the composited video output in real-time.  \n   - Exits the application when the **'Q' key** is pressed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshamiul5201%2Fselfie_app_features_application","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshamiul5201%2Fselfie_app_features_application","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshamiul5201%2Fselfie_app_features_application/lists"}