Creating a plot of intensity of pixels across an image using MATLAB?

M
Mikaela_sf · Sep 26, 2020 · 2.3K views
Question
Hi am a newbie to MATLAB. Can anyone suggest me a code to plot a graph for number of pixels in each column of an image? any serious help would be appreciated.Thanks in advance.I need a code to get the density of black pixels in every column of an image.
Expert Answer
Profile picture of Kshitij Singh
Kshitij Singh PhD Expert
Answered Aug 20, 2026
I = fitsread('solarspectra.fts');%input your image
imshow(I,[]);

Create the intensity profile. Call improfile with no arguments. The cursor changes to cross-hairs when you move it over the displayed image. Using the mouse, specify line segments by clicking the endpoints. improfile draws a line between the endpoints. When you finish specifying the path, press Return. .

improfile





Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!