I searched on the web and didn't find any good answer for my problem. So this is my question:
I am using OpenCV and have a function called replaceInvalidDisparties
and I have to search through the pixels and check if the actual value is inf
and there is a standard function in OpenCv
called cvIsInf(double value)
to check if the value is inf
, but somehow i always get segmentation fault.
using namespace cv;
cv::Mat replaceInvalidDisparities(const cv::Mat &original_disp)
{
cv::Mat output = orignal_disp.clone();
//access pixel
for(int i = 0; i< output.rows; i++)
{
for(int j=0; j<output.cols; j++)
{
//now here i want to check if the actual pixel is inf
cvIsInf(output.at<double>(i,j));
}
}
}
But somehow it always give me a segmentation fault. Does anyone know the problem?