make FromImage work with gifs
This commit is contained in:
parent
f5cf2f6e3b
commit
d9acb35527
2 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue