c++ - OpenCV: can projectPoints return negative values? -


i'm using cv::projectpoints correspondent pixels of vector of 3d points.

the points near each other.

the problem points correct pixels coordinates other strange negative values -22599...

is normal cv::projectpoints return negative values or bug in code?

void singlecameratriangulator::projectpointstoimage2(const std::vector< cv::vec3d >& pointsgroup, const double scale, std::vector< pixel >& pixels) {     cv::vec3d          t2, r2;      decomposetransformation(*g_12_, r2, t2);      cv::mat imagepoints2;      cv::projectpoints(pointsgroup, r2, t2, *camera_matrix_, *distortion_coefficients_, imagepoints2);      (std::size_t = 0; < imagepoints2.rows; i++)     {         cv::vec2d pixel = imagepoints2.at<cv::vec2d>(i);         pixel p;         p.x_ = pixel[0];         p.y_ = pixel[1];         if ( (p.x_ < 0) || (p.x_ > ((1 / scale) * img_1_->cols)) || (p.y_ < 0) || (p.y_ > ((1/scale) * img_1_->rows)))         {             cv::vec3d point = pointsgroup[i];             std::cout << point << " - " << pixel << " - " << pixel*scale << "problema" << std::endl;         }         p.i_ = getbilinearinterppix32f(*img_2_, scale * p.x_, scale * p.y_);          pixels.push_back(p);     } } 

thank in advance suggestions.

reprojectimageto3d (are use getting 3d points?) gives large z coordinates (10000) outlier points, think problem here.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -