Intensity profile line with interpolation

8 次查看(过去 30 天)
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!

回答(1 个)

KAE
KAE 2019-9-16
编辑:KAE 2019-9-16
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