diff --git a/wrappers/matlab/disparity_transform.m b/wrappers/matlab/disparity_transform.m index 0d1b1844d5..2ba613e50e 100644 --- a/wrappers/matlab/disparity_transform.m +++ b/wrappers/matlab/disparity_transform.m @@ -8,6 +8,7 @@ else validateattributes(transform_to_disparity, {'logical', 'numeric'}, {'scalar', 'real'}); out = realsense.librealsense_mex('rs2::disparity_transform', 'new', logical(transform_to_disparity)); + end this = this@realsense.process_interface(out); end diff --git a/wrappers/matlab/frameset.m b/wrappers/matlab/frameset.m index d3d8037056..b8af681d6c 100644 --- a/wrappers/matlab/frameset.m +++ b/wrappers/matlab/frameset.m @@ -29,8 +29,13 @@ ret = realsense.librealsense_mex('rs2::frameset', 'get_color_frame', this.objectHandle); color_frame = realsense.video_frame(ret); end - function infrared_frame = get_infrared_frame(this) - ret = realsense.librealsense_mex('rs2::frameset', 'get_infrared_frame', this.objectHandle); + function infrared_frame = get_infrared_frame(this, index) + if (nargin == 1) + ret = realsense.librealsense_mex('rs2::frameset', 'get_infrared_frame', this.objectHandle); + else + validateattributes(index, {'numeric'}, {'scalar', 'nonnegative', 'real', 'integer', '<=', 2}, '', 'index', 2); + ret = realsense.librealsense_mex('rs2::frameset', 'get_infrared_frame', this.objectHandle, int64_t(index)); + end infrared_frame = realsense.video_frame(ret); end function size = get_size(this) diff --git a/wrappers/matlab/librealsense_mex.cpp b/wrappers/matlab/librealsense_mex.cpp index b13d45e48a..c435202654 100644 --- a/wrappers/matlab/librealsense_mex.cpp +++ b/wrappers/matlab/librealsense_mex.cpp @@ -451,11 +451,16 @@ void make_factory(){ // try/catch moved to outer framework outv[0] = MatlabParamParser::wrap(thiz.get_color_frame()); }); - frameset_factory.record("get_infrared_frame", 1, 1, [](int outc, mxArray* outv[], int inc, const mxArray* inv[]) + frameset_factory.record("get_infrared_frame", 1, 1, 2, [](int outc, mxArray* outv[], int inc, const mxArray* inv[]) { auto thiz = MatlabParamParser::parse(inv[0]); // try/catch moved to outer framework - outv[0] = MatlabParamParser::wrap(thiz.get_infrared_frame()); + if (inc == 1) + outv[0] = MatlabParamParser::wrap(thiz.get_infrared_frame()); + else { + auto index = MatlabParamParser::parse(inv[1]); + outv[0] = MatlabParamParser::wrap(thiz.get_infrared_frame(index)); + } }); frameset_factory.record("size", 1, 1, [](int outc, mxArray* outv[], int inc, const mxArray* inv[]) { @@ -898,10 +903,10 @@ void make_factory(){ frame_queue_factory.record("wait_for_frame", 1, 1, 2, [](int outc, mxArray* outv[], int inc, const mxArray* inv[]) { auto thiz = MatlabParamParser::parse(inv[0]); - if (inc == 0) { + if (inc == 1) { outv[0] = MatlabParamParser::wrap(thiz.wait_for_frame()); } - else if (inc == 1) { + else if (inc == 2) { auto timeout_ms = MatlabParamParser::parse(inv[1]); outv[0] = MatlabParamParser::wrap(thiz.wait_for_frame(timeout_ms)); } @@ -953,10 +958,10 @@ void make_factory(){ syncer_factory.record("wait_for_frames", 1, 1, 2, [](int outc, mxArray* outv[], int inc, const mxArray* inv[]) { auto thiz = MatlabParamParser::parse(inv[0]); - if (inc == 0) { + if (inc == 1) { outv[0] = MatlabParamParser::wrap(thiz.wait_for_frames()); } - else if (inc == 1) { + else if (inc == 2) { auto timeout_ms = MatlabParamParser::parse(inv[1]); outv[0] = MatlabParamParser::wrap(thiz.wait_for_frames(timeout_ms)); } diff --git a/wrappers/matlab/pipeline_profile.m b/wrappers/matlab/pipeline_profile.m index 2acf449ec3..9f00586b9d 100644 --- a/wrappers/matlab/pipeline_profile.m +++ b/wrappers/matlab/pipeline_profile.m @@ -27,7 +27,7 @@ function delete(this) narginchk(2, 3); validateattributes(stream_type, {'realsense.stream', 'numeric'}, {'scalar', 'nonnegative', 'real', 'integer', '<=', realsense.stream.count}, '', 'stream_type', 2); if nargin == 2 - out = realsense.librealsense_mex('rs2::pipeline_profile', 'get_streams', this.objectHandle, int64(stream_type)); + out = realsense.librealsense_mex('rs2::pipeline_profile', 'get_stream', this.objectHandle, int64(stream_type)); else validateattributes(stream_index, {'numeric'}, {'scalar', 'nonnegative', 'real', 'integer'}, '', 'stream_index', 3); out = realsense.librealsense_mex('rs2::pipeline_profile', 'get_stream', this.objectHandle, int64(stream_type), int64(stream_index)); diff --git a/wrappers/matlab/stream_profile.m b/wrappers/matlab/stream_profile.m index 4453d445f9..ce47a9ad5b 100644 --- a/wrappers/matlab/stream_profile.m +++ b/wrappers/matlab/stream_profile.m @@ -42,7 +42,7 @@ function delete(this) validateattributes(index, {'numeric'}, {'scalar', 'nonnegative', 'real', 'integer'}, '', 'index', 3); validateattributes(fmt, {'realsense.format', 'numeric'}, {'scalar', 'nonnegative', 'real', 'integer', '<=', realsense.format.count}, '', 'fmt', 4); out = realsense.librealsense_mex('rs2::stream_profile', 'clone', this.objectHandle, int64(type), int64(index), int64(fmt)); - realsense.stream_profile(out{:}); + profile = realsense.stream_profile(out{:}); end function value = is(this, type) narginchk(2, 2);