Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

Applying filter keeps crashing?

$
0
0
I am bit unsure why this keep crashing.. Qt isn't providing me with an proper error message, but just states that it crashed.. I seems to me that the program crashes when I try to add the pixel values together. here is the filter. void filter(Mat src, Mat dst, int kernel, double P) { Mat temp = src.clone(); Mat output; copyMakeBorder(temp,temp,kernel-1,kernel-1,kernel-1,kernel-1,BORDER_CONSTANT,Scalar(0,0,0)); int sum = 0; for(int row = 0; row < temp.rows; row++) { for(int col = 0 ; col < temp.cols; col++) { for(int i = -floor(kernel/2); i <= floor(kernel/2) ; i++) { for(int j = -floor(kernel/2) ; j <= floor(kernel/2); j++) { sum += temp.at(row+i,col+j); } } output.at(row,col) = pow(sum,P+1)/pow(sum,P); sum = 0; } } dst = output; }

Viewing all articles
Browse latest Browse all 41027

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>