neuvision
neuvision copied to clipboard
Scan function problem
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
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 ;)
Hi, you can try the branch chore-bugfixes
, it should fix the scanning with binary patterns
Ok, thank you