How do I draw the scatterplot of an RGB image?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Parveiz Lone
el 3 de Ag. de 2019
Comentada: Image Analyst
el 4 de Ag. de 2019
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/232611/image.jpeg)
6 comentarios
Image Analyst
el 4 de Ag. de 2019
Parveiz, please explain in words what the two axes of your scatterplots represent.
- What does n,m on the x axis represent?
- What does n+1, m+1 on the y axis represent?
- 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?
Respuesta aceptada
KALYAN ACHARJYA
el 4 de Ag. de 2019
Editada: KALYAN ACHARJYA
el 4 de Ag. de 2019
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');
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/232564/image.png)
3 comentarios
KALYAN ACHARJYA
el 4 de Ag. de 2019
Editada: KALYAN ACHARJYA
el 4 de Ag. de 2019
Possible total iterations or
row*colm - ignoring boundary pixels
Más respuestas (1)
Image Analyst
el 3 de Ag. de 2019
You need to use colorcloud(). It does a 3-D scatterplot of the RGB gamut.
0 comentarios
Ver también
Categorías
Más información sobre Scatter Plots en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!