How to make the right kernel and use sepFilter2D to solve "vessels enhacement" problem
Hello,guys these day ,I am doing sth about "vessels enhacement". for example ,an image like this
if use the pipeline of " bilate->clahe->frangi" or something like,can get fine result,but the speed is a big problem,a frame of 640*480 need 200ms-300ms about,which is too slow.
I have found some paper about faster algorithm,in 《Low-Cost Hand Vein Pattern Recognition 》(Marion Distler etc),it gives the result can convert to the result,which enhance the vessels
and even
the result is not bad,and the kernel algorithm -- DBVPE is from another paper 《A Direction-Based Vascular Pattern Extraction Algorithm for Hand Vascular Pattern Verification 》( Sang Kyun Im etc), in section 3,it gave the convolution method
where z(c), M, N, and w(i) are the center pixels of the filter mask, the abscissa vector size of the mask, the ordinate vector size of the mask, and the filter coefficient of the proposed emphasizing filter, respectively. S(x,y) is one of {–1, 1} and K(x,y) is any integer number.
and get the result( a to f)
to get the same result ,i make some coding
//make a kernel
Mat k11 = Mat(1,11,CV_64FC1,Scalar(0));
Mat k17 = Mat(1,17,CV_64FC1,Scalar(0));
k11.at<double>(0,0) = -1.0/(11*17);
k11.at<double>(0,1) = -1.0/(11*17);
k11.at<double>(0,2) = 2.0/(11*17);
k11.at<double>(0,3) = 4.0/(11*17);
k11.at<double>(0,4) = 16.0/(11*17);
k11.at<double>(0,5) = 32.0/(11*17);
k11.at<double>(0,6) = 16.0/(11*17);
k11.at<double>(0,7) = 4.0/(11*17);
k11.at<double>(0,8) = 2.0/(11*17);
k11.at<double>(0,9) = -1.0/(11*17);
k11.at<double>(0,10)= -1.0/(11*17);
k17.at<double>(0, 0) = -1.0/(11*17);
k17.at<double>(0, 1) = -1.0/(11*17);
k17.at<double>(0, 2) = -1.0/(11*17);
k17.at<double>(0, 3) = -1.0/(11*17);
k17.at<double>(0, 4) = -1.0/(11*17);
k17.at<double>(0, 5) = 2.0/(11*17);
k17.at<double>(0, 6) = 8.0/(11*17);
k17.at<double>(0, 7) = 16.0/(11*17);
k17.at<double>(0, 8) = 32.0/(11*17);
k17.at<double>(0, 9) = 16.0/(11*17);
k17.at<double>(0,10) = 8.0/(11*17);
k17.at<double>(0,11) = 3.0/(11*17);
k17.at<double>(0,12) = -1.0/(11*17);
k17.at<double>(0,13) = -1.0/(11*17);
k17.at<double>(0,14) = -1.0/(11*17);
k17.at<double>(0,15) = -1.0/(11*17);
k17.at<double>(0,16) = -1.0/(11*17);
// sepFilter2D sepFilter2D(tmp,tmp,CV_8UC1,k11.t(),k17)
but the result is too bad
my result
paper result
what's wrong with my code?Or did i do sth wrong when make the kernel or use sepFilter2D ...