From 1169e8a452f497ed646e9e1973828d22af13354f Mon Sep 17 00:00:00 2001 From: "Matan, Katz" Date: Wed, 7 Sep 2016 09:36:30 +0300 Subject: [PATCH] HF 0.2.9 --- README.md | 2 +- .../samples_time_sync_sample.cpp | 2 +- sdk/CMakeVersion | 2 +- sdk/include/rs/core/types.h | 2 +- sdk/include/rs_sdk_version.h | 10 ++++++++-- sdk/src/core/projection/projection_r200.cpp | 3 ++- .../max_depth_value_module.cpp | 1 + .../max_depth_value_module_impl.cpp | 17 +++++++++++++---- .../utilities/logger/log_utils/log_utils.cpp | 1 + 9 files changed, 29 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 6f5c7cd..7d30e28 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [ ![Release] [release-image] ] [releases] [ ![License] [license-image] ] [license] -[release-image]: http://img.shields.io/badge/release-0.2.7-blue.svg?style=flat +[release-image]: http://img.shields.io/badge/release-0.2.9-blue.svg?style=flat [releases]: https://github.com/IntelRealSense/realsense_sdk [license-image]: http://img.shields.io/badge/license-Apache--2-blue.svg?style=flat diff --git a/samples/samples_time_sync_sample/samples_time_sync_sample.cpp b/samples/samples_time_sync_sample/samples_time_sync_sample.cpp index b5ac542..591042b 100644 --- a/samples/samples_time_sync_sample/samples_time_sync_sample.cpp +++ b/samples/samples_time_sync_sample/samples_time_sync_sample.cpp @@ -112,7 +112,7 @@ void frame_handler(rs::frame new_frame) info.width = new_frame.get_width(); info.height = new_frame.get_height(); info.format = rs::utils::convert_pixel_format(new_frame.get_format()); - info.pitch = ( new_frame.get_bpp() / 8 ) * info.width; + info.pitch = new_frame.get_stride(); auto st_type = rs::utils::convert_stream_type(new_frame.get_stream_type()); diff --git a/sdk/CMakeVersion b/sdk/CMakeVersion index a358be7..f632cb2 100644 --- a/sdk/CMakeVersion +++ b/sdk/CMakeVersion @@ -1,4 +1,4 @@ set(SDK_VERSION_MAJOR 0 ) set(SDK_VERSION_MINOR 2 ) -set(SDK_VERSION_COMMIT_NUMBER 8 ) +set(SDK_VERSION_COMMIT_NUMBER 9 ) set(SDK_VERSION_COMMIT_ID 0 ) diff --git a/sdk/include/rs/core/types.h b/sdk/include/rs/core/types.h index 55da076..d75c614 100644 --- a/sdk/include/rs/core/types.h +++ b/sdk/include/rs/core/types.h @@ -143,7 +143,7 @@ namespace rs int32_t width; /* width of the image in pixels */ int32_t height; /* height of the image in pixels */ pixel_format format; /* image pixel format */ - int32_t pitch; /* pitch of the image in pixels, also known as stride*/ + int32_t pitch; /* number of bytes in a single image row of pixels, also known as stride*/ }; struct pointI32 diff --git a/sdk/include/rs_sdk_version.h b/sdk/include/rs_sdk_version.h index 249f5ff..a4dacbb 100644 --- a/sdk/include/rs_sdk_version.h +++ b/sdk/include/rs_sdk_version.h @@ -1,5 +1,11 @@ +// License: Apache 2.0. See LICENSE file in root directory. +// Copyright(c) 2016 Intel Corporation. All Rights Reserved. +#pragma once + #define SDK_VER_MAJOR 0 #define SDK_VER_MINOR 2 -#define SDK_VER_COMMIT_NUMBER 8 +#define SDK_VER_COMMIT_NUMBER 9 #define SDK_VER_COMMIT_ID 0 -#define SDK_VERSION_STRING static char version_id[] = "VERSION: 0.2.8.0"; +#define SDK_VERSION_STRING static volatile char version_id[] = "VERSION: 0.2.9.0"; + +SDK_VERSION_STRING diff --git a/sdk/src/core/projection/projection_r200.cpp b/sdk/src/core/projection/projection_r200.cpp index 2be6cb8..bb3755d 100644 --- a/sdk/src/core/projection/projection_r200.cpp +++ b/sdk/src/core/projection/projection_r200.cpp @@ -7,9 +7,10 @@ #include "image_utils.h" #pragma warning (disable : 4068) #include "math_projection_interface.h" - +#include "rs_sdk_version.h" #include "rs/utils/self_releasing_array_data_releaser.h" + using namespace rs::utils; static void *aligned_malloc(int size); diff --git a/sdk/src/cv_modules/max_depth_value_module/max_depth_value_module.cpp b/sdk/src/cv_modules/max_depth_value_module/max_depth_value_module.cpp index cc5549e..2c96fbd 100644 --- a/sdk/src/cv_modules/max_depth_value_module/max_depth_value_module.cpp +++ b/sdk/src/cv_modules/max_depth_value_module/max_depth_value_module.cpp @@ -1,6 +1,7 @@ // License: Apache 2.0. See LICENSE file in root directory. // Copyright(c) 2016 Intel Corporation. All Rights Reserved. +#include "rs_sdk_version.h" #include #include #include diff --git a/sdk/src/cv_modules/max_depth_value_module/max_depth_value_module_impl.cpp b/sdk/src/cv_modules/max_depth_value_module/max_depth_value_module_impl.cpp index 41b236e..068a08f 100644 --- a/sdk/src/cv_modules/max_depth_value_module/max_depth_value_module_impl.cpp +++ b/sdk/src/cv_modules/max_depth_value_module/max_depth_value_module_impl.cpp @@ -1,6 +1,7 @@ // License: Apache 2.0. See LICENSE file in root directory. // Copyright(c) 2016 Intel Corporation. All Rights Reserved. +#include "rs_sdk_version.h" #include #include #include @@ -179,13 +180,21 @@ namespace rs //protect algorithm exception safety try { - const uint16_t * current_pixel = static_cast(depth_image->query_data()); + const uint8_t * current_pixel = static_cast(depth_image->query_data()); auto depth_image_info = depth_image->query_info(); - for(auto i = 0; i < depth_image_info.height * depth_image_info.pitch; i++) + + for(auto y = 0; y < depth_image_info.height; y++) { - if(current_pixel[i] > max_depth_value) + for(auto x = 0; x < depth_image_info.width; x+=2) { - max_depth_value = current_pixel[i]; + auto pixel_with_pitch_allignment = y * depth_image_info.pitch + x; + //combine 2 uint8_t to uint16_t + uint16_t current_pixel_value = current_pixel[pixel_with_pitch_allignment] | current_pixel[pixel_with_pitch_allignment + 1] << 8; + + if(current_pixel_value > max_depth_value) + { + max_depth_value = current_pixel_value ; + } } } diff --git a/sdk/src/utilities/logger/log_utils/log_utils.cpp b/sdk/src/utilities/logger/log_utils/log_utils.cpp index 821589c..2e54959 100644 --- a/sdk/src/utilities/logger/log_utils/log_utils.cpp +++ b/sdk/src/utilities/logger/log_utils/log_utils.cpp @@ -1,5 +1,6 @@ // License: Apache 2.0. See LICENSE file in root directory. // Copyright(c) 2016 Intel Corporation. All Rights Reserved. +#include "rs_sdk_version.h" #include "rs/utils/log_utils.h" #include "rs/core/status.h" #include "fstream"