Filter löschen
Filter löschen

Intensity profile line with interpolation

15 Ansichten (letzte 30 Tage)
Safal Khanal
Safal Khanal am 18 Okt. 2016
Bearbeitet: KAE am 16 Sep. 2019
Could anyone suggest ways to get intensity profile line with interpolations? I am using improfile on matlab to get an intensity profile but that results in very few points as the image I am working on is a very low resolution one (1.3mm*1.3mm). Much appreciated!

Antworten (1)

KAE am 16 Sep. 2019
Bearbeitet: KAE am 16 Sep. 2019
You can specificy the number of points, n, in improfile and also choose the interpolation method such as bicubic (avoid nearest neighbor interpolation which is the default). Here is an example where we interpolate 20 points along a line through a 6x6 image called ISmall.
I = imread('liftingbody.png'); % Example image
ISmall = I(100:105, 100:105); % Small 6x6 subset which we will interpolate
nPointsOnLine = 20; % Number of points to interpolate along line
xi = [1 6]; yi = [2 5]; % x and y endpoints of line segment
[lineX, lineY, interpIntesity] = improfile(ISmall, xi, yi, nPointsOnLine, 'bicubic');
% lineX, lineY are points along the line where interpIntensity is
% interpolated with bicubic interpolation

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by