I am the beginer for doing simple image subtration to obtain defect image.

Technical Source
2 min readFeb 19, 2022

Hi, I am the beginer for doing simple image subtration to obtain defect image. Is it possible to make it only show the defect image if nothing difference wont show?

clc

clear

close all

warning off;

x=imread(‘origin.jpg’);

y=imread(‘capture.jpg’);

[g, c, d]=size(x);

y=imresize(y,[g,c]);

subplot(1,3,1);

imshow(x);

title(‘origin image’);

subplot(1,3,2);

imshow(y);

title(‘capture image’);

subplot(1,3,3);

imshow(x-y);

title(‘defect occur if difference colour shown’);

NOTE:-

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

Is it possible to make it only show the defect image if nothing difference wont show?

may be add some judge rule?such as

clc
clear
close all
warning off;
x=imread('origin.jpg');
y=imread('capture.jpg');
[g, c, d]=size(x);
y=imresize(y,[g,c]);
subplot(1,3,1);
imshow(x);
title('origin image');
subplot(1,3,2);
imshow(y);

SEE COMPLETE ANSWER CLICK THE LINK

--

--

Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.