Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scan function problem #43

Open
omarcin96 opened this issue May 23, 2019 · 3 comments
Open

Scan function problem #43

omarcin96 opened this issue May 23, 2019 · 3 comments

Comments

@omarcin96
Copy link

omarcin96 commented May 23, 2019

Hello,
I have three problems:

  • When I calibrate cameras using MultiCameraCalibration, i can't update and save calibration file. It is not implement yet?
  • Stereo preview camera in MultiCameraCalibration doesn't work after calibration camera.
  • Point cloud is not generated, When I click scan button.

First problem and second problem isn't critical, because MultiCameraCalibration save calibration in tmp directory. I try resolved third problem. I think problem is in this section:

`
Z3D::ZPointCloudPtr ZStereoSystemImpl::triangulate(const cv::Mat &leftColorImage, const cv::Mat &leftDecodedImage, const cv::Mat &rightDecodedImage)
{
//! TODO compute this once and keep in memory?
cv::Mat rmap[2][2];
for (size_t k = 0; k < 2; k++) {
cv::initUndistortRectifyMap(m_calibration->cameraMatrix[k], m_calibration->distCoeffs[k], m_R[k], m_P[k], m_imageSize, CV_16SC2, rmap[k][0], rmap[k][1]);
}

cv::Mat leftColorRemapedImage;
cv::remap(leftColorImage, leftColorRemapedImage, rmap[0][0], rmap[0][1], cv::INTER_LINEAR);
cv::Mat leftRemapedImage;
cv::remap(leftDecodedImage, leftRemapedImage, rmap[0][0], rmap[0][1], cv::INTER_LINEAR);

cv::Mat rightRemapedImage;
cv::remap(rightDecodedImage, rightRemapedImage, rmap[1][0], rmap[1][1], cv::INTER_LINEAR);


qDebug("%i %i %i", leftColorImage.type(), leftDecodedImage.type(), rightDecodedImage.type());

switch (leftRemapedImage.type()) {
case CV_32F: // float
    return process<float>(leftColorRemapedImage, m_Q, leftRemapedImage, rightRemapedImage);
default:
    qWarning() << "unkwnown image type:" << leftRemapedImage.type();
}

return nullptr;

}
`

Because, leftColorRemapedImage has invalid format type. It should be CV_32F and it is CV_8U. So, process function isn't call.

My Hardware:

  • HDMI Projector
  • 2x Point Grey Camera with USB interface
@nikolaseu
Copy link
Owner

Hi, yes, some things are not finished and it's certainly possible that there are also some bugs.

About the data type and the code not handling CV_8U: I will try to test/fix it tomorrow with the binary patterns, because yes, it seems it only handles float (used for other non-open-source plugins that are better than binary). Or maybe you already tried/fixed it? PRs welcome ;)

@nikolaseu
Copy link
Owner

Hi, you can try the branch chore-bugfixes, it should fix the scanning with binary patterns

@omarcin96
Copy link
Author

Ok, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants