I want to extract text from an image for which I need to rotate it in steps of 90 degrees.When I rotate the image using
pixRotate(image, deg2rad * angle, L_ROTATE_AREA_MAP, L_BRING_IN_BLACK, 0, 0)
some pixels at the top and bottom are lost.The variations I have tried are
pixRotate(image, deg2rad * angle, L_ROTATE_AREA_MAP, L_BRING_IN_BLACK, w, h)
and also with L_ROTATE_SHEAR, L_ROTATE_SAMPLING.However The pixels near the boundary are getting lost in each case.Is there a way to do this rotation without loosing pixels?
You have specific functions for 90°, 180° and 270° rotations, that are defined in rotateorth.c, as detailed in the documentation :
For those rotations (90° or 180°) you should only consider the functions above, since they don't make any approximation of pixel position in the destination image (and they are much faster): so you won't loose any pixels. The pixRotate function (and the ones alike) are for any other angle.