Skip to content

fix TypeError when specifying compose_megapix in stitching_detailed python sample#20431

Merged
opencv-pushbot merged 1 commit intoopencv:masterfrom
lukasalexanderweber:debug-stitching_detailed.py
Jul 20, 2021
Merged

fix TypeError when specifying compose_megapix in stitching_detailed python sample#20431
opencv-pushbot merged 1 commit intoopencv:masterfrom
lukasalexanderweber:debug-stitching_detailed.py

Conversation

@lukasalexanderweber
Copy link
Copy Markdown
Contributor

@lukasalexanderweber lukasalexanderweber commented Jul 20, 2021

In some cases the user wants to specify the compose_megapix parameter if the resulting image size should be limited.

This causes "compose_scale" to be different than 1

without rounding the composed image sizes (variable "sz") which are calculated by full_img_sizes[i][0] * compose_scale 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)

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

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)
@asmorkalov asmorkalov changed the title fix TypeError when specifying compose_megapix fix TypeError when specifying compose_megapix in stitching_detailed python sample Jul 20, 2021
Copy link
Copy Markdown
Contributor

@asmorkalov asmorkalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@opencv-pushbot opencv-pushbot merged commit 755f4f3 into opencv:master Jul 20, 2021
@lukasalexanderweber lukasalexanderweber deleted the debug-stitching_detailed.py branch July 21, 2021 04:45
@alalek alalek mentioned this pull request Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants