Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Standard Deviation calculation of calibrateCamera incorrect #19803

Closed
Assignees
savuor
Milestone
@Seneral

Description

@Seneral
System information (version)
  • OpenCV => 4.5.1
  • Operating System / Platform => Ubuntu 64 Bit
  • Compiler => gcc
Detailed description

The standard deviation calculation of calibrateCamera is returning NaN for all standard deviations in all cases when provided with comparably low numbers of points.
This is due tothis line, where the divisor and thussigma2 can become negative. The variabletotal usually isnimages*maxPoints or less,nparams = nimages*6+18 (for standard calibration method), andnparams_nz < nparams.
For the casetotal < nparams_nz < nparams the resultingsigma2 is negative.
This can (and nearly always does) happen whenmaxPoints = 6 sototal/nparams < 1.
This is likely also why it has been unnoticed so far.

Changing thetotal tonparams yields seemingly correct results.EDIT: Only for my case wheremaxPoints = 6! This might not be a general or even correct fix!

I've also opened aforum question previously, although I'm positive it is a bug.

Steps to reproduce
  1. Generate a sample set of 22 6-point markers
  2. CallcalibrateCameraRO, requesting the standard deviations to be calculated
  • One sample run yielded the following variable values:total=132 (22*6), nparams=150(22*6+18), nparams_nz=139
  1. Observe the returned standard deviations to all be NaN

An example implementation can be found in this larger project (calibrateCameraRO call here).

Issue submission checklist
  • [ X] I report the issue, it's not a question
  • [X ] I checked the problem with documentation, FAQ, open issues,
    forum.opencv.org, Stack Overflow, etc and have not found solution
  • [ X] I updated to latest OpenCV version and the issue is still there
  • [ X] There is reproducer code and related data files: videos, images, onnx, etc

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp