Answer the question
In order to leave comments, you need to log in
How to crop a 2D array into a rectangle shape?
Who knows the function that would be able to cut a two-dimensional array in the form of a rectangle. That would be possible to specify the place from where to cut and to where.
or if anyone knows explain how to cut in the shape of a rectangle using this function
function CutMap(mat, x, y, w, h) {
return mat.slice(y, y + h).map(function(row) {
return row.slice(x, x + w)
})
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question