% generate points

function [points_skeleton] = GeneratePoints(skel,optreg)

img_width = optreg.img_width;
img_height = optreg.img_height;
new_frame = optreg.new_frame;

[I, J, K] = ind2sub([img_height img_width new_frame(3)],find(skel));
points_skeleton = [I J K];
points_skeleton = points_skeleton(:,[2 1 3]);

end