OpenCV: Find all non-zero coordinates of a binary Mat image

前端 未结 3 686
失恋的感觉
失恋的感觉 2020-12-01 11:10

I\'m atttempting to find the non-zero (x,y) coordinates of a binary image.

I\'ve found a few references to the function countNonZero() which only count

3条回答
  •  爱一瞬间的悲伤
    2020-12-01 11:17

    you can find it without using findNonZero() this opencv method. rather u can get it by simply using 2 for loops. here is the snippet. hope it can help u.

    **

    for(int i = 0 ;i 

    **

提交回复
热议问题