{"id":28321245,"url":"https://github.com/raphaelsenn/pixelzauber","last_synced_at":"2025-06-23T20:31:21.432Z","repository":{"id":293689036,"uuid":"984838840","full_name":"raphaelsenn/pixelzauber","owner":"raphaelsenn","description":"Implementing a bunch image processing algorithms for .PGM files from scratch in C++.","archived":false,"fork":false,"pushed_at":"2025-06-03T13:43:44.000Z","size":5213,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-04T00:36:10.804Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","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/raphaelsenn.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,"zenodo":null}},"created_at":"2025-05-16T15:38:01.000Z","updated_at":"2025-06-03T13:43:46.000Z","dependencies_parsed_at":"2025-05-16T16:44:49.233Z","dependency_job_id":"779432c8-bf2e-4904-87b8-84675ce144f7","html_url":"https://github.com/raphaelsenn/pixelzauber","commit_stats":null,"previous_names":["raphaelsenn/pixelzauber"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/raphaelsenn/pixelzauber","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fpixelzauber","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fpixelzauber/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fpixelzauber/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fpixelzauber/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raphaelsenn","download_url":"https://codeload.github.com/raphaelsenn/pixelzauber/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fpixelzauber/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261552458,"owners_count":23176166,"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":[],"created_at":"2025-05-25T12:13:27.533Z","updated_at":"2025-06-23T20:31:21.423Z","avatar_url":"https://github.com/raphaelsenn.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pixelzauber\nImplementing a bunch image processing algorithms for .PGM and .PPM files from scratch in C++.\n\n\n## Kernels (Filters)\n\nAll images shown were produced as outputs of image processing algorithms implemented in this repository.\n| Operation       | Kernel                                       | Output Image                     |\n|-----------------|-----------------------------------------------|----------------------------------|\n| Identity        | `[ [0 0 0], [0 1 0], [0 0 0] ]` | ![Identity](res/lena.png)        |\n| Box Blur         | `1/9*[ [1 1 1], [1 1 1], [1 1 1] ]` | ![Blur](res/lena_box_blur.png) |\n| Sharpen         | `[ [0 -1 0], [-1 5 -1], [0 -1 0] ]` | ![Sharpen](res/lena_sharp.png) |\n| Edge Detection X-Direction | `[ [-1, 0, 1], [-2, 0, 2], [-1, 0, 1] ]` | ![Edges](res/lena_edge_x.png) |\n| Edge Detection Y-Direction | `[ [-1, -2, -1], [0, 0, 0], [1, 2, 1] ]` | ![Edges](res/lena_edge_y.png) |\n\n```c++\n#include \"./src/Mat2d.hpp\"\n\nint main() {\n\n    // loading lena\n    Mat2d\u003cint\u003e lena;\n    lena.readPGM(\"lena.pgm\");\n\n    // defining a kernel for sharpening\n    Mat2d\u003cint\u003e kernel = Mat2d\u003cint\u003e({\n        {0, -1, 0},\n        {-1, 5, -1},\n        {0, -1, 0}});\n\n    Mat2d\u003cint\u003e lena_sharp = applyFilter(lena, kernel).clip(0, lena.maxVal());\n    lena_sharp.writePGM(\"lena_sharp.pgm\"); \n    return 0;\n}\n```\n\n## Synthetic Noise\n\nAll images shown were produced as outputs of image processing algorithms implemented in this repository.\n| Noise       | Output Image                     |\n|------------|----------------------------------|\n| Original Image | ![Original Lena](./res/lena.png) |\n| Additive gaussian noise with mean = 0, standard deviation = 20 | ![Lena Gaussian Noise](./res/lena_gauss_noise.png) |\n\n```c++\n#include \"./src/Mat2d.hpp\"\n\nint main() {\n  Mat2d\u003cint\u003e lena;\n  lena.readPGM(\"./pgm/lena.pgm\");\n  Mat2d\u003cint\u003e noise = Mat2d\u003cint\u003e::normal(0, 20, lena.rows(), lena.cols());\n  noise.print(); \n  Mat2d\u003cint\u003e lena_noise = (lena + noise).clip(0, lena.maxVal());\n  lena_noise.writePGM(\"lena_gaussian_noise.pgm\"); \n}\n```\n\n## Image Difference\n\nLet $I^{(1)}$, $I^{(2)}$ $\\in \\mathbb{R}^{N}_{+}$ be two gray scale images. The difference of $I^{(1)}$, $I^{(2)}$ can be defined as:\n\n$$\nI^{(1)} - I^{(2)} \\coloneqq \\left| I^{(1)} - I^{(2)} \\right|\n$$\n\nThe difference of two images can be used to detect moving objects in a static scene.\n\n#### Example: Detecting Moving Objects in a static Scene\nLeft: Image I1, Middle: Image I2, Right: Absolute difference |I1 − I2| between Image I1 and Image I2\n\n| Noise       | Output Image                     |\n|------------|----------------------------------|\n| Image I1 | ![Image I1](./res/motion01.png) |\n| Image I2 | ![Image I2](./res/motion02.png) |\n| Difference of I1 and I2| ![Image I2](./res/motion01_diff_motion02.png) |\n\n\u003cp style=\"text-align: left; font-style: italic; font-size: 90%;\"\u003e\n  Image taken from \u003cem\u003eUniversity of Southern California\u003c/em\u003e,\u003cbr\u003e\n  \"motion05.512 and motion06.512\",\u003cbr\u003e\n  \u003ca href=\"https://sipi.usc.edu/database/database.php?volume=sequences\" target=\"_blank\"\u003e\n    https://sipi.usc.edu/database/database.php?volume=sequences\n  \u003c/a\u003e\n\u003c/p\u003e\n\n```c++\n#include \"./src/Mat2d.hpp\"\n\nint main() {\n  Mat2d\u003cint\u003e frame_1;\n  Mat2d\u003cint\u003e frame_2;\n  frame_1.readPGM(\"./pgm/motion05.pgm\");\n  frame_2.readPGM(\"./pgm/motion06.pgm\");\n  Mat2d\u003cint\u003e diff = (frame_1 - frame_2).clip(0, frame_1.maxVal());\n  diff.writePGM(\"motion_difference.pgm\");\n}\n```\n\n## Thresholding\nThresholding is the simplest way to segment an image by converting an intensity image into a binary image based on a threshold value.\n\n| Description       |    Image                |\n|------------|----------------------------------|\n| Original image | ![Image I1](./res/lena.png) |\n| The binary image resulting from a thresholding of the original image with threshold value of 125. | ![Image I2](./res/lena_threshold_100.png) |\n\n```c++\n#include \"./src/Mat2d.hpp\"\n#include \"./src/Segmentation.hpp\"\n\nint main() {\n  Mat2d\u003cint\u003e lena;\n  lena.readPGM(\"./pgm/lena.pgm\");\n  Mat2d\u003cint\u003e lena_threshold = thresholding(lena, 125);\n  lena_threshold.writePGM(\"lena_threshold.pgm\");\n  return 0;  \n}\n```\n\n\n\n\n## Citations\n\n```bibtex\n@misc{lena_image,\n  title        = {Lena Image},\n  note         = {Accessed: 1972},\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelsenn%2Fpixelzauber","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraphaelsenn%2Fpixelzauber","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelsenn%2Fpixelzauber/lists"}