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

Fix the 3d code #2181

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/openpose/producer/spinnakerWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#endif
#ifdef USE_FLIR_CAMERA
#include <Spinnaker.h>
#include <ImageProcessor.h>
#endif
#include <openpose/3d/cameraParameterReader.hpp>

Expand Down Expand Up @@ -151,8 +152,8 @@ namespace op
}
}

Spinnaker::ImagePtr spinnakerImagePtrToColor(const Spinnaker::ImagePtr &imagePtr)
{
//Spinnaker::ImagePtr spinnakerImagePtrToColor(const Spinnaker::ImagePtr &imagePtr)
//{
// Original image --> BGR uchar image
// Print image information
// Convert image to RGB
Expand Down Expand Up @@ -211,10 +212,10 @@ namespace op
// ~115, too slow
// return imagePtr->Convert(Spinnaker::PixelFormat_BGR8, Spinnaker::RIGOROUS);
// ~1.7 ms, slightly worse than HQ_LINEAR
return imagePtr->Convert(Spinnaker::PixelFormat_BGR8, Spinnaker::IPP);
//return imagePtr->Convert(Spinnaker::PixelFormat_BGR8, Spinnaker::IPP);
// ~30 ms, ideally best quality?
// return imagePtr->Convert(Spinnaker::PixelFormat_BGR8, Spinnaker::DIRECTIONAL_FILTER);
}
//}

/*
* This function converts between Spinnaker::ImagePtr container to cv::Mat container used in OpenCV.
Expand Down Expand Up @@ -399,7 +400,10 @@ namespace op
try
{
// Original image --> BGR uchar image
const auto imagePtrColor = spinnakerImagePtrToColor(imagePtr);
//const auto imagePtrColor = spinnakerImagePtrToColor(imagePtr);
Spinnaker::ImageProcessor imageProc;
Spinnaker::ImagePtr imagePtrStore = imageProc.Convert(imagePtr, Spinnaker::PixelFormatEnums::PixelFormat_BGR8);
const auto imagePtrColor = imagePtrStore;
// Spinnaker to cv::Mat
const auto cvMatDistorted = spinnakerWrapperToCvMat(imagePtrColor);
// const auto cvMatDistorted = spinnakerWrapperToCvMat(imagePtr);
Expand Down