Commit d9ca5fba authored by Yipeng Hu's avatar Yipeng Hu

ref #0 hotfix - median filter bug fixed

parent acdf0a2a
......@@ -90,7 +90,7 @@ void NaiveImage::medianFilter(int half_ksize)
}
// compute the median value then assign
sort(neighbours.begin(),neighbours.end());
tmp_pData[idy*m_width+idx] = neighbours[half_ksize];
tmp_pData[idy*m_width+idx] = neighbours[(ksize*ksize+1)/2];
}
}
......
......@@ -7,7 +7,7 @@ int main(int argc, char** argv)
// parsing the command line inputs
std::string InputFilename = argv[1];
std::string OutputFilename = argv[2];
int FilterParameter = *argv[3] - '0';
int FilterParameter = std::stoi(argv[3]); //*argv[3] - '0';
std::cout << "Input image: " << InputFilename << std::endl;
std::cout << "Output image: " << OutputFilename << std::endl;
std::cout << "Filter parameter: " << FilterParameter << std::endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment