mirror of
https://github.com/opencv/opencv.git
synced 2024-11-24 03:00:14 +08:00
fix TypeError when specifying compose_megapix
without rounding the composed image sizes (variable "sz") they will be odly fractions of a pixel (e.g. (5300.965, 3772.897)) and therefore cause a "TypeError: integer argument expected, got float" in line 456 roi = warper.warpRoi(sz, K, cameras[i].R)
This commit is contained in:
parent
4ab0377c6e
commit
863ab0e72e
@ -450,7 +450,8 @@ def main():
|
||||
cameras[i].focal *= compose_work_aspect
|
||||
cameras[i].ppx *= compose_work_aspect
|
||||
cameras[i].ppy *= compose_work_aspect
|
||||
sz = (full_img_sizes[i][0] * compose_scale, full_img_sizes[i][1] * compose_scale)
|
||||
sz = (int(round(full_img_sizes[i][0] * compose_scale)),
|
||||
int(round(full_img_sizes[i][1] * compose_scale)))
|
||||
K = cameras[i].K().astype(np.float32)
|
||||
roi = warper.warpRoi(sz, K, cameras[i].R)
|
||||
corners.append(roi[0:2])
|
||||
|
Loading…
Reference in New Issue
Block a user