Read several articles on computational object counting using convolution based pattern matching technique.
Some important notes I found:
- Convolution filtering is used to modify the spatial frequency characteristics of an image.
- General purpose filter effect for images
- A matrix applied to an image and a mathematical operation comprised of integers
- Works by determining the value of a central pixel by adding the weighted values of all its neighbors together
- A kernel is a (usually) small matrix of numbers that is used in image convolutions- 3x3 is often used
- Why convolve an image? Smooth Sharpen Intensify Enhance
Template matching- match a template to an image where the template pattern is a part of the source image that contains the shape inside it
- Template shifts in x and y direction (u,v) over image and repeated for entire image
- Best match/peak value is point where the shape lie within the source image
Based on this, I created a template from one of the SEM images and tested out a Matlab function:
normxcorr2( )
This function gives the normalized 2D cross-correlation of matrices 'template' and 'image.' It finds where the values match up best so that we can pinpoint each particle.
Image and template side by side. The template (right) is one of the particles cropped from the image (left)
Surface image of matching values in between the image and the template. Higher values signify better match.
Plot of the peak x and y values
Next week, I will work on a script that will count the peak values. The problem I ran into with the code is that there are duplicate x and y peaks that overlap one another or values that are very similar to one another making it seem like there is more than one "match" per particle. A function that I will try is
histcounts( ) to bin similar values together and then count the bins to represent number of particles.
References:
Counting Objects using Convolution based Pattern Matching Technique
http://research.ijais.org/volume5/number8/ijais13-450964.pdf
Image Convolution
http://web.pdx.edu/~jduh/courses/Archive/geog481w07/Students/Ludwig_ImageConvolution.pdf