Closed amigalemming closed 5 years ago
Hi, sorry for the late reply.
Good point! Adding the destination size parameter is a good idea. I'll try to fix this and work it into the example.
Well that's reassuring: I just came here to report the same thing! To be sure we're on the same page, this is the offending line, correct? https://github.com/LumiGuide/haskell-opencv/blob/dd51d7cfb1513e03516706465c246164e33fb589/opencv/src/OpenCV/ImgProc/GeometricImgTransform.hsc#L223
And the problem it creates is that you can't pass a different size, e.g. as show in this SO answer?
If ⬆️ is correct, then should we:
Change warpAffine
to take a Size
(API breaking), or:
Can we do something clever with the type system use this [height, width]
for the size?
https://github.com/LumiGuide/haskell-opencv/blob/dd51d7cfb1513e03516706465c246164e33fb589/opencv/src/OpenCV/ImgProc/GeometricImgTransform.hsc#L208
Currently
warpAffine
sets the size of the output image simply to the size of the input image. Unfortunately, this way transformed images are clipped. In order to avoid clipping one has to choose a larger destination image size and has to adjust the translation part of the transformation. How about adding the destination size parameter to the Haskell wrapper?