imread -> colorcloud() : points are too small?
조회 수: 3 (최근 30일)
이전 댓글 표시
I'm new to Matlab and struggling with imread() and scatter3() which offers options for 'marker size'.
But there are 'complications'... My goal is to load an RGB image (using imread) and then plot the image colors in 3D using the original RGB pixels values.
So far, I got this code working which produces a 'monochromatic' (blue) 3D plot :
RGB = imread("Bonnet.jpg")
[R,G,B] = imsplit(RGB);
scatter3(R(:), G(:), B(:))
I tried experimenting with 'scatter3(X,Y,Z,S,C) draws each circle with the color specified by C' where C is a three column matrix with the number of rows in C equal to the length of X, Y, and Z, then each row of C specifies an RGB color value for the corresponding circle...
Trouble is I can't find how to convert the RGB 'array' into a 3x3 matrix to supply as c argument?
That is why I was interested in colorcloud() since it automatically colors each points BUT there are no options to increase the points size... So back to square one...
----
Once I get past this 'hurdle', my next goal is to allow 'picking' points (filled circles or squares) with the mouse so that I can tell what the RGB coordinate of a mouseover or mouse click is.
Then, for the cherry on the icing, I'd like to create a wireframe from a separate 3D dataset (extracted from Output ICC profile) to allow viewing which colors are out-of-gamut.
Tall order!
Any help is appreciated / Roger
댓글 수: 0
답변 (2개)
Walter Roberson
2021년 12월 14일
편집: Walter Roberson
2021년 12월 14일
filename = "yellowlily.jpg";
RGB = imread(filename);
[R,G,B] = imsplit(RGB);
pointsize = 25;
scatter3(R(:), G(:), B(:), pointsize, rescale([R(:), G(:), B(:)])); axis equal
댓글 수: 7
Image Analyst
2021년 12월 14일
"my next goal is to allow 'picking' points (filled circles or squares) with the mouse so that I can tell what the RGB coordinate of a mouseover or mouse click is."
So after you call imshow(), just call impixelinfo to do that. It will show you the (x,y) and RGB of the pixel your mouse is over
imshow(rgbImage);
impixelinfo;
It works for a displayed color or gray scale image, not for the colorcloud or scatter3 plots.
참고 항목
카테고리
Help Center 및 File Exchange에서 Orange에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!