0% found this document useful (0 votes)
4 views3 pages

Lab 6

The document describes a function for thresholding an image, converting pixel values based on a specified threshold. It discusses the challenges of applying filters to images with different types of noise and the difficulties in finding appropriate thresholds for RGB and HSV color spaces due to varying background and object colors. The analysis highlights the impact of noise and color representation on image processing results.

Uploaded by

fu95yr5m7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

Lab 6

The document describes a function for thresholding an image, converting pixel values based on a specified threshold. It discusses the challenges of applying filters to images with different types of noise and the difficulties in finding appropriate thresholds for RGB and HSV color spaces due to varying background and object colors. The analysis highlights the impact of noise and color representation on image processing results.

Uploaded by

fu95yr5m7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Task 1.

function oim = tresh(im, threshold)


oim = uint8(zeros(size(im)));
[x , y , c] = size(im);

for i = 1:x
for j = 1:y
for k = 1:c
if im(i,j,k) > threshold
oim(i,j,k) = 0;
else
oim(i,j,k) = 255;
end
end
end
end
end

Number of region in first image is so big because I used original 12M pixel image.
Task 2.

Salt and pepper noise and LUM filter that I implemented on previous labs.

Gaussian noise and the same LUM filter. This filter didn’t cope well with gaussian noise so filtered
image have more single pixel regions.
Task 3.

For rgb it was not hard to find proper threshold as background is white – the only consideration is
shadow below objects.

For hsv it is hard to find threshold:

- we want all of the hue as 0 represents red but can also represent white – as we could see on
histogram
- saturation should be low to not detect white background and shadow below objects, but the
problem is gray brick – it is not detected as it has low saturation
- we want all of the values as on picture we have many sharp colors

You might also like