Skip to content

Commit

Permalink
fixed NewMatFromPointVector test. added: TestNewMatFromPoint2fVector …
Browse files Browse the repository at this point in the history
…test
  • Loading branch information
diegohce committed Dec 2, 2024
1 parent 5cdcc5a commit fcb3e01
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3415,9 +3415,7 @@ func TestNewRotatedRect2f(t *testing.T) {

func TestNewMatFromPointVector(t *testing.T) {

img := IMRead("images/face.jpg", IMReadColor)
defer img.Close()

img := NewMatWithSize(320, 200, MatTypeCV32SC1)
size := img.Size()

points := []image.Point{
Expand All @@ -3431,4 +3429,23 @@ func TestNewMatFromPointVector(t *testing.T) {

m := NewMatFromPointVector(pv, false)
defer m.Close()

if m.Empty() {
t.Error("Mat shlould not be empty")
}

}

func TestNewMatFromPoint2fVector(t *testing.T) {

pv2f := NewPoint2fVectorFromPoints([]Point2f{NewPoint2f(1.1, 2.2)})
defer pv2f.Close()

m := NewMatFromPoint2fVector(pv2f, false)
defer m.Close()

if m.Empty() {
t.Error("Mat shlould not be empty")
}

}

0 comments on commit fcb3e01

Please sign in to comment.