University of Sydney · FACULTY OF ELECTRICAL ENGINEERING

ELEC5622 Chap.8 Medical Image Segmentation: Edges, Regions and K-means

- one subject, every graph, every model, every mark
7 Chapters3-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 8 of 12 · ELEC5622

Medical Image Segmentation: Edges, Regions and K-means

This chapter covers conventional segmentation, the image-processing half of medical image analysis. Edge-based methods use gradient operators, Prewitt, Sobel and Canny, then link edge pixels. Region-based methods grow from seeds or split inhomogeneous areas. Classification-based methods include unsupervised K-means clustering and supervised patch-based labelling, which Lab 2 practises on an MRI slice.

Sobel and Prewitt are applied by hand to one small intensity patch. It closes with how the Lab 2 marking criteria split marks between filter definitions, results and explanation. Hand calculations of Sobel, Prewitt and K-means make the methods concrete before Lab 2 runs them in Python.

In this chapter

What this chapter covers

  • 01

    Segmentation versus classification

  • 02

    Image gradient, edge strength and direction

  • 03

    Prewitt and Sobel operators

  • 04

    The five steps of Canny edge detection

  • 05

    Region growing and region splitting

  • 06

    Unsupervised K-means clustering

  • 07

    Supervised and patch-based segmentation

Worked example · free

Prewitt response at a horizontal edge

Q [3 marks]. A 3 × 3 patch has rows [0 0 0], [50 50 50] and [100 100 100], top first. With Gx as right minus left and Gy as bottom minus top, apply the Prewitt operator at the centre and give the edge magnitude and direction. Our own weighting is used for the marks; it is not the University's marking scheme.
K-means on ten pixel intensities.K-means on ten pixel intensities. Open triangles mark the starting centres at 12, 47 and 96; filled triangles mark the converged centres at 15, 45.75 and 90.33, and each dot takes the colour of its nearest centre.0100pixel intensityopen marks: starting centresfilled marks: converged centres
K-means on ten pixel intensities. Open triangles mark the starting centres at 12, 47 and 96; filled triangles mark the converged centres at 15, 45.75 and 90.33, and each dot takes the colour of its nearest centre.
  • 1Gx: each row's right minus left value is 0, so Gx = 0.
  • 1Gy: bottom row sum 300 minus top row sum 0 gives Gy = 300.
  • 1Magnitude = √(0² + 300²) = 300, and the gradient aims straight down, at 90°, so the edge runs horizontally.
Gx = 0, Gy = 300, magnitude 300; a horizontal edge with intensity increasing downward. The Sobel operator gives the same direction here, with Gy = 400 because the centre column is weighted twice, so the stronger operator changes the magnitude but not the edge orientation.
Sia tip — The gradient points across an edge, not along it, so a vertical gradient means a horizontal edge line.
Glossary

Key terms

Canny edge detector
The Canny edge detector smooths, differentiates, thresholds, thins and links edges to give one response per edge.
Region growing
Region growing is a segmentation method that expands from seed pixels by merging similar neighbours.
K-means clustering
K-means clustering is an unsupervised method that alternates nearest-centre assignment and centre averaging.
Edge linking
Edge linking joins adjacent edge pixels into continuous contours after edge detection.
Image segmentation
Image segmentation is the separation of target objects, such as organs or lesions, from the rest of an image.
FAQ

Medical Image Segmentation: Edges, Regions and K-means FAQ

Why is Sobel preferred to Prewitt?

Sobel weights the centre row or column twice, which adds a little smoothing to the derivative. The lecture notes Prewitt is more sensitive to noise, and Sobel is the most commonly used operator for emphasising edges.

Why can K-means give different results on repeated runs?

The final partition depends on the initial centroids. Different starts can converge to different local solutions, which is why the lecture stresses initialisation and why Lab 2 asks whether repeated runs change the result.

When are region-based methods better than edge-based ones?

Regions cover more pixels than edges, so they carry more information, can use texture directly and cope better with noise. They need a seed or a homogeneity rule, and region growing results change with the chosen seed.

What is non-maximal suppression in Canny edge detection?

After the gradient is computed, each pixel is kept only if its gradient magnitude is a local maximum across the edge direction. This thins wide gradient ridges to edges one pixel wide before hysteresis links them.

How does patch-based segmentation use neighbouring pixels?

The image is cut into small overlapping patches, features are extracted from each, and each patch is classified. The label goes to the patch's centre pixel, so every decision reflects the surrounding neighbourhood rather than one value.

What must you choose before running K-means?

The lecture lists three presets: the number of clusters, the maximum number of iterations and a convergence threshold. Initial centroids matter as well, because different starting points can lead the algorithm to different final groups.

Study strategy

Exam move

Apply Sobel and Prewitt to small invented patches until the arithmetic is automatic, always stating your sign convention. Run K-means by hand on six to ten numbers, recording centres after each update. List the Canny steps in order and say what each removes, then compare edge and region methods in a short table.

Add a short note on what supervised and unsupervised segmentation each need before they can run, since Lab 2 asks for their advantages and disadvantages. Finally, write the K-means update in two lines, assignment then averaging, and check it on a set where you know the answer.

Working through Medical Image Segmentation: Edges, Regions and K-means in ELEC5622? Sia is AskSia’s AI Electrical Engineering tutor — ask any ELEC5622 Medical Image Segmentation: Edges, Regions and K-means question and get a clear, step-by-step explanation grounded in how ELEC5622 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.

A+Everything unlocked
Unlocks this Bible + all 196 of your University of Sydney subjects - and 1,000+ Bibles across every Australian university.
Sia - your ELEC5622 tutor, unlimited, worked the way the exam marks it
The full 3-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$0.99 Trial
30-day money-back · cancel in one tap · how it works