Commit 5bafccd2 authored by James Bowman's avatar James Bowman

FindContours with all modes/methods, ticket 303

parent ab7b50d3
...@@ -461,14 +461,16 @@ class FunctionTests(OpenCVTests): ...@@ -461,14 +461,16 @@ class FunctionTests(OpenCVTests):
storage = cv.CreateMemStorage() storage = cv.CreateMemStorage()
# First run FindContours on a black image. # First run FindContours on a black image.
scratch = cv.CreateImage((800,800), 8, 1) for mode in [cv.CV_RETR_EXTERNAL, cv.CV_RETR_LIST, cv.CV_RETR_CCOMP, cv.CV_RETR_TREE]:
cv.SetZero(scratch) for method in [cv.CV_CHAIN_CODE, cv.CV_CHAIN_APPROX_NONE, cv.CV_CHAIN_APPROX_SIMPLE, cv.CV_CHAIN_APPROX_TC89_L1, cv.CV_CHAIN_APPROX_TC89_KCOS, cv.CV_LINK_RUNS]:
seq = cv.FindContours(scratch, storage, cv.CV_RETR_TREE, cv.CV_CHAIN_APPROX_SIMPLE) scratch = cv.CreateImage((800,800), 8, 1)
x = len(seq) cv.SetZero(scratch)
if seq: seq = cv.FindContours(scratch, storage, mode, method)
pass x = len(seq)
for s in seq: if seq:
pass pass
for s in seq:
pass
for trial in range(10): for trial in range(10):
scratch = cv.CreateImage((800,800), 8, 1) scratch = cv.CreateImage((800,800), 8, 1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment