clustering image segments in opencv

后端 未结 4 1645
遥遥无期
遥遥无期 2021-02-06 02:11

I am working on motion detection with non-static camera using opencv. I am using a pretty basic background subtraction and thresholding approach to get a broad sense of all that

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-06 02:59

    I am not entirely sure if you are really looking for clustering (in the Data Mining sense).

    Clustering is used to group similar objects according to a distance function. In your case the distance function would only use the spatial qualities. Besides, in k-means clustering you have to specify a k, that you probably don't know beforehand.

    It seems to me you just want to merge all rectangles whose borders are closer together than some predetermined threshold. So as a first idea try to merge all rectangles that are touching or that are closer together than half a players height.

    You probably want to include a size check to minimize the risk of merging two players into one.

    Edit: If you really want to use a clustering algorithm use one that estimates the number of clusters for you.

提交回复
热议问题