remove unused code

This commit is contained in:
Joe Dong
2022-12-28 15:12:04 +08:00
parent 470ebe1c5f
commit 02cc12518b
2 changed files with 12 additions and 108 deletions
-86
View File
@@ -406,92 +406,6 @@ std::optional<OBCameraParam> OBCameraNode::findDefaultCameraParam() {
return {};
}
std::optional<OBCameraParam> OBCameraNode::findStreamDefaultCameraParam(
const stream_index_pair& stream) {
uint32_t width = width_[stream];
uint32_t height = height_[stream];
auto camera_params = device_->getCalibrationCameraParamList();
for (size_t i = 0; i < camera_params->count(); i++) {
auto param = camera_params->getCameraParam(i);
OBCameraIntrinsic intrinsic;
if (stream.first == OB_STREAM_COLOR) {
intrinsic = param.rgbIntrinsic;
} else if (stream.first == OB_STREAM_DEPTH) {
intrinsic = param.depthIntrinsic;
} else {
return {};
}
if (width * intrinsic.height == height * intrinsic.width) {
return param;
}
}
return {};
}
std::optional<OBCameraParam> OBCameraNode::findStreamCameraParam(const stream_index_pair& stream,
uint32_t width, uint32_t height) {
auto camera_params = device_->getCalibrationCameraParamList();
for (size_t i = 0; i < camera_params->count(); i++) {
auto param = camera_params->getCameraParam(i);
OBCameraIntrinsic intrinsic;
if (stream.first == OB_STREAM_COLOR) {
intrinsic = param.rgbIntrinsic;
} else if (stream.first == OB_STREAM_DEPTH) {
intrinsic = param.depthIntrinsic;
} else {
return {};
}
if (width * intrinsic.height == height * intrinsic.width) {
return param;
}
}
return {};
}
std::optional<OBCameraParam> OBCameraNode::findCameraParam(uint32_t color_width,
uint32_t color_height,
uint32_t depth_width,
uint32_t depth_height) {
auto camera_params = device_->getCalibrationCameraParamList();
for (size_t i = 0; i < camera_params->count(); i++) {
auto param = camera_params->getCameraParam(i);
int depth_w = param.depthIntrinsic.width;
int depth_h = param.depthIntrinsic.height;
int color_w = param.rgbIntrinsic.width;
int color_h = param.rgbIntrinsic.height;
if ((depth_w * depth_height == depth_h * depth_width) &&
(color_w * color_height == color_h * color_width)) {
return param;
}
}
return {};
}
std::optional<OBCameraParam> OBCameraNode::findDepthCameraParam(uint32_t width, uint32_t height) {
auto camera_params = device_->getCalibrationCameraParamList();
for (size_t i = 0; i < camera_params->count(); i++) {
auto param = camera_params->getCameraParam(i);
int depth_w = param.depthIntrinsic.width;
int depth_h = param.depthIntrinsic.height;
if (depth_w * height == depth_h * width) {
return param;
}
}
return {};
}
std::optional<OBCameraParam> OBCameraNode::findColorCameraParam(uint32_t width, uint32_t height) {
auto camera_params = device_->getCalibrationCameraParamList();
for (size_t i = 0; i < camera_params->count(); i++) {
auto param = camera_params->getCameraParam(i);
int color_w = param.rgbIntrinsic.width;
int color_h = param.rgbIntrinsic.height;
if (color_w * height == color_h * width) {
return param;
}
}
return {};
}
void OBCameraNode::setupDefaultStreamCalibData() {
auto param = findDefaultCameraParam();
if (!param.has_value()) {