在python opencv2中复制过去的对象

时间:2016-06-14 11:37:55

标签: python opencv paste cut

我有这个形象 enter image description here

我已经使用

获得了子弹形状的轮廓
contours, hierarchy = cv2.findContours(thresh,cv2.RETR_EXTERNAL,cv2.CHAIN_APPROX_SIMPLE)

但现在我想从图像中提取子弹并将其从另一张空白图像上过去,选择我想要的坐标。任何的想法?

1 个答案:

答案 0 :(得分:0)

使用Grabcut算法提取forground图像,这里有一些你也喜欢的代码

<table>
  <tr>
    <th>A</th>
    <th class="hidden-xs">B</th>
    <th>C</th>
  </tr>
  <tr>
    <td>Jill</td>
    <td class="hidden-xs">Smith</td> 
    <td>50</td>
  </tr>
  <tr>
    <td>Eve</td>
    <td class="hidden-xs">Jackson</td> 
    <td>94</td>
  </tr>
</table>

这可能有点模糊或不太尖锐,你可以做的是首先应用边缘检测来优化你的输入并应用上述。

相关问题