How can i plot the intensity of each row in an image?

2 ビュー (過去 30 日間)
Amelia Biase
Amelia Biase 2017 年 7 月 12 日
コメント済み: AKSHAY KUMAR 2019 年 3 月 12 日
This is what I have so far for my code. I was either going to use intensityValue or improfile but I don't really understand how it works.
I = imread('C:\Users\student\Pictures\2017-07-11\image.jpg');
warning('off', 'Images:initSize:adjustingMag');
%intensityValue= I (100,500);
%improfile
imshow(I);

回答 (2 件)

Prashant Arora
Prashant Arora 2017 年 7 月 17 日
編集済み: Prashant Arora 2017 年 7 月 17 日
Hi Amelia,
I am assuming you have a 2-dimensional Image I. You can directly use the value in the image matrix to plot the intensity. For example:
I = imread('liftingbody.png');
x = 1:size(I,1);
y = 1:size(I,2);
[X,Y] = meshgrid(x,y);
plot3(X,Y,I)
  5 件のコメント
Walter Roberson
Walter Roberson 2017 年 7 月 17 日
Prashant Arora wrote "I am assuming you have a 2-dimensional Image I." . Your image is not 2D. You need to do rgb2gray to get intensity.
AKSHAY KUMAR
AKSHAY KUMAR 2019 年 3 月 12 日
after using rgb2gray it still shows the same image as that of attached file

サインインしてコメントする。


Walter Roberson
Walter Roberson 2017 年 7 月 17 日
編集済み: Walter Roberson 2017 年 7 月 17 日
surf( rgb2gray(YourRGBImage), 'edgecolor', 'none' )
colormap(gray(256))
  12 件のコメント
Walter Roberson
Walter Roberson 2017 年 7 月 19 日
max() and mean() have different calling sequences. max(A, B) is element-by-element max(A(I,J), B(I,J)) unless B is empty, [], in which case max(A, []) is the same as max(A, [], 1) which is per-column maximum. max(A, [], 2) is per-row maximum.
mean(A,1) is per-column mean, and mean(A,2) is per-row mean.
Amelia Biase
Amelia Biase 2017 年 7 月 19 日
編集済み: Amelia Biase 2017 年 7 月 19 日
how do i choose a single row in the image to analyze without using improfile?

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by