vardipoor.m
14-09-21, 20:28
سلام
میخوام یه تصویر تار رو شارپ کنم یه کد هست که نمیدونم چطور باید ازش استفاده کنم
این منبع
opencv - Sharpening an image using emgu - Signal Processing Stack Exchange (Only the registered members can see the link)
این کد
public static Image<Gray, byte> Sharpen(Image<Gray, byte> image, int w, int h, double sigma1, double sigma2, int k)
{
w = (w % 2 == 0) ? w - 1 : w;
h = (h % 2 == 0) ? h - 1 : h;
//apply gaussian smoothing using w, h and sigma
var gaussianSmooth = image.SmoothGaussian(w, h, sigma1, sigma2);
//obtain the mask by subtracting the gaussian smoothed image from the original one
var mask = image - gaussianSmooth;
//add a weighted value k to the obtained mask
mask *= k;
//sum with the original image
image += mask;
return image;
}
نمیدونم بجای x چه باید بنویسم.
Sharpen(x, 640, 360, 1, 1, 1);
میخوام یه تصویر تار رو شارپ کنم یه کد هست که نمیدونم چطور باید ازش استفاده کنم
این منبع
opencv - Sharpening an image using emgu - Signal Processing Stack Exchange (Only the registered members can see the link)
این کد
public static Image<Gray, byte> Sharpen(Image<Gray, byte> image, int w, int h, double sigma1, double sigma2, int k)
{
w = (w % 2 == 0) ? w - 1 : w;
h = (h % 2 == 0) ? h - 1 : h;
//apply gaussian smoothing using w, h and sigma
var gaussianSmooth = image.SmoothGaussian(w, h, sigma1, sigma2);
//obtain the mask by subtracting the gaussian smoothed image from the original one
var mask = image - gaussianSmooth;
//add a weighted value k to the obtained mask
mask *= k;
//sum with the original image
image += mask;
return image;
}
نمیدونم بجای x چه باید بنویسم.
Sharpen(x, 640, 360, 1, 1, 1);