Short: How can i use facedetector coordinates and sizes for image manipulator crop? I want to crop face from photo.
Explanation;
I use expo-camera with facedetection. It works so well. Face detector gives output object
"origin": Object {
"x": 85.00000000000006,
"y": 231.35, }, "size": Object {
"height": 182,
"width": 173.33333333333331, }, }
I can draw a box around face with that coordinates on camera preview mode it fits with screen dimensions. After taking image, output image is much larger than camere preview. So i can’t use that coordinates to crop picture. I updated facedetector coordinates and sizes with respect to image size. For example my if image width 2 times larger than screen width , i multiplied originx, and width with 2. But image manipulator crop didnt give me desired results. Any help would be appreciated.
That is my solution. I take the percentage of the screen dimensions and face dimensions.
Ps. I multiplied both height and width with growtfactor.h because i needed square cropped photo.