09.07.2015 Views

13 Paskaita MATLAB Interpoliavimas (pdf)

13 Paskaita MATLAB Interpoliavimas (pdf)

13 Paskaita MATLAB Interpoliavimas (pdf)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Daigiamatis interpoliavimas<strong>MATLAB</strong>’o funkcijos Dvimatis interpoliavimasFunkcija interp2 atlieka dvimatį interpoliavimą (svarbustaikymai - vaizdo apdorojimas ir duomenų vizualizacija).ZI = interp2(X,Y,Z,XI,YI,method)Z is a rectangular array containing the values of atwodimensional function,X and Y are arrays of the same size containing thepoints for which the values in Z are given.XI and YI are matrices containing the points at whichto interpolate the data.MIM (MIF VU) <strong>MATLAB</strong> programavimas 2010-11-30 101 / 116Daigiamatis interpoliavimasDvimatis interpoliavimas - metodaiNearest neighbor interpolation (method = ’nearest’).This method fits a piecewise constant surface throughthe data values. The value of an interpolated point isthe value of the nearest point.Bilinear interpolation (method = ’linear’). This methodfits a bilinear surface through existing data points. Thevalue of an interpolated point is a combination of thevalues of the four closest points. This method ispiecewise bilinear, and is faster and lessmemory-intensive than bicubic interpolation.Bicubic interpolation (method = ’cubic’). This methodfits a bicubic surface through existing data points. Thevalue of an interpolated point is a combination of thevalues of the sixteen closest points. This method ispiecewise bicubic, and produces a much smoothersurface than bilinear interpolation. This can be a keyadvantage for applications like image processing.MIM (MIF VU) <strong>MATLAB</strong> programavimas 2010-11-30 102 / 116U bi bi i t l ti h th i t l t d d tDaigiamatis interpoliavimas<strong>MATLAB</strong> funkcija: interp2Daigiamatis interpoliavimasInterpoliavimo metodu palyginimas IVisi šie metodai reikalauja X ir Y monotoniškumo. Pavyzdys: dvimatis interpoliavimas (7x7 pradinių duomenųmatrica)Retas tinklas: [x,y] = meshgrid(-3:1:3);z = peaks(x,y);surf(x,y,z)MIM (MIF VU) <strong>MATLAB</strong> programavimas 2010-11-30 103 / 116MIM (MIF VU) <strong>MATLAB</strong> programavimas 2010-11-30 104 / 116Daigiamatis interpoliavimasInterpoliavimo metodu palyginimas II1 Generuojamas smulkus tinklas:[xi,yi] = meshgrid(-3:0.25:3);2 <strong>Interpoliavimas</strong> - nearest neighbor:zi1 = interp2(x,y,z,xi,yi,’nearest’);3 <strong>Interpoliavimas</strong> – bilinear:zi2 = interp2(x,y,z,xi,yi,’bilinear’);4 <strong>Interpoliavimas</strong> - bicubic:zi3 = interp2(x,y,z,xi,yi,’bicubic’);Daigiamatis interpoliavimasInterpoliavimo metodu palyginimascontour The bicubic method produces smoothercontours. This is not always the primary concern, however.For some applications, such as medical image processing,a method like nearest neighbor may be preferredbecause it doesn’t generate any “new” data values.MIM (MIF VU) <strong>MATLAB</strong> programavimas 2010-11-30 105 / 116MIM (MIF VU) <strong>MATLAB</strong> programavimas 2010-11-30 106 / 116

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!