Skip to content
Snippets Groups Projects
Commit abf8296f authored by polarbean's avatar polarbean
Browse files

fix region padding based on gergelys feedback

parent d6a9b3a9
No related branches found
No related tags found
No related merge requests found
{
"python.formatting.provider": "black"
"python.formatting.provider": "black",
"python.testing.unittestArgs": [
"-v",
"-s",
"./tests",
"-p",
"test*.py"
],
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": true
}
\ No newline at end of file
......@@ -209,7 +209,10 @@ def warp_image(image, triangulation, rescaleXY):
newY[newY >= reg_h] = reg_h - 1
newX[newX < 0] = 0
newY[newY < 0] = 0
new_image = image[newY, newX]
new_image = np.zeros_like(image)
mask = (newX <= reg_w) & (newY <= reg_h) & (newX > 0) & (newY > 0)
new_image[mask] = image[mask]
new_image[~mask] = 0
return new_image
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment