Color Segmentation – License Plate Object Detection Week 4

image-processing object-detection matlab

This week, color segmentation is introduced in this project to separate the blue vertical band to the left of the license plate containing the 12 stars of the Flag of Europe.

% Convert to HSV color space
imageHsv = rgb2hsv(image);
h = imageHsv(:, :, 1);
s = imageHsv(:, :, 2);
v = imageHsv(:, :, 3);

% Segment using color
roi = ((h > 0.5) & (h < 0.833)) & (s > 0.5) & (v > 0.5);

% Restore to RGB colored image
output = image;
for i = 1:3
    output(:, :, i) = roi .* image(:, :, i);
end

Previous: Week 3: Edge Detection
Next: Week 5: Edge Detection

Chen Yumin
Chen Yumin

Hi, my name is Chen Yumin.
I am the author of the stuff you're reading right now.

Latest Project
CoderBox.io
CoderBox.io