1 | initial version |
The moments function calculates a weighted moment based on the intensity UNLESS you pass the binary image parameter as true. Then it's the same.
I'm not quite sure what you mean by using the triangle mesh as a master. I think you mean you have each triangle as either white or black. In that case, you need to either do bitwise_and to keep the triangles that are white, or do a bitwise_not to switch the white and black, then the and.
It would help if you made a small picture with say, 8 triangle and a square or circle on the other layer to show what you expect.
2 | No.2 Revision |
The moments function calculates a weighted moment based on the intensity UNLESS you pass the binary image parameter as true. Then it's the same.
I'm not quite sure what you mean by using the triangle mesh as a master. I think you mean you have each triangle as either white or black. In that case, you need to either do bitwise_and to keep the triangles that are white, or do a bitwise_not to switch the white and black, then the and.
It would help if you made a small picture with say, 8 triangle and a square or circle on the other layer to show what you expect.
EDIT: Here's a practice image small enough to look at every pixel if you need to.