How do I make this code a global one, which works for different pictures associated with skin wounds?
clear all
close all
[Im,map] = imread("rana2.jpg");
imshow(Im,map)
ImBgnd = rgb2gray(Im)
ImBgnd = double(ImBgnd)/255
[ImH,ImS,ImV] = ConversieHSV(Im);
%Conversie HSV
imshow(ImH/360)
imshow(ImS/100)
imshow(ImV/100)
ImBinarHS = Filtrare(ImH,350,5);
ImBinarHSf = imfill(ImBinarHS,"holes");
imshow(ImBinarHSf)
Imfinal = Im.*uint8(ImBinarHSf);
imshow(Imfinal)
ImBinarVS = Filtrare(ImS,70,35);
ImBinarVS = ~ImBinarVS;
ImBinarVSf = imfill(ImBinarVS,"holes");
imshow(ImBinarVS)
Imfinal = Im.*uint8(ImBinarVSf);
imshow(Imfinal)
ImfinS = ImBinarHSf&ImBinarVSf;
Imfinal = Im.*uint8(~ImfinS);
imshow(Imfinal)
[ImH,ImS,ImV] = ConversieHSV(Im);
imshow(ImH/360)
imshow(ImS/100)
imshow(ImV/100)
ImBinarHI = Filtrare(ImH,10,1);
ImBinarHIf = imfill(ImBinarHI,"holes");
imshow(ImBinarHIf)
Label = bwlabel(ImBinarHIf)
Label(Label~=1) = 0;
Label = ~Label
Imfinal = Im.*uint8(ImBinarHIf);
imshow(Imfinal)
ImBinarVI = Filtrare(ImS,70,35);
ImBinarVI = ~ImBinarVI;
ImBinarVIf = imfill(ImBinarVI,"holes");
imshow(ImBinarVI)
Imfinal = Im.*uint8(ImBinarVIf);
imshow(Imfinal)
ImfinI = ImBinarHIf&ImBinarVIf&Label;
ImfinI = ImfinI-ImfinS;
ImfinI = imclearborder(ImfinI);
Imfinal = Im.*uint8(~ImfinI);
imshow(Imfinal);
ImfinalIS = ImfinI|ImfinS;
ImfinalP = ~ImfinalIS;
ImFinalI(:,:,1) = ImBgnd.*(ImfinI*255)/255;
ImFinalI(:,:,2) = ImBgnd.*(ImfinI*0)/255;
ImFinalI(:,:,3) = ImBgnd.*(ImfinI*0)/255;
ImFinalS(:,:,1) = ImBgnd.*(ImfinS*100)/255;
ImFinalS(:,:,2) = ImBgnd.*(ImfinS*100)/255;
ImFinalS(:,:,3) = ImBgnd.*(ImfinS*100)/255;
ImFinalP(:,:,1) = ImBgnd.*(ImfinalP*0)/255;
ImFinalP(:,:,2) = ImBgnd.*(ImfinalP*255)/255;
ImFinalP(:,:,3) = ImBgnd.*(ImfinalP*0)/255;
ImfinalIS = Im.*uint8(~ImfinalIS);
Imfinal = ImFinalP+ImFinalI+ImFinalS
imshow(Imfinal)
imshowpair(Im,Imfinal,"montage")
%this is what i did wrong, this is not global
%
%and this is what i realised for this photo, this was the original photo, for this i made the code
%
%i need to help me if you can, i need to do this code global for mode photoes for my graduation, but i dont know how to continue, thank you guys!clear all
close all
[Im,map] = imread("rana2.jpg");
imshow(Im,map)
ImBgnd = rgb2gray(Im)
ImBgnd = double(ImBgnd)/255
[ImH,ImS,ImV] = ConversieHSV(Im);
%Conversie HSV
imshow(ImH/360)
imshow(ImS/100)
imshow(ImV/100)
ImBinarHS = Filtrare(ImH,350,5);
ImBinarHSf = imfill(ImBinarHS,"holes");
imshow(ImBinarHSf)
Imfinal = Im.*uint8(ImBinarHSf);
imshow(Imfinal)
ImBinarVS = Filtrare(ImS,70,35);
ImBinarVS = ~ImBinarVS;
ImBinarVSf = imfill(ImBinarVS,"holes");
imshow(ImBinarVS)
Imfinal = Im.*uint8(ImBinarVSf);
imshow(Imfinal)
ImfinS = ImBinarHSf&ImBinarVSf;
Imfinal = Im.*uint8(~ImfinS);
imshow(Imfinal)
[ImH,ImS,ImV] = ConversieHSV(Im);
imshow(ImH/360)
imshow(ImS/100)
imshow(ImV/100)
ImBinarHI = Filtrare(ImH,10,1);
ImBinarHIf = imfill(ImBinarHI,"holes");
imshow(ImBinarHIf)
Label = bwlabel(ImBinarHIf)
Label(Label~=1) = 0;
Label = ~Label
Imfinal = Im.*uint8(ImBinarHIf);
imshow(Imfinal)
ImBinarVI = Filtrare(ImS,70,35);
ImBinarVI = ~ImBinarVI;
ImBinarVIf = imfill(ImBinarVI,"holes");
imshow(ImBinarVI)
Imfinal = Im.*uint8(ImBinarVIf);
imshow(Imfinal)
ImfinI = ImBinarHIf&ImBinarVIf&Label;
ImfinI = ImfinI-ImfinS;
ImfinI = imclearborder(ImfinI);
Imfinal = Im.*uint8(~ImfinI);
imshow(Imfinal);
ImfinalIS = ImfinI|ImfinS;
ImfinalP = ~ImfinalIS;
ImFinalI(:,:,1) = ImBgnd.*(ImfinI*255)/255;
ImFinalI(:,:,2) = ImBgnd.*(ImfinI*0)/255;
ImFinalI(:,:,3) = ImBgnd.*(ImfinI*0)/255;
ImFinalS(:,:,1) = ImBgnd.*(ImfinS*100)/255;
ImFinalS(:,:,2) = ImBgnd.*(ImfinS*100)/255;
ImFinalS(:,:,3) = ImBgnd.*(ImfinS*100)/255;
ImFinalP(:,:,1) = ImBgnd.*(ImfinalP*0)/255;
ImFinalP(:,:,2) = ImBgnd.*(ImfinalP*255)/255;
ImFinalP(:,:,3) = ImBgnd.*(ImfinalP*0)/255;
ImfinalIS = Im.*uint8(~ImfinalIS);
Imfinal = ImFinalP+ImFinalI+ImFinalS
imshow(Imfinal)
imshowpair(Im,Imfinal,"montage")
%this is what i did wrong, this is not global
%
%and this is what i realised for this photo, this was the original photo, for this i made the code
%
%i need to help me if you can, i need to do this code global for mode photoes for my graduation, but i dont know how to continue, thank you guys! clear all
close all
[Im,map] = imread("rana2.jpg");
imshow(Im,map)
ImBgnd = rgb2gray(Im)
ImBgnd = double(ImBgnd)/255
[ImH,ImS,ImV] = ConversieHSV(Im);
%Conversie HSV
imshow(ImH/360)
imshow(ImS/100)
imshow(ImV/100)
ImBinarHS = Filtrare(ImH,350,5);
ImBinarHSf = imfill(ImBinarHS,"holes");
imshow(ImBinarHSf)
Imfinal = Im.*uint8(ImBinarHSf);
imshow(Imfinal)
ImBinarVS = Filtrare(ImS,70,35);
ImBinarVS = ~ImBinarVS;
ImBinarVSf = imfill(ImBinarVS,"holes");
imshow(ImBinarVS)
Imfinal = Im.*uint8(ImBinarVSf);
imshow(Imfinal)
ImfinS = ImBinarHSf&ImBinarVSf;
Imfinal = Im.*uint8(~ImfinS);
imshow(Imfinal)
[ImH,ImS,ImV] = ConversieHSV(Im);
imshow(ImH/360)
imshow(ImS/100)
imshow(ImV/100)
ImBinarHI = Filtrare(ImH,10,1);
ImBinarHIf = imfill(ImBinarHI,"holes");
imshow(ImBinarHIf)
Label = bwlabel(ImBinarHIf)
Label(Label~=1) = 0;
Label = ~Label
Imfinal = Im.*uint8(ImBinarHIf);
imshow(Imfinal)
ImBinarVI = Filtrare(ImS,70,35);
ImBinarVI = ~ImBinarVI;
ImBinarVIf = imfill(ImBinarVI,"holes");
imshow(ImBinarVI)
Imfinal = Im.*uint8(ImBinarVIf);
imshow(Imfinal)
ImfinI = ImBinarHIf&ImBinarVIf&Label;
ImfinI = ImfinI-ImfinS;
ImfinI = imclearborder(ImfinI);
Imfinal = Im.*uint8(~ImfinI);
imshow(Imfinal);
ImfinalIS = ImfinI|ImfinS;
ImfinalP = ~ImfinalIS;
ImFinalI(:,:,1) = ImBgnd.*(ImfinI*255)/255;
ImFinalI(:,:,2) = ImBgnd.*(ImfinI*0)/255;
ImFinalI(:,:,3) = ImBgnd.*(ImfinI*0)/255;
ImFinalS(:,:,1) = ImBgnd.*(ImfinS*100)/255;
ImFinalS(:,:,2) = ImBgnd.*(ImfinS*100)/255;
ImFinalS(:,:,3) = ImBgnd.*(ImfinS*100)/255;
ImFinalP(:,:,1) = ImBgnd.*(ImfinalP*0)/255;
ImFinalP(:,:,2) = ImBgnd.*(ImfinalP*255)/255;
ImFinalP(:,:,3) = ImBgnd.*(ImfinalP*0)/255;
ImfinalIS = Im.*uint8(~ImfinalIS);
Imfinal = ImFinalP+ImFinalI+ImFinalS
imshow(Imfinal)
imshowpair(Im,Imfinal,"montage")
%this is what i did wrong, this is not global
%
%and this is what i realised for this photo, this was the original photo, for this i made the code
%
%i need to help me if you can, i need to do this code global for mode photoes for my graduation, but i dont know how to continue, thank you guys! image processing, filter, choose file to process MATLAB Answers — New Questions