From 3046969b886bc1bd1182bcc30056d3c351b0e5a8 Mon Sep 17 00:00:00 2001 From: Ron Evans Date: Mon, 23 Dec 2019 09:53:27 +0100 Subject: [PATCH] contrib/bgsegm: run go fmt on contributed code Signed-off-by: Ron Evans --- contrib/bgsegm.go | 22 +++++++++++----------- contrib/bgsegm_test.go | 5 ++--- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/contrib/bgsegm.go b/contrib/bgsegm.go index f515c725..71d6fa7b 100644 --- a/contrib/bgsegm.go +++ b/contrib/bgsegm.go @@ -7,15 +7,15 @@ package contrib import "C" import ( - "unsafe" + "unsafe" - "gocv.io/x/gocv" + "gocv.io/x/gocv" ) // BackgroundSubtractorCNT is a wrapper around the cv::BackgroundSubtractorCNT. type BackgroundSubtractorCNT struct { - // C.BackgroundSubtractorCNT - p unsafe.Pointer + // C.BackgroundSubtractorCNT + p unsafe.Pointer } // NewBackgroundSubtractorCNT returns a new BackgroundSubtractor algorithm @@ -27,15 +27,15 @@ type BackgroundSubtractorCNT struct { // https://docs.opencv.org/3.4/de/dca/classcv_1_1bgsegm_1_1BackgroundSubtractorCNT.html // func NewBackgroundSubtractorCNT() BackgroundSubtractorCNT { - return BackgroundSubtractorCNT{p: unsafe.Pointer(C.BackgroundSubtractorCNT_Create())} + return BackgroundSubtractorCNT{p: unsafe.Pointer(C.BackgroundSubtractorCNT_Create())} } // Close BackgroundSubtractorCNT. func (b *BackgroundSubtractorCNT) Close() error { - C.BackgroundSubtractorCNT_Close((C.BackgroundSubtractorCNT)(b.p)) - b.p = nil + C.BackgroundSubtractorCNT_Close((C.BackgroundSubtractorCNT)(b.p)) + b.p = nil - return nil + return nil } // Apply computes a foreground mask using the current BackgroundSubtractorCNT. @@ -44,7 +44,7 @@ func (b *BackgroundSubtractorCNT) Close() error { // https://docs.opencv.org/3.4/de/dca/classcv_1_1bgsegm_1_1BackgroundSubtractorCNT.html // func (b *BackgroundSubtractorCNT) Apply(src gocv.Mat, dst *gocv.Mat) { - C.BackgroundSubtractorCNT_Apply((C.BackgroundSubtractorCNT)(b.p), (C.Mat)(src.Ptr()), (C.Mat)(dst.Ptr())) + C.BackgroundSubtractorCNT_Apply((C.BackgroundSubtractorCNT)(b.p), (C.Mat)(src.Ptr()), (C.Mat)(dst.Ptr())) - return -} \ No newline at end of file + return +} diff --git a/contrib/bgsegm_test.go b/contrib/bgsegm_test.go index 3602905c..f60943b5 100644 --- a/contrib/bgsegm_test.go +++ b/contrib/bgsegm_test.go @@ -2,8 +2,8 @@ package contrib import ( "testing" + "gocv.io/x/gocv" - v "gocv.io/x/gocv/contrib" ) func TestCNT(t *testing.T) { @@ -16,7 +16,7 @@ func TestCNT(t *testing.T) { dst := gocv.NewMat() defer dst.Close() - cnt := v.NewBackgroundSubtractorCNT() + cnt := NewBackgroundSubtractorCNT() defer cnt.Close() cnt.Apply(img, &dst) @@ -25,4 +25,3 @@ func TestCNT(t *testing.T) { t.Error("Error in TestCNT test") } } -