OpenCV反锐化掩码Java实现
我正在尝试实现我在 编辑:这是算法OpenCV反锐化掩码Java实现,java,opencv,image-processing,implementation,Java,Opencv,Image Processing,Implementation,我正在尝试实现我在 编辑:这是算法 Mat blurred; double sigma = 1, threshold = 5, amount = 1; GaussianBlur(img, blurred, Size(), sigma, sigma); Mat lowContrastMask = abs(img - blurred) < threshold; Mat sharpened = img*(1+amount) + blurred*(-amount); img.copyTo(shar
Mat blurred; double sigma = 1, threshold = 5, amount = 1;
GaussianBlur(img, blurred, Size(), sigma, sigma);
Mat lowContrastMask = abs(img - blurred) < threshold;
Mat sharpened = img*(1+amount) + blurred*(-amount);
img.copyTo(sharpened, lowContrastMask);
Mat模糊;双西格玛=1,阈值=5,金额=1;
高斯模糊(img,模糊,Size(),sigma,sigma);
Mat低对比度掩模=abs(img-模糊)<阈值;
磨光毡=img*(1+数量)+模糊*(-数量);
图像复制(锐化、低对比度掩模);
我被困在这里:
// Mat lowContrastMask = abs(img - blurred) < threshold;
Mat lowContrastMask = new Mat();
Core.absdiff(source, destination, lowContrastMask);
//Mat低对比度遮罩=abs(img-模糊)<阈值;
Mat低对比度掩码=新Mat();
Core.absdiff(源、目标、低对比度掩码);
我不知道如何实现“
threshold
:
Imgproc.threshold(lowContrastMask, lowContrastMask, 0, thresh, Imgproc.THRESH_BINARY_INV)
你的链接没有指向任何算法,只是OpenCV docI更新了问题它没有给出任何错误,但是结果不是很好。我想我的算法有很多错误。