How i can save all values of segmented image?

1 次查看(过去 30 天)
i have extracted the tomato, now i want to know x,y, RGB, all values regarding this.how i can do it?thanks
see image.tomato.png

采纳的回答

Image Analyst
Image Analyst 2018-12-11
See attached code.

更多回答(1 个)

KSSV
KSSV 2018-12-11
I = imread('download.png') ;
I1 = rgb2gray(I) ;
[y,x] = find(I1) ; % this igves you (x,y)
%
[nx,ny,nz] = size(I) ;
[X,Y] = meshgrid(1:ny,1:nx) ;
R = I(:,:,1) ;
iwant = zeros(length(x),nz) ;
for i = 1:nz
iwant(:,i) = interp2(X,Y,double(I(:,:,i)),x,y) ;
end
  1 个评论
Muhammad Hammad Malik
thanks for your answer but i want to know what these values 'iwant','R','X','Y'means?thanksCaptured.JPG

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by