Replace ROI with variable texture
이전 댓글 표시
Hi! I would like to know whether someone has a better way of doing the following. I have a grayscale image IMG and a certain ROI specified by the (n x 2) index data INDEX, where n is the number of points in the ROI, thus naturally INDEX(i,1) = xi and INDEX(i,2) = yi, i = 1, ..., n. Moreover for each corresponding i-th point, a value is specified in a (n x 1) vector TEXTURE, so that TEXTURE(i) is the value of point (xi, yi). Naturally I want to fill in the IMG with the values in TEXTURE. The following works:
for i = 1:length(INDEX)
x = INDEX(i,1);
y = INDEX(i,2);
IMG(x,y) = TEXTURE(i);
end
Is there a better way of doing this? Maybe without a for loop?
Thanks in advance! Please criticise.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Images에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!