diff options
author | Jack <jackdeng@gmail.com> | 2015-09-23 19:54:07 -0700 |
---|---|---|
committer | Jack <jackdeng@gmail.com> | 2015-09-23 19:54:07 -0700 |
commit | f43d35507827216071896cae83544fef1c4c35eb (patch) | |
tree | 0cb6c86ff618a0ecd756e81f38bec2ed2c6986c7 /Godeps/_workspace/src/code.google.com/p/graphics-go/graphics/detect/opencv_parser_test.go | |
parent | 396a535f1001526cde60e77f8fc5e571bf4d882b (diff) | |
download | chat-f43d35507827216071896cae83544fef1c4c35eb.tar.gz chat-f43d35507827216071896cae83544fef1c4c35eb.tar.bz2 chat-f43d35507827216071896cae83544fef1c4c35eb.zip |
godep save
Diffstat (limited to 'Godeps/_workspace/src/code.google.com/p/graphics-go/graphics/detect/opencv_parser_test.go')
-rw-r--r-- | Godeps/_workspace/src/code.google.com/p/graphics-go/graphics/detect/opencv_parser_test.go | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/Godeps/_workspace/src/code.google.com/p/graphics-go/graphics/detect/opencv_parser_test.go b/Godeps/_workspace/src/code.google.com/p/graphics-go/graphics/detect/opencv_parser_test.go deleted file mode 100644 index 343390499..000000000 --- a/Godeps/_workspace/src/code.google.com/p/graphics-go/graphics/detect/opencv_parser_test.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2011 The Graphics-Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package detect - -import ( - "image" - "os" - "reflect" - "testing" -) - -var ( - classifier0 = Classifier{ - Feature: []Feature{ - Feature{Rect: image.Rect(0, 0, 3, 4), Weight: -1}, - Feature{Rect: image.Rect(3, 4, 5, 6), Weight: 3.1}, - }, - Threshold: 0.03, - Left: 0.01, - Right: 0.8, - } - classifier1 = Classifier{ - Feature: []Feature{ - Feature{Rect: image.Rect(3, 7, 17, 11), Weight: -3.2}, - Feature{Rect: image.Rect(3, 9, 17, 11), Weight: 2.}, - }, - Threshold: 0.11, - Left: 0.03, - Right: 0.83, - } - classifier2 = Classifier{ - Feature: []Feature{ - Feature{Rect: image.Rect(1, 1, 3, 3), Weight: -1.}, - Feature{Rect: image.Rect(3, 3, 5, 5), Weight: 2.5}, - }, - Threshold: 0.07, - Left: 0.2, - Right: 0.4, - } - cascade = Cascade{ - Stage: []CascadeStage{ - CascadeStage{ - Classifier: []Classifier{classifier0, classifier1}, - Threshold: 0.82, - }, - CascadeStage{ - Classifier: []Classifier{classifier2}, - Threshold: 0.22, - }, - }, - Size: image.Pt(20, 20), - } -) - -func TestParseOpenCV(t *testing.T) { - file, err := os.Open("../../testdata/opencv.xml") - if err != nil { - t.Fatal(err) - } - defer file.Close() - - cascadeFile, name, err := ParseOpenCV(file) - if err != nil { - t.Fatal(err) - } - if name != "name_of_cascade" { - t.Fatalf("name: got %s want name_of_cascade", name) - } - - if !reflect.DeepEqual(cascade, *cascadeFile) { - t.Errorf("got\n %v want\n %v", *cascadeFile, cascade) - } -} |