Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Quality control (design problem) You work at a factory that makes clear plast

ID: 3349418 • Letter: 1

Question

1. Quality control (design problem) You work at a factory that makes clear plastic materials, and there are sometimes problems with the manufacturing. Sometimes the plastic gets scratched. Sometimes dirt gets on the plastic You set up a camera in the factory that takes pictures of the plastic as it goes past the camera I am providing you with three images: - scratches-horizontal.jpg - example with horizontal scratches - scratches-vertical.jpg - example with vertical scratches - dirt.jpg - example with dirt good.jpg - good example (acceptable amount of dirt or scratches) Try to invent an image processing method that would automatically determine: - Is the plastic is good, scratched, or dirty? If the plastic is scratched, are the scratches horizontal or vertical? Write some code to illustrate your idea, and show any images or other visual information that helps to explain your solution. It's ok if your solution is not fully automated. The idea is to demonstrate your concept. Note: There are many ways of solving this problem! There is not only one right answer.

Explanation / Answer

clc
clear all
close all
%%
I = imread('dirt.jpg');
I = rgb2gray(I);

%Apply median filet to remove small specks of noise
I = medfilt2(I);
err_hor = I - circshift(I,-1,2);
err_ver = I - circshift(I,-1,1);

hist_err_hor = histogram(err_hor)
figure()
hist_err_ver = histogram(err_ver)

% By analyzing the histogram values, we can determine if the noise is
% horizontal, vertical or dirt. Horizonal noise image will have low freq
% component in hist_err_hor while high in hist_err_ver. vertical noise image will have low freq
% component in hist_err_ver while high in hist_err_hor. Dirt will have
% reasonably high in both horizontal as well as vertical.