void MainWindow::usmRadiusChanged(int value) { mCurrUSMRadius = value; af::array slices = usm(mCurrentImage, mCurrUSMRadius, mCurrUSMSharpness); af::array interleaved = af::reorder(slices, 2, 1, 0)/255.0f; interleaved.host((void*)mImageDataRawPtr); mRenderCanvas->updateTexData(mImageDataRawPtr, mImageWidth, mImageHeight); mRenderCanvas->updateGL(); }
void MainWindow::usmChanged(int value) { mCurrUSMSharpness = convertRange(value, USMSHARP_ALGO_MAX, USMSHARP_ALGO_MIN, UI_USMSHARP_SLIDER_MAX, UI_USMSHARP_SLIDER_MIN); af::array slices = usm(mCurrentImage, mCurrUSMRadius, mCurrUSMSharpness); af::array interleaved = af::reorder(slices, 2, 1, 0)/255.0f; interleaved.host((void*)mImageDataRawPtr); mRenderCanvas->updateTexData(mImageDataRawPtr, mImageWidth, mImageHeight); mRenderCanvas->updateGL(); }
/* in input image type integer defining how convolution for smoothing operation is done 0 <==> spatial domain; 1 <==> frequency domain size size of used smoothing kernel thresh minimal intensity difference to perform operation scale scaling of edge enhancement return enhanced image */ Mat Dip3::run(Mat& in, int smoothType, int size, double thresh, double scale){ return usm(in, smoothType, size, thresh, scale); }
/* in input image type integer defining how convolution for smoothing operation is done 0 <==> spatial domain; 1 <==> frequency domain size size of used smoothing kernel thresh minimal intensity difference to perform operation scale scaling of edge enhancement return enhanced image */ Mat Dip3::run(Mat& in, int smoothType, int size, double thresh, double scale){ Mat copy = in.clone(); return usm(copy, smoothType, size, thresh, scale); }