make FromImage work with gifs

This commit is contained in:
Aditya Bhargava 2014-10-20 15:39:10 -07:00
parent f5cf2f6e3b
commit d9acb35527
2 changed files with 3 additions and 3 deletions

View file

@ -69,10 +69,10 @@ func (this *HaarCascade) DetectObjects(image *IplImage) []*Rect {
rect := (*Rect)((*_Ctype_CvRect)(unsafe.Pointer(C.cvGetSeqElem(seq, C.int(i)))))
faces = append(faces, rect)
}
storage_c := (*C.CvMemStorage)(storage)
C.cvReleaseMemStorage(&storage_c)
return faces
}

View file

@ -30,7 +30,7 @@ func FromImage(img image.Image) *IplImage {
c := model.Convert(px).(color.RGBA)
value := NewScalar(float64(c.B), float64(c.G), float64(c.R), float64(c.A))
dst.Set2D(x, y, value)
dst.Set2D(x-b.Min.X, y-b.Min.Y, value)
}
}