{"id":21654344,"url":"https://github.com/saurabhrkp/edge-detection","last_synced_at":"2025-06-21T23:37:00.554Z","repository":{"id":100843315,"uuid":"220538768","full_name":"Saurabhrkp/Edge-Detection","owner":"Saurabhrkp","description":"Implementations of Image Segmentation","archived":false,"fork":false,"pushed_at":"2019-11-08T20:32:07.000Z","size":1649,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-21T23:36:25.750Z","etag":null,"topics":["edge-detection","edges","image-analysis","image-segmentation","java","pixels","region"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/Saurabhrkp.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":"2019-11-08T20:00:00.000Z","updated_at":"2020-03-15T16:40:41.000Z","dependencies_parsed_at":"2023-03-18T13:47:05.779Z","dependency_job_id":null,"html_url":"https://github.com/Saurabhrkp/Edge-Detection","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Saurabhrkp/Edge-Detection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saurabhrkp%2FEdge-Detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saurabhrkp%2FEdge-Detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saurabhrkp%2FEdge-Detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saurabhrkp%2FEdge-Detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Saurabhrkp","download_url":"https://codeload.github.com/Saurabhrkp/Edge-Detection/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saurabhrkp%2FEdge-Detection/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261211682,"owners_count":23125543,"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":["edge-detection","edges","image-analysis","image-segmentation","java","pixels","region"],"created_at":"2024-11-25T08:27:36.356Z","updated_at":"2025-06-21T23:36:55.541Z","avatar_url":"https://github.com/Saurabhrkp.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Edge Detection in Java\n\nImplementations of Image Segmentation\n\n## Instructions\n\nCompile .java file\n`javac edgedetect.java`\nExecute .class file\n`java edgedetect`\n\nSegmentation partitions an image into distinct regions containing each pixels with similar attributes.\nTo be meaningful and useful for image analysis and interpretation, the regions should strongly\nrelate to depicted objects or features of interest. Meaningful segmentation is the first step from lowlevel image processing transforming a greyscale or colour image into one or more other images to\nhigh-level image description in terms of features, objects, and scenes. The success of image analysis\ndepends on reliability of segmentation, but an accurate partitioning of an image is generally a very\nchallenging problem.\n\nSegmentation techniques are either contextual or non-contextual. The latter take no account of\nspatial relationships between features in an image and group pixels together on the basis of some\nglobal attribute, e.g. grey level or colour. Contextual techniques additionally exploit these\nrelationships, e.g. group together pixels with similar grey levels and close spatial locations.\n\n## EDGE DETECTION\n\nEdge detection includes a variety of mathematical methods that aim at identifying points in a digital\nimage at which the image brightness changes sharply or, more formally, has discontinuities. The\npoints at which image brightness changes sharply are typically organized into a set of curved line\nsegments termed edges. Most of the shape information of an image is enclosed in edges. So first we\ndetect these edges in an image and by using these filters and then by enhancing those areas of image\nwhich contains edges, sharpness of the image will increase and image will become clearer.\n\n- Prewitt Operator\n- Sobel Operator\n- Robinson Compass Masks\n- Krisch Compass Masks\n- Laplacian Operator\n\n## Split-and-merge segmentation\n\nThe top-down split-and-merge algorithm considers initially the entire image to be a single region\nand then iteratively splits each region into subregions or merges adjacent regions until all regions\nbecome uniform or until the desired number of regions have been established.\n\nA common splitting strategy for a square image is to divide it recursively into smaller and smaller\nquadrants until, for any region R, the uniformity predicate P(R) is TRUE. The strategy builds a topdown quadtree: if P(image) is FALSE, the image is divided into four quadrants; if P(quadrant) is\nFALSE, the quadrant is divided into subquadrants; and so on:\n\n![](/images/splitandmerge.jpg)\n\nThe splitting stage alternates with a merging stage, in which two adjacent regions Ri\n and Rj\n are\ncombined into a new, larger region if the uniformity predicate for the union of these two regions,\nP(Ri\n R ∪ R j\n), is TRUE.\n## EDGE LINKING THROUGH HOUGH TRANSFORM\n\nHough transform can be used for pixel linking and curve detection. The straight line represented by\ny=mx+c can be expressed in polar coordinate system as,\n\nρ = xcos(θ)+ ysin(θ) …………………..(i)\n\nWhere ρ,θ defines a vector from the origin to the nearest pointon the straight line y=mx+c. this\nvector will be perpendicular from the origin to the nearest point to the line as shown in the below\nfigure. \n\n![](/images/straightline.jpg)\n\nAny line in the x, y plane corresponds to the point in the 2D space defined by the parameter and θ.\nThis the Hough transform of a straight line in the x,y plane is a single point in the ρ, θ space and\nthese points should satisfy the given equation with x1,y1 as constants. Thus the locus of all such\nlines in the x, y plane corresponds to the particular sinusoidal curve in the ρ, θ space.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaurabhrkp%2Fedge-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaurabhrkp%2Fedge-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaurabhrkp%2Fedge-detection/lists"}