-
Notifications
You must be signed in to change notification settings - Fork 54
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
怎么进行双目实时重建 #17
Labels
question
Further information is requested
Comments
没太明白意思,就正常的解相、匹配就行了。都是用CUDA加速会更快点,但用互补格雷码方案,会由于图像数目过多导致帧率比较低。投影仪简单离焦就行了。可以自行查阅部分源码。 bool BinocularCamera::continuesCapture(SafeQueue<FrameData> &frameDataQueue) {
if (!isCaptureStop_.load(std::memory_order_acquire)) {
return true;
}
if (imgCreateThread_.joinable()) {
imgCreateThread_.join();
}
if (frameDataCreateThread_.joinable()) {
frameDataCreateThread_.join();
}
isCaptureStop_.store(false, std::memory_order_release);
imgCreateThread_ = std::thread([&] {
const device::CameraFactory::CameraManufactor manufator =
stringProperties_["2D Camera Manufactor"] == "Huaray"
? device::CameraFactory::Huaray
: device::CameraFactory::Halcon;
auto pLeftCamera = cameraFactory_.getCamera(
stringProperties_["Left Camera Name"], manufator);
auto pRightCamera = cameraFactory_.getCamera(
stringProperties_["Right Camera Name"], manufator);
device::Camera *pColorCamera = nullptr;
if (stringProperties_["Color Camera Name"] != "") {
pColorCamera = cameraFactory_.getCamera(
stringProperties_["Color Camera Name"], manufator);
}
const int imgSizeWaitFor = numbericalProperties_["Total Fringes"];
while (!isCaptureStop_.load(std::memory_order_acquire)) {
if (pLeftCamera->getImgs().size() >= imgSizeWaitFor &&
pRightCamera->getImgs().size() >= imgSizeWaitFor &&
(pColorCamera ? pColorCamera->getImgs().size() >= imgSizeWaitFor
: true)) {
std::vector<std::vector<cv::Mat>> imgs(pColorCamera ? 3 : 2);
int index = 0;
while (index != imgSizeWaitFor) {
imgs[0].emplace_back(pLeftCamera->popImg());
imgs[1].emplace_back(pRightCamera->popImg());
if (pColorCamera) {
imgs[2].emplace_back(pColorCamera->popImg());
}
++index;
}
if (imgsCreated_.size() > 2) {
continue;
}
imgsCreated_.push(imgs);
}
}
});
frameDataCreateThread_ = std::thread([&] {
while (!isCaptureStop_.load(std::memory_order_acquire)) {
if (imgsCreated_.empty()) {
std::this_thread::sleep_for(std::chrono::milliseconds(5));
continue;
}
std::vector<std::vector<cv::Mat>> imgs;
imgsCreated_.move_pop(imgs);
if (stringProperties_["Color Camera Name"] != "") {
for (int i = 0; i < imgs.size(); ++i) {
cv::cvtColor(imgs[i], imgs[i], cv::COLOR_BayerBG2BGR);
}
}
FrameData curFrameData;
decode(imgs, curFrameData);
frameDataQueue.push(curFrameData);
}
});
projectorFactory_.getProjector(stringProperties_["DLP Evm"])->project(true);
return true;
} |
好的,谢谢您! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Desktop (please complete the following information):
博主代码里怎么进行双目实时重建?就是二值离焦后再用互补格雷码相位展开在匹配重建。
投影仪那里怎么操作?
The text was updated successfully, but these errors were encountered: