OpenCV迭代轮廓

时间:2016-06-21 20:19:51

标签: python arrays opencv numpy opencv3.0

我正在尝试用线条绘制图像中检测到的所有轮廓,我可以使用 No. Time Source Destination Protocol Length Info 2 0.000001180 10.81.130.23 239.1.5.238 ST 1451 Messages: 14 Frame 2: 1451 bytes on wire (11608 bits), 1451 bytes captured (11608 bits) Ethernet II, Src: Solarfla_0e:e4:a1 (00:0f:53:0e:e4:a1), Dst: IPv4mcast_01:05:ee (01:00:5e:01:05:ee) Internet Protocol Version 4, Src: 10.81.130.23 (10.81.130.23), Dst: 239.1.5.238 (239.1.5.238) User Datagram Protocol, Src Port: 43464 (43464), Dst Port: 25238 (25238) ST Block Block Header Sanity: 23559 (Should be 23559) Header Version (Major: 0 Minor: 1) Header Size in Bytes: 19 Payload Size in Bytes: 1386 Messages: 14 Environment Id: 0 Feed Id: 1 (Uqdf) Compression Type: 0 Sender Id: 1 Sequence: 37495844 Message Header Header Version (Major: 0 Minor: 1) Header Length in Bytes: 31 Msg Type: 1 (Equity Quote) Message Version (Major: 0 Minor: 1) Msg Length in Bytes: 68 Flags: 0 Data Type: 1 (Equity) Feed Id: 1 (Uqdf) Feed Line: 1 Feed Seq Num: 7123431 Feed Sub Seq Num: 0 Exchange Time (10:59:59.978517000) High: 9220 Low: 380047880 访问每个轮廓但我似乎无法通过数组进行任何类型的迭代,总是得到

  

TypeError:只有一个元素的整数数组才能转换为索引

当我做var actual = scope.InstanceUnderTest.GetContent(expectedId); var type = actual.Result.GetType(); var dataField = type.GetField("_data", BindingFlags.NonPublic | BindingFlags.Instance); var contentTypeField = type.GetField("_contentType", BindingFlags.NonPublic | BindingFlags.Instance); Assert.IsTrue(dataField.GetValue(actual.Result) == scope.TestDocument.Data); Assert.IsTrue(contentTypeField.GetValue(actual.Result) == "application/octet-stream");

  

ValueError:操作数太多

当我有波纹管代码时

cnt = contour[number]

老实说,我对OpenCV和Numpy非常陌生,而且一直在处理示例,我不明白我的代码中的所有内容对我的不满。我认为这是我使用numpy数组的一个问题,但我似乎无法找到如何正确地做到这一点。

由于

0 个答案:

没有答案