i! Faced with such a task: you need to align the image of the face horizontally. I found out that this is done according to the landmarks of the face. But I can’t figure out how to rotate an image in OpenCV. Can someone tell me how this is implemented?
Hi @slepoy_ali.
To rotate an image in OpenCV use the Transform filter and connect a regular Rotate node to it. You can then just manipulate the Rotate node to get te result you want.
If you need the rotation to be in degrees and not cycles (vvvv’s default) you would need to also add a DegreesToCycles (make sure to enable the Advanced nodes) to your patch, something like this:
Something to keep in mind is that when you rotate an image it will no longer fit in its original width and height, so you probably want to insert your image into a larger image first and rotate the larger image (with a padding large enough for your rotated image to be shown completely).
I suggest you have a look at the OpenCV help patches, in particular “Join two images”.
Hope that helps.
Thanks, I figured it out