Monday, July 4, 2011

More Feature Detection

Today I experimented with corner detection, along with line and circle detection.

Corner Detection:
Corner detection seemed to be the most useful of the three, and produced good features:
 

 

 
 

I found the corner detection results for Apodynerus f.formosensis (last 3 images) to be the most interesting. Corners of the "window back pattern" were detected on the wasp. These could be generalized to some basic shape or polygon (one line with two 45-degree incident lines), and confined to be within a certain distance from the centroid. There are already built-in functions to approximate and compare polygon shapes, so I will look more into those next time.

Line Detection:
Using Hough Transforms (after we perform edge detection), we are able to detect sets of points that are likely to be lines:
 

 

 










One can observe that the number of lines tend to be denser where the wings of the insect are. However, the edge-detected images were based purely on the raw images. After re-implementing the line detection with blurred images, we get the following:
(The difference between gaussian vs. median blurring was negligible, but it seems that in practice we should use median blurring to remove salt&pepper noise, and use Gaussian blurring to smooth out edges/details).

 

 

 










Now the lines define the wings much better. In order to extract this information, we might either have to have a threshold a number of lines that are a certain length apart, or find a group of (mostly) parallel lines.
For today, I was able to extract the black length bar at the bottom-right of every image, and calculate its length in pixels.


Circle Detection:
I fiddled around with cv::HoughCircles, but I didn't seem to get very good results. Many of the images did not even detect circles, or before were detecting far too many arbitrary circles. I believe I need to go back and either do some more filtering to the images, or tweak the parameters to the function some more before I can get some desirable results.

 


Final Notes:
One of my major concerns has been hard-coding the parameters to functions I have been using. Ideally, I would like to have these automatically and optimally calculated (if possible), but for now I've just been plugging in different values for the parameters until I see a consistent and desirable output among a few sample images.

No comments:

Post a Comment