识别大噪声图像中的小物体-opencv

时间:2019-01-06 11:50:29

标签: java android opencv image-processing

我需要在大(1080p)图像中识别相对较小的物体(粘土鸽)。背景各不相同,在建筑物,树木,天空之间,甚至任何东西之间。

我正在使用OpenCV,并且花了好几周的时间来学习使用它,并结合使用了inRange,Canny,Blur等方法获得了一些成功,但是这仅取决于只在颜色上识别粘土鸽子:

public List<MatOfPoint> FindContours(Mat drawing, Scalar lowerBound, Scalar upperBound)
{
    Mat scratch = new Mat();
    Mat res = new Mat();

    Imgproc.blur(drawing, scratch, new Size(blur, blur));
    cvtColor(scratch, scratch, COLOR_BGR2HSV);
    Core.inRange(scratch, lowerBound, upperBound, scratch);
    Imgproc.Canny(scratch, res, threshold, threshold * 2, kernel_size);

    List<MatOfPoint> contours = new ArrayList<>();
    Mat hierarchy = new Mat();
    Imgproc.findContours(res, contours, hierarchy, Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_SIMPLE);

    return contours;
}  

cal.lowerBoundTarget = new Scalar(0,84,19);
cal.upperBoundTarget = new Scalar(343,100,100);

List<MatOfPoint> contours = FindContours(src, cal.lowerBoundTarget, cal.upperBoundTarget);

源图像是飞行中的野鸽的随机图像。

该算法在像这样的简单图像上可以很好地工作: https://imgur.com/1p1sI7H https://imgur.com/edX1li7

但是在不同的光照条件和背景下,它无法识别粘土: https://imgur.com/iRV8JQw https://imgur.com/ZqYDh1a

我发现粘土的HSV值变化很大,因此很难识别,实际上我得出的结论范围很广。这不是很有帮助。

关于将可靠地识别粘土黏土背景的一系列步骤的任何想法(在一定程度上,可以忽略其颜色有效地使黏土不可见的背景)。

0 个答案:

没有答案