- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在尝试使用 cv::calibrateCamera
来校准相机+投影仪系统。虽然它有时似乎有效,但在许多情况下,估计的解决方案似乎与正确的解决方案相去甚远。
这是一个显示问题的代码示例(包括所有数据 - 因此它相当大)
#include <opencv2/core/core.hpp>
#include <opencv2/calib3d/calib3d.hpp>
#include <iostream>
#include <vector>
cv::Mat calculateTransformation(cv::Mat translationVec, cv::Mat rotationVec) {
cv::Mat rotationMat3x3;
cv::Rodrigues(rotationVec, rotationMat3x3);
cv::Mat rotationMat = cv::Mat::eye(4, 4, CV_64F);
rotationMat3x3.copyTo(rotationMat(cv::Rect(0, 0, 3, 3)));
cv::Mat translationMat = cv::Mat::eye(4, 4, CV_64F);
translationVec.copyTo(translationMat(cv::Rect(3, 0, 1, 3)));
return translationMat * rotationMat;
}
int main() {
std::vector<cv::Point2f> image_points;
std::vector<cv::Point3f> object_points;
image_points.push_back(cv::Point2f(400.0f, 940.0f));
image_points.push_back(cv::Point2f(480.0f, 940.0f));
image_points.push_back(cv::Point2f(560.0f, 940.0f));
image_points.push_back(cv::Point2f(640.0f, 940.0f));
image_points.push_back(cv::Point2f(720.0f, 940.0f));
image_points.push_back(cv::Point2f(800.0f, 940.0f));
image_points.push_back(cv::Point2f(880.0f, 940.0f));
image_points.push_back(cv::Point2f(960.0f, 940.0f));
image_points.push_back(cv::Point2f(1040.0f, 940.0f));
image_points.push_back(cv::Point2f(1120.0f, 940.0f));
image_points.push_back(cv::Point2f(1200.0f, 940.0f));
image_points.push_back(cv::Point2f(1280.0f, 940.0f));
image_points.push_back(cv::Point2f(400.0f, 860.0f));
image_points.push_back(cv::Point2f(480.0f, 860.0f));
image_points.push_back(cv::Point2f(560.0f, 860.0f));
image_points.push_back(cv::Point2f(640.0f, 860.0f));
image_points.push_back(cv::Point2f(720.0f, 860.0f));
image_points.push_back(cv::Point2f(800.0f, 860.0f));
image_points.push_back(cv::Point2f(880.0f, 860.0f));
image_points.push_back(cv::Point2f(960.0f, 860.0f));
image_points.push_back(cv::Point2f(1040.0f, 860.0f));
image_points.push_back(cv::Point2f(1120.0f, 860.0f));
image_points.push_back(cv::Point2f(1200.0f, 860.0f));
image_points.push_back(cv::Point2f(1280.0f, 860.0f));
image_points.push_back(cv::Point2f(400.0f, 780.0f));
image_points.push_back(cv::Point2f(480.0f, 780.0f));
image_points.push_back(cv::Point2f(560.0f, 780.0f));
image_points.push_back(cv::Point2f(640.0f, 780.0f));
image_points.push_back(cv::Point2f(720.0f, 780.0f));
image_points.push_back(cv::Point2f(800.0f, 780.0f));
image_points.push_back(cv::Point2f(880.0f, 780.0f));
image_points.push_back(cv::Point2f(960.0f, 780.0f));
image_points.push_back(cv::Point2f(1040.0f, 780.0f));
image_points.push_back(cv::Point2f(1120.0f, 780.0f));
image_points.push_back(cv::Point2f(1200.0f, 780.0f));
image_points.push_back(cv::Point2f(1280.0f, 780.0f));
image_points.push_back(cv::Point2f(400.0f, 700.0f));
image_points.push_back(cv::Point2f(480.0f, 700.0f));
image_points.push_back(cv::Point2f(560.0f, 700.0f));
image_points.push_back(cv::Point2f(640.0f, 700.0f));
image_points.push_back(cv::Point2f(720.0f, 700.0f));
image_points.push_back(cv::Point2f(800.0f, 700.0f));
image_points.push_back(cv::Point2f(880.0f, 700.0f));
image_points.push_back(cv::Point2f(960.0f, 700.0f));
image_points.push_back(cv::Point2f(1040.0f, 700.0f));
image_points.push_back(cv::Point2f(1120.0f, 700.0f));
image_points.push_back(cv::Point2f(1200.0f, 700.0f));
image_points.push_back(cv::Point2f(1280.0f, 700.0f));
image_points.push_back(cv::Point2f(400.0f, 620.0f));
image_points.push_back(cv::Point2f(480.0f, 620.0f));
image_points.push_back(cv::Point2f(560.0f, 620.0f));
image_points.push_back(cv::Point2f(640.0f, 620.0f));
image_points.push_back(cv::Point2f(720.0f, 620.0f));
image_points.push_back(cv::Point2f(800.0f, 620.0f));
image_points.push_back(cv::Point2f(880.0f, 620.0f));
image_points.push_back(cv::Point2f(960.0f, 620.0f));
image_points.push_back(cv::Point2f(1120.0f, 620.0f));
image_points.push_back(cv::Point2f(1040.0f, 620.0f));
image_points.push_back(cv::Point2f(1200.0f, 620.0f));
image_points.push_back(cv::Point2f(1280.0f, 620.0f));
image_points.push_back(cv::Point2f(400.0f, 540.0f));
image_points.push_back(cv::Point2f(480.0f, 540.0f));
image_points.push_back(cv::Point2f(560.0f, 540.0f));
image_points.push_back(cv::Point2f(640.0f, 540.0f));
image_points.push_back(cv::Point2f(720.0f, 540.0f));
image_points.push_back(cv::Point2f(800.0f, 540.0f));
image_points.push_back(cv::Point2f(880.0f, 540.0f));
image_points.push_back(cv::Point2f(1200.0f, 540.0f));
image_points.push_back(cv::Point2f(1120.0f, 540.0f));
image_points.push_back(cv::Point2f(480.0f, 460.0f));
image_points.push_back(cv::Point2f(400.0f, 460.0f));
image_points.push_back(cv::Point2f(560.0f, 460.0f));
image_points.push_back(cv::Point2f(720.0f, 460.0f));
image_points.push_back(cv::Point2f(640.0f, 460.0f));
image_points.push_back(cv::Point2f(800.0f, 460.0f));
image_points.push_back(cv::Point2f(1120.0f, 460.0f));
image_points.push_back(cv::Point2f(880.0f, 460.0f));
image_points.push_back(cv::Point2f(1040.0f, 460.0f));
image_points.push_back(cv::Point2f(1280.0f, 460.0f));
image_points.push_back(cv::Point2f(1120.0f, 380.0f));
image_points.push_back(cv::Point2f(1280.0f, 380.0f));
image_points.push_back(cv::Point2f(1200.0f, 380.0f));
image_points.push_back(cv::Point2f(1040.0f, 380.0f));
image_points.push_back(cv::Point2f(880.0f, 380.0f));
image_points.push_back(cv::Point2f(800.0f, 380.0f));
image_points.push_back(cv::Point2f(960.0f, 380.0f));
image_points.push_back(cv::Point2f(640.0f, 380.0f));
image_points.push_back(cv::Point2f(720.0f, 380.0f));
image_points.push_back(cv::Point2f(560.0f, 380.0f));
image_points.push_back(cv::Point2f(400.0f, 380.0f));
image_points.push_back(cv::Point2f(480.0f, 380.0f));
image_points.push_back(cv::Point2f(1120.0f, 300.0f));
image_points.push_back(cv::Point2f(1040.0f, 300.0f));
image_points.push_back(cv::Point2f(960.0f, 300.0f));
image_points.push_back(cv::Point2f(880.0f, 300.0f));
image_points.push_back(cv::Point2f(800.0f, 300.0f));
image_points.push_back(cv::Point2f(720.0f, 300.0f));
image_points.push_back(cv::Point2f(640.0f, 300.0f));
image_points.push_back(cv::Point2f(560.0f, 300.0f));
image_points.push_back(cv::Point2f(480.0f, 300.0f));
image_points.push_back(cv::Point2f(400.0f, 300.0f));
image_points.push_back(cv::Point2f(1280.0f, 220.0f));
image_points.push_back(cv::Point2f(1200.0f, 220.0f));
image_points.push_back(cv::Point2f(1120.0f, 220.0f));
image_points.push_back(cv::Point2f(1040.0f, 220.0f));
image_points.push_back(cv::Point2f(960.0f, 220.0f));
image_points.push_back(cv::Point2f(800.0f, 220.0f));
image_points.push_back(cv::Point2f(720.0f, 220.0f));
image_points.push_back(cv::Point2f(640.0f, 220.0f));
image_points.push_back(cv::Point2f(560.0f, 220.0f));
image_points.push_back(cv::Point2f(480.0f, 220.0f));
image_points.push_back(cv::Point2f(400.0f, 220.0f));
image_points.push_back(cv::Point2f(1280.0f, 140.0f));
image_points.push_back(cv::Point2f(1200.0f, 140.0f));
image_points.push_back(cv::Point2f(1040.0f, 140.0f));
image_points.push_back(cv::Point2f(960.0f, 140.0f));
image_points.push_back(cv::Point2f(800.0f, 140.0f));
image_points.push_back(cv::Point2f(720.0f, 140.0f));
image_points.push_back(cv::Point2f(640.0f, 140.0f));
image_points.push_back(cv::Point2f(560.0f, 140.0f));
image_points.push_back(cv::Point2f(480.0f, 140.0f));
image_points.push_back(cv::Point2f(400.0f, 140.0f));
image_points.push_back(cv::Point2f(960.0f, 540.0f));
image_points.push_back(cv::Point2f(1040.0f, 540.0f));
image_points.push_back(cv::Point2f(960.0f, 460.0f));
object_points.push_back(cv::Point3f(-0.0671159000000000f, -0.0530089000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0572335000000000f, -0.0531021000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0473920000000000f, -0.0531268000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0375422000000000f, -0.0531293000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0277093000000000f, -0.0532232000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0179416000000000f, -0.0532900000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.00818986000000000f, -0.0533080000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.00159555000000000f, -0.0533734000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0113126000000000f, -0.0534102000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0210113000000000f, -0.0534688000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0307716000000000f, -0.0535300000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0404079000000000f, -0.0535600000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0668703000000000f, -0.0429498000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0569997000000000f, -0.0430325000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0471452000000000f, -0.0430930000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0373059000000000f, -0.0431530000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0274813000000000f, -0.0432117000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0176713000000000f, -0.0432687000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.00790218000000000f, -0.0433224000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.00190183000000000f, -0.0433762000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0116116000000000f, -0.0434242000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0213028000000000f, -0.0434700000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0310283000000000f, -0.0435404000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0406556000000000f, -0.0436058000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0666877000000000f, -0.0329366000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0568031000000000f, -0.0329860000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0469101000000000f, -0.0330818000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0370300000000000f, -0.0331543000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0272122000000000f, -0.0332004000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0173840000000000f, -0.0332688000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.00759575000000000f, -0.0333343000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.00215042000000000f, -0.0334201000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0119054000000000f, -0.0334816000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0215901000000000f, -0.0335390000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0313087000000000f, -0.0336208000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0409288000000000f, -0.0336740000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0664698000000000f, -0.0228786000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0565702000000000f, -0.0229386000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0466851000000000f, -0.0230437000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0367625000000000f, -0.0230813000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0269267000000000f, -0.0231839000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0171296000000000f, -0.0232845000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.00732099000000000f, -0.0232912000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.00244503000000000f, -0.0234120000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0121943000000000f, -0.0235079000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0218997000000000f, -0.0235779000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0316661000000000f, -0.0236490000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0413080000000000f, -0.0237153000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0662403000000000f, -0.0127937000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0563243000000000f, -0.0128856000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0464450000000000f, -0.0129539000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0365046000000000f, -0.0130461000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0266992000000000f, -0.0131572000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0168820000000000f, -0.0132217000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.00702858000000000f, -0.0133096000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.00273311000000000f, -0.0134175000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0222048000000000f, -0.0135829000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0124779000000000f, -0.0135008000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0319668000000000f, -0.0136414000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0416578000000000f, -0.0137210000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0660230000000000f, -0.00272328000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0560886000000000f, -0.00280125000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0461911000000000f, -0.00292352000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0362558000000000f, -0.00302379000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0264298000000000f, -0.00309841000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0165924000000000f, -0.00321897000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.00674314000000000f, -0.00331641000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0322628000000000f, -0.00369330000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0225310000000000f, -0.00360024000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0558388000000000f, 0.00733873000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0657448000000000f, 0.00744612000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0458967000000000f, 0.00723106000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0261183000000000f, 0.00701760000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0359654000000000f, 0.00710082000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0162843000000000f, 0.00688856000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0228789000000000f, 0.00646718000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.00641300000000000f, 0.00678188000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0131059000000000f, 0.00657206000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0422672000000000f, 0.00628497000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0231953000000000f, 0.0165035000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0425539000000000f, 0.0162757000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0328968000000000f, 0.0163892000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0133982000000000f, 0.0166424000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.00611577000000000f, 0.0168486000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0160094000000000f, 0.0169642000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.00368791000000000f, 0.0167334000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0357336000000000f, 0.0171710000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0258655000000000f, 0.0170562000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0456858000000000f, 0.0173090000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0655273000000000f, 0.0175171000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0555765000000000f, 0.0174012000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0235599000000000f, 0.0266047000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0137369000000000f, 0.0267060000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.00400251000000000f, 0.0268771000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.00579988000000000f, 0.0269546000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0156666000000000f, 0.0270784000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0255455000000000f, 0.0272245000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0354855000000000f, 0.0273244000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0454115000000000f, 0.0274243000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0553239000000000f, 0.0275921000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0652735000000000f, 0.0276931000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0432836000000000f, 0.0364607000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0335970000000000f, 0.0365698000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0239205000000000f, 0.0367035000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0140970000000000f, 0.0368368000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.00436217000000000f, 0.0369936000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0152808000000000f, 0.0372578000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0252343000000000f, 0.0373656000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0351242000000000f, 0.0374961000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0450986000000000f, 0.0376261000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0550835000000000f, 0.0377566000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0649853000000000f, 0.0379110000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0436747000000000f, 0.0466393000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0339311000000000f, 0.0467559000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0144269000000000f, 0.0470150000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.00466523000000000f, 0.0471564000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0150279000000000f, 0.0474823000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0248820000000000f, 0.0475522000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0348463000000000f, 0.0476901000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0447968000000000f, 0.0478509000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0547835000000000f, 0.0479670000000000f, 0.0f));
object_points.push_back(cv::Point3f(-0.0647592000000000f, 0.0481078000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.00301477000000000f, -0.00341146000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.0128075000000000f, -0.00350684000000000f, 0.0f));
object_points.push_back(cv::Point3f(0.00336785000000000f, 0.00670002000000000f, 0.0f));
std::vector<std::vector<cv::Point2f>> all_image_points;
all_image_points.push_back(image_points);
std::vector<std::vector<cv::Point3f>> all_object_points;
all_object_points.push_back(object_points);
cv::Mat camera_mat = cv::Mat::eye(3, 3, CV_64F);
cv::Mat dist_coeffs = cv::Mat::zeros(4, 1, CV_64F);
std::vector<cv::Mat> rvecs;
std::vector<cv::Mat> tvecs;
double reprojection_error = cv::calibrateCamera(all_object_points, all_image_points, cv::Size(1920, 1080), camera_mat, dist_coeffs, rvecs, tvecs);
std::cout << "Reprojection error: " << reprojection_error << std::endl;
cv::Mat transformation = calculateTransformation(tvecs.front(), rvecs.front());
cv::Mat origin = cv::Mat::zeros(4, 1, CV_64F);
origin.at<double>(3, 0) = 1.0;
std::cout << "distance to board: " << cv::norm(transformation * origin) << std::endl;
return 0;
}
k2
的值高于 200,这有点奇怪如果有人想使用 matlab 可视化数据:我已经简单地使用了
plot3([image_points(1,:);object_points(1,:) * 10000], [image_points(2,:);object_points(2,:) * -10000], [zeros(1, 125); ones(1, 125)], 'b-')
因此,对象和图像点之间的每个对应对应一行。
如果需要更多信息,请发表评论。
最佳答案
我的提议是在相机校准过程中使用不同的非共面装备(表面)。 opencv 使用的算法肯定需要至少两个不同的 View 才能执行良好的校准。如果可能,提供几个不同角度的 View (2 个只是起点,最好是 10 个)。我现在不是 100% 确定,但我认为非平面要求是 sine qua non 条件,即你不能用共面 View 获得好的结果(因为实际上它们只是根据比例不同因此在某些词中我们可以说它们在投影几何方面是同构的)。
还有一个关于投影误差的评论——在测试案例中大约是 0.65,这似乎是准确的……但这是棘手的部分——因为我们只使用一个装备来校准相机,所以根据定义,当 opencv 重新投影回点时,它只有一个表面可以重新投影到。换言之,标定误差很小且大于零,只是因为存在给定点投影的噪声。
关于c++ - OpenCV calibrateCamera 不收敛到正确的解决方案(投影仪校准),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23568696/
我正在尝试从我的系统中完全删除 opencv。我试图学习 ROS,而在教程中我遇到了一个问题。创建空工作区后,我调用catkin_make 它给出了一个常见错误,我在 answers.ros 中搜索并
我在尝试逐步转移对warpAffine的调用时遇到崩溃(不是异常): void rotateImage( const Mat& source, double degree, Mat& output )
如何处理opencv gpu异常?是否有用于opencvgpu异常处理的特定错误代码集api? 我尝试了很多搜索,但只有1个错误代码,即CV_GpuNotSupported。 请帮帮我。 最佳答案 虽
笔记 我是 OpenCV(或计算机视觉)的新手,所以告诉我搜索查询会很有帮助! 我想问什么 我想编写一个从图片中提取名片的程序。 我能够提取粗略的轮廓,但反射光会变成噪点,我无法提取准确的轮廓。请告诉
我想根据像素的某个阈值将Mono16类型的Mat转换为二进制图像。我尝试使用以下内容: 阈值(img,ret,0.1,1,CV_THRESH_BINARY); 尝试编译时,出现make错误,提示: 错
我对使用GPU加速的OpenCV中的卷积函数有疑问。 使用GPU的卷积速度大约快3.5 运行时: convolve(src_32F, kernel, cresult, false, cbuffer);
我正在尝试使用非对称圆圈网格执行相机校准。 我通常找不到适合CirclesGridFinder的文档,尤其是findHoles()函数的文档。 如果您有关于此功能如何工作以及其参数含义的信息,将不胜感
在计算机上绘图和在 OpenCV 的投影仪上投影之间有什么区别吗? 一种选择是投影显示所有内容的计算机屏幕。但也许也有这样的选择,即在投影仪上精确地绘制和投影图像,仅使用计算机作为计算机器。如果我能做
我将Processing(processing.org)用于需要人脸跟踪的项目。现在的问题是由于for循环,程序将耗尽内存。我想停止循环或至少解决内存不足的问题。这是代码。 import hyperm
我有下面的代码: // Image Processing.cpp : Defines the entry point for the console application. // //Save
我正在为某些项目使用opencv。并有应解决的任务。 任务很简单。我有一张主图片,并且有一个模板,而不是将主图片与模板进行比较。我使用matchTemplate()函数。我只是好奇一下。 在文档中,我
我正在尝试使用以下命令创建级联分类器: haartraining -data haarcascade -vec samples.vec -bg negatives.dat -nstages 20 -n
我试图使用OpenCV检测黑色图像中一组形状的颜色,为此我使用了Canny检测。但是,颜色输出总是返回为黑色。 std::vector > Asteroids::DetectPoints(const
我正在尝试使用OpenCv 2.4.5从边缘查找渐变方向,但是我在使用cvSobel()时遇到问题,以下是错误消息和我的代码。我在某处读到它可能是由于浮点(??)之间的转换,但我不知道如何解决它。有帮
我正在尝试构建循环关闭算法,但是在开始开发之前,我想测试哪种功能描述符在真实数据集上效果更好。 我有两个在两个方向拍摄的走廊图像,一个进入房间,另一个离开同一个房间。因此它们代表相同的场景,但具有2个
有没有一种方法可以比较直方图,但例如要排除白色,因此白色不会影响比较。 最佳答案 白色像素有 饱和度 , S = 0 .因此,在创建直方图时很容易从计数中删除白色像素。请执行下列操作: 从 BGR 转
就像本主题的标题一样,如何在OpenCV中确定图像的特定像素(灰度或彩色)是否饱和(例如,亮度过高)? 先感谢您。 最佳答案 根据定义,饱和像素是指与强度(即灰度值或颜色分量之一)等于255相关联的像
我是OpenCV的新用户,正在从事大学项目。程序会获取输入图像,对其进行综合模糊处理,然后对其进行模糊处理。当对合成模糊图像进行反卷积时,会生成边界伪像,因为...好吧,到目前为止,我还没有实现边界条
我想知道OpenCV是haar特征还是lbp是在多尺度搜索过程中缩放图像还是像论文中提到的那样缩放特征本身? 编辑:事实证明,检测器可以缩放图像,而不是功能。有人知道为什么吗?通过缩放功能可以更快。
我在openCv中使用SVM.train命令(已定义了适当的参数)。接下来,我要使用我的算法进行分类,而不是使用svm.predict。 可能吗?我可以访问训练时生成的支持 vector 吗?如果是这
我是一名优秀的程序员,十分优秀!