80 likes | 93 Vues
This tool enables processing of images within a predefined region of interest (ROI), using functions like roipoly, roifilt2, and thresholding in MATLAB.
E N D
Region of Interest Processing • Process image only in the predefined area. • The predefined area is called “Region Of Interest” (ROI). • Function is the same as before but applied to only ROI.
ROI Selection: MATLAB • Command: roipoly • Syntax: roipoly(im); roipoly(im, [x0 x1 …xm], [y0 y1 …ym]; • im: input image • (x0,y0), (x1,y1), …, (xm,ym) : coordinate of the polygon covering region of interest. • E.g. roi = roipoly(im, [60 100 100 60], [40 40 80 80]);
Binary image with the white (1) indicating ROI. Mask for ROI Mask coordinate: (222, 21) (272, 21) (300, 75) (270, 121) (221, 121) (191, 75) http://www.mathworks.com/access/helpdesk/help/toolbox/images/roipoly.html
ROI Filtering: MATLAB • Command: roifilt2 • Syntax: roifilt2(filter, image, roi); • filter : 2D linear filter • image : input image • roi : region of interest (1: ROI, 0: not ROI) TRY !!
Unsharp masking in ROI. Effect of ROI Filtering ROI at this coin http://www.mathworks.com/access/helpdesk/help/toolbox/images/roifilt2.html
ROI using Thresholding • ROI dapatdibuatdenganmenggunakanthresholding. • Misaljikanilai pixel > 128 makalogika ROI di pixel tsbbernilai 1, danjikanilai pixel <128 makalogika ROI di pixel tsbbernilai 0. s = size(greencocoon); cocoon_ROI = greencocoon; for i=1:s(1,2) %x for j=1:s(1,1) %y if greencocoon(j,i) < 128 cocoon_ROI(j,i) = 0; end if greencocoon(j,i) > 128 cocoon_ROI(j,i) = 1; end end end cocoon_ROI = logical(cocoon_ROI); cocoon_result = roifilt2(HPF, greencocoon, cocoon_ROI);
Bagi yang Muslim dipersilakansholatzhuhurdulu.Kuliahdimulaipukul 12:10.TerimaKasih