Open cdigit opened 1 year ago
I'm not completely following you for what you want, but it sounds like your approach is wrong.
copyRectify will warp the image , mapping the pixels within the given point coordinates to the new image pixels.
It sounds to me like what you are wanting is a rectangle mask that can be rotated.
If that is the case, unfortunately I don't have much for masking type of functions currently. It would be good to add those.
Yes, a better way to put it is to rotate the mask as you put it. This way the copied image is not rotated but the only the mask, which will leave the image with slanted edges. Thanks for letting me know what the capabilities are.
I'm in a similar situation to this question where I want to be able to rotate and transform the bounding box coordinates that copyRectify uses. I'm not so concerned about the structure to hold coordinates, but whether this is even possible: How to Transform Coordinates using a Matrix4
I took a whack at it using the Image Library and vector_math Library like the code below. Output: I am getting some rotation, but It is the image piece itself along with another portion of the larger image outside of the original bounding box (that's another problem when rotating too much): (top=original image piece, bottom=rotated) https://imgur.com/82WNCP6
Expected: I want the "bounding box/selection" to be rotated and then the image copied from there. For example, If I applied the rotation transformation to 30 degrees, then the output would be a normal, non-rotated image that has been cropped with rotated sides that look more rhomboid than square like this: https://imgur.com/WKXBKs1
Question Why is the entire image rotated and not the "bounding box"? Is it even possible to use CopyRectify to copy a piece of an image inside of a rotated rectangle or is my approach wrong?