Would anybody know, how I can in "fun" have access to the center values of the "colfilt" kernels?
The kernels of the "colfilt" function are the columns in the array passed to "fun" by the "colfilt" function, and if for the m x n kernel the values for m and n have been odd numbers, then the value of the center pixel can be determined easily. But I did not find how to determine the values of the center pixels of the kernels of the colfilt function, if even numbers have been used to span the kernel.
I know that using the "nlfilter" function I can easily receive in "fun" the value of the center pixel from the kernel matrix passed to "fun" (according to the documentation it is to be found by "floor(([m n]+1)/2)" ). But, as a kernel of the "colfilt" function is not received in "fun" as an array, but as a column, I here did not find a valid formula to determine the position of the kernel´s center pixel, from which I could read out the value, as soon as an even m x n kernel dimension comes in.
Any idea how to always get the kernel´s center pixel´s value also from the "colfilt" function, also if an even dimension defining the kernel size has been used?
Best Answer