How do I draw the scatterplot of an RGB image?

댓글 수: 6

darova
darova 2019년 8월 3일
Can you elaborate? I don't understand the question
I need to draw pixel intensity distribution of two neighbouring pixels at horizontal , vertical and digonal directions
darova
darova 2019년 8월 3일
Any ideas?
Yes, did you see my answer down below in the Answers section?
darova
darova 2019년 8월 3일
Yes, sorry. I'm just not a native english speaker
Parveiz, please explain in words what the two axes of your scatterplots represent.
  1. What does n,m on the x axis represent?
  2. What does n+1, m+1 on the y axis represent?
  3. Why do both of your scatterplots have the same x and y labels? They are not the same scatterplots yet they have the same axis labels. Why?

댓글을 달려면 로그인하십시오.

 채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 8월 4일
편집: KALYAN ACHARJYA 2019년 8월 4일

1 개 추천

image_test=rgb2gray(imread('2.png')); % Change the image
[rows colm]=size(image_test);
original_data=zeros(1,56512);
diag_data=zeros(1,56512);
hor_data=zeros(1,56512);
ver_data=zeros(1,56512);
l=1;
%ignoring boundary elements
for i=2:rows-1
for j=2:colm-1
original_data(l)=image_test(i,j);
diag_data(l)=image_test(i+1,j+1);
hor_data(l)=image_test(i,j+1);
ver_data(l)=image_test(i+1,j);
l=l+1;
end
end
subplot(131),plot( original_data,diag_data,'b.','linewidth',2);
xlabel('n,m'), ylabel('n+1,m+1'),title('Diagonal');
subplot(132),plot( original_data,diag_data,'b.','linewidth',2);
xlabel('n,m'), ylabel('n,m+1'),title('Horizontal');
subplot(133),plot( original_data,diag_data,'b.','linewidth',2);
xlabel('n,m'), ylabel('n+1,m'),title('Vertical');

댓글 수: 3

subplot(131),scatter( original_data,diag_data,'b.','linewidth',2);
%..............^^ would be same result, do in all 3 lines
What 56512 indicate ? Or is it m*n size of image
KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 8월 4일
편집: KALYAN ACHARJYA 2019년 8월 4일
Possible total iterations or
row*colm - ignoring boundary pixels

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2019년 8월 3일

0 개 추천

You need to use colorcloud(). It does a 3-D scatterplot of the RGB gamut.

카테고리

도움말 센터File Exchange에서 Scatter Plots에 대해 자세히 알아보기

질문:

2019년 8월 3일

댓글:

2019년 8월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by