Skip to content

Commit

Permalink
Add 32bit check for wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinichi Muramatsu committed Jul 31, 2023
1 parent 6a2b927 commit 80cb3a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions include/libsgm_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class LibSGMWrapper

/**
* Execute stereo semi global matching via wrapper class.
* @param I1 Input left image. Image's type is must be CV_8U or CV_16U
* @param I1 Input left image. Image's type is must be CV_8U, CV_16U or CV_32S
* @param I2 Input right image. Image's size and type must be same with I1.
* @param disparity Output image. Its memory will be allocated automatically dependent on input image size.
* @attention
Expand All @@ -59,7 +59,7 @@ class LibSGMWrapper

/**
* Execute stereo semi global matching via wrapper class.
* @param I1 Input left image. Image's type is must be CV_8U or CV_16U.
* @param I1 Input left image. Image's type is must be CV_8U, CV_16U or CV_32S.
* @param I2 Input right image. Image's size and type must be same with I1.
* @param disparity Output image. Its memory will be allocated automatically dependent on input image size.
* @attention
Expand Down
8 changes: 4 additions & 4 deletions src/libsgm_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ struct LibSGMWrapper::Creator
Creator(const cv::cuda::GpuMat& src, const cv::cuda::GpuMat& dst)
{
const int depth = src.depth();
CV_Assert(depth == CV_8U || depth == CV_16U);
CV_Assert(depth == CV_8U || depth == CV_16U || depth == CV_32S);
width = src.cols;
height = src.rows;
src_pitch = static_cast<int>(src.step1());
Expand All @@ -87,7 +87,7 @@ struct LibSGMWrapper::Creator
Creator(const cv::Mat& src, const cv::Mat& dst)
{
const int depth = src.depth();
CV_Assert(depth == CV_8U || depth == CV_16U);
CV_Assert(depth == CV_8U || depth == CV_16U || depth == CV_32S);
width = src.cols;
height = src.rows;
src_pitch = static_cast<int>(src.step1());
Expand All @@ -108,7 +108,7 @@ void LibSGMWrapper::execute(const cv::cuda::GpuMat& I1, const cv::cuda::GpuMat&
CV_Assert(size == I2.size());
CV_Assert(I1.type() == I2.type());
const int depth = I1.depth();
CV_Assert(depth == CV_8U || depth == CV_16U);
CV_Assert(depth == CV_8U || depth == CV_16U || depth == CV_32S);
if (disparity.size() != size || disparity.depth() != CV_16S) {
disparity.create(size, CV_16S);
}
Expand All @@ -127,7 +127,7 @@ void LibSGMWrapper::execute(const cv::Mat& I1, const cv::Mat& I2, cv::Mat& dispa
CV_Assert(size == I2.size());
CV_Assert(I1.type() == I2.type());
const int depth = I1.depth();
CV_Assert(depth == CV_8U || depth == CV_16U);
CV_Assert(depth == CV_8U || depth == CV_16U || depth == CV_32S);
if (disparity.size() != size || disparity.depth() != CV_16S) {
disparity.create(size, CV_16S);
}
Expand Down

0 comments on commit 80cb3a4

Please sign in to comment.