简体   繁体   中英

Finding shapes using OpenCV Haar cascaded classifier

I am looking for parabolas in some radar data. I am using the OpenCV Haar cascaded classifier. My positive images are 20x20 PNGs where all of the pixels are black, except for those that trace a parabolic shape--one parabola per positive image.

My question is this: will these positives train a classifier to look for black boxes with parabolas in them, or will they train a classifier to look for parabolic shapes?

Should I add a layer of medium value noise to my positive images, or should they be unrealistically crisp and high contrast?

Here is an example of the original data.

原始数据。

Here is an example of my data after I have performed simple edge detection using GIMP. The parabolic shapes are highlighted in the white boxes

边缘检测后的数据。

Here is one of my positive images.

样本正面图像。

I figured out a way to do detect parabolas initially using the MatchTemplate method from OpenCV. At first, I was using the Python cv , and later cv2 libraries, but I had to make sure that my input images were 8-bit unsigned integer arrays. I eventually obtained a similar effect with less fuss using scipy.signal.correlate2d( image, template, mode='same') . The mode='same' resizes the output to the size of image . When I was done I performed thresholding, using the numpy.where() function, and opening and closing to eliminate salt and pepper noise using the scipy.ndimage module.

Here's the output, before thresholding.

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM