我怎么知道iplimage的高斯模糊系数?
How can I know the Gaussian blur coefficients of iplimage?
目前我正在使用iplimage的高斯模糊。
像这样,
# include "stdio.h"
# include "highgui.h"
# include "cv.h"
int main( int argc, char** argv ) {
IplImage* img = 0;
IplImage* out = 0;
if( argc < 2 ) {
printf( "Usage: Accepts one image as argument\n" );
exit( EXIT_SUCCESS );
}
img = cvLoadImage( argv[1] );
if( !img ) {
printf( "Error loading image file %s\n", argv[1]);
exit( EXIT_SUCCESS );
}
out = cvCreateImage( cvGetSize(img), IPL_DEPTH_8U, 3 );
cvSmooth( img, out, CV_GAUSSIAN, 3, 3 );
cvReleaseImage( &img );
cvReleaseImage( &out );
cvDestroyWindow( "Example1" );
cvDestroyWindow( "Output" );
return EXIT_SUCCESS;
}
但是不知道iplimage的高斯模糊用的是什么系数
如何知道iplimage的高斯模糊系数?
IplImage 没有任何高斯模糊系数。 IplImage 是来自 Intel Processing Library 的一种数据结构,用于存储图像数据。
你如何找到你的过滤操作中使用的系数?
那么你阅读手册并找出...
http://docs.opencv.org/3.0-beta/modules/imgproc/doc/filtering.html#smooth
由于您没有在函数调用中提供 sigma(或者假设在其他人的函数调用中,因为我怀疑您编写了该代码),它默认为 0。
cvSmooth( img, out, CV_GAUSSIAN, 3, 3 );
In the case of a Gaussian parameter this parameter may specify
Gaussian sigma (standard deviation). If it is zero, it is calculated
from the kernel size:
sigma = 0.3 (n/2 - 1) + 0.8
其中 n 是您的内核大小
Using standard sigma for small kernels ( 3 x 3 to 7 x 7 )
gives better speed. If sigma1 is not zero, while size1 and size2 are
zeros, the kernel size is calculated from the sigma (to provide
accurate enough operation).
目前我正在使用iplimage的高斯模糊。 像这样,
# include "stdio.h"
# include "highgui.h"
# include "cv.h"
int main( int argc, char** argv ) {
IplImage* img = 0;
IplImage* out = 0;
if( argc < 2 ) {
printf( "Usage: Accepts one image as argument\n" );
exit( EXIT_SUCCESS );
}
img = cvLoadImage( argv[1] );
if( !img ) {
printf( "Error loading image file %s\n", argv[1]);
exit( EXIT_SUCCESS );
}
out = cvCreateImage( cvGetSize(img), IPL_DEPTH_8U, 3 );
cvSmooth( img, out, CV_GAUSSIAN, 3, 3 );
cvReleaseImage( &img );
cvReleaseImage( &out );
cvDestroyWindow( "Example1" );
cvDestroyWindow( "Output" );
return EXIT_SUCCESS;
}
但是不知道iplimage的高斯模糊用的是什么系数
如何知道iplimage的高斯模糊系数?
IplImage 没有任何高斯模糊系数。 IplImage 是来自 Intel Processing Library 的一种数据结构,用于存储图像数据。
你如何找到你的过滤操作中使用的系数? 那么你阅读手册并找出...
http://docs.opencv.org/3.0-beta/modules/imgproc/doc/filtering.html#smooth
由于您没有在函数调用中提供 sigma(或者假设在其他人的函数调用中,因为我怀疑您编写了该代码),它默认为 0。
cvSmooth( img, out, CV_GAUSSIAN, 3, 3 );
In the case of a Gaussian parameter this parameter may specify Gaussian sigma (standard deviation). If it is zero, it is calculated from the kernel size:
sigma = 0.3 (n/2 - 1) + 0.8
其中 n 是您的内核大小
Using standard sigma for small kernels ( 3 x 3 to 7 x 7 ) gives better speed. If sigma1 is not zero, while size1 and size2 are zeros, the kernel size is calculated from the sigma (to provide accurate enough operation).