extract integrated intensity profiles from image

Version 1.0.0.0 (1.58 KB) by Bernd H
extracts intensity profiles of an image (as improfile), but sums up along a given thickness
4K Downloads
Updated 28 Jun 2006

No License

function [CX,CY,C_sum,C,xi,yi]=improfile_integrated(I,d,xi,yi);


'improfile_integrated' computes intensity values along a line or multiline in a greyscale images. Parameter d gives the opportunity to integrate along thicker lines with width d.

Please note the 'known problems' section!

input:
I : image (only grayscale)
d : thickness of line for integration
xi, yi : x-/y- coordinates of line profile

output:
CX, CY : (center) coordinates of intensity values
C : intensity along path, single line scan (from improfile)
C_sum : integrated intensity profile of line with thickness d

example:

I=zeros(100,100);
I(50:100,1:100)=.5;
figure, imshow(I,[]);
% image with step in the middle, the oise free image

Irand=rand(100,100)*.5;
I=I+Irand;
figure, imshow(I,[]);
% image is noisy but step is clearly visible

thickness=10;
[CX,CY,C_sum,C,xi,yi]=improfile_integrated(I,thickness);
% do a ten pixel averaging
plot(1:length(C),C,'.',1:length(C_sum),C_sum/(thickness+1),'-');
grid on, axis tight
xlabel('lateral distance [px]');
ylabel('intensity [a.u.]');
title('comparision of single linescan and integrated line scan');

known problems:

sometimes the routine fails because of the numerical method of finding
the rotated data points. An error is printed. The try it again with a
slightly different line scan.

conclusion:

is still not reliable, but up to my knowledge the first routine wich
extracts integrated intensity profiles under Matlab. This is a standard
tool in image analysis.

Feel free to improve it!

Hei 06/06

Cite As

Bernd H (2026). extract integrated intensity profiles from image (https://www.mathworks.com/matlabcentral/fileexchange/11568-extract-integrated-intensity-profiles-from-image), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14SP3
Compatible with any release
Platform Compatibility
Windows macOS Linux
Version Published Release Notes
1.0.0.0