Intensity profile of an image

How can I plot the intinsity profile for a oicture along a specific direction? Here is the picture.

Answers (1)

Rik
Rik on 15 May 2019
improfile should work

7 Comments

Thank you for answering my question. But, what if the image contains more variables than the allowed onces.
I got the following : Cnnot display summaies of variables with more than 524288 elements. !!
What you are looking at is the variable editor. I don't know what you are trying to do, but simply for plotting a profile you don't need it. Have you taken a look at the example in the documentation? You can also enter a pair of points, instead of the list of 4 points they show in their example.
Comment mistakenly posted as answer by Mohammed Qahosh:
In fact, I am trying to plot the intinsity profile alone the right spot appearing in the lower part of the picure along its diagonal. i.e. about 45 degrees with the positive x-axis. But, once I try to load the pic. I got the meassage :
Cannot display....
What code are you using? Are you entering coordinates as input to improfile, as the documentation describes? Why are you opening your image in the variable editor?
You could even use ginput or getpts to get the coordinates as input to improfile (just use a function like imshow to get your image into an axis).
No idea what you're doing. It sounds like you need to learn how to use matlab's interface first.
As rik has said, improfile is the tool to use, e.g.
img = imread('p190322an.jpeg'); %load the image
figure; imshow(img); %display image in a new figure
p = improfile; %call the improfile tool that lets you specify the start and end point of the line along which you want to measure the intensity profile
Guillaume,
Thank you very much. Actually it was not easy as I expected. Someone halped me :))
Dear Rik, thank you very much for yor help. Actually, there was a code defining the image I worked on using the current computer. But it works now.

Sign in to comment.

Categories

Find more on Convert Image Type in Help Center and File Exchange

Tags

No tags entered yet.

Asked:

on 15 May 2019

Commented:

on 20 May 2019

Community Treasure Hunt

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

Start Hunting!