Hi Francesco Pignatelli,
To convert the ouput of the bwboundaries into a matrix of edge values like the function edge() does, you can create a zero matrix of the size(BW), iterate through the output of the bwboundaries and mark the corresponding indices as 1 in the newly created matrix.
Here's some example code :
In your attached file Sigur.m you can modify the for loop to this
edgeMatrix = zeros(size(BW));
for i = 1:numel(boundaries)
boundary = boundaries{i};
[row,~] = size(boundary);
for i = 1:row
x = boundary(i,1);
y = boundary(i,2);
edgeMatrix(x,y) = 1;
end
% xy = boundaries{i};
% plot(xy(:,2),xy(:,1),".")
end
imwrite(edgeMatrix, 'edgeMatrix.png');
With this you can see all the reconstructed edges. I hope this helps :)