How to plot RGB intensity value from the specific pixel
2 次查看(过去 30 天)
显示 更早的评论
How to plot RGB intensity value from the specific pixel?. Let say I have 50 picked pixel coordinate, I would like to plot these values in to RGB graph.
0 个评论
采纳的回答
Walter Roberson
2017-5-23
Let R be a vector of the row coordinates of the selected pixels, and C be a vector of the corresponding column coordinates. Let your image be I. Then
reds = I(sub2idx(size(I), R(:), C(:), 1 * ones(length(R),1));
greens = I(sub2idx(size(I), R(:), C(:), 2 * ones(length(R),1));
blues = I(sub2idx(size(I), R(:), C(:), 3 * ones(length(R),1));
Now you could plot in whatever way seems appropriate. For example,
X = 1 : length(reds);
plot(X, reds, 'r', X, greens, 'g', X, blues, 'b');
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!