filter/mog.go: should handle error from IMGDecode

Issue #209 resolved
Saxon Milton created an issue

We are not handling the error from IMGDecode:

// Implements io.Writer.
// Write applies the motion filter to the video stream. Only frames with motion
// are written to the destination encoder, frames without are discarded.
func (m *MOGFilter) Write(f []byte) (int, error) {
    img, _ := gocv.IMDecode(f, gocv.IMReadColor)
...

We should check this and throw an error if non nil.

Comments (2)

  1. Log in to comment