func FromImageUnsafe(img *image.RGBA) *IplImage {
	b := img.Bounds()
	buf := CreateImageHeader(
		b.Max.X-b.Min.X,
		b.Max.Y-b.Min.Y,
		IPL_DEPTH_8U, 4)
	dst := CreateImage(
		b.Max.X-b.Min.X,
		b.Max.Y-b.Min.Y,
		IPL_DEPTH_8U, 4)

	buf.SetData(unsafe.Pointer(&img.Pix[0]), CV_AUTOSTEP)
	CvtColor(buf, dst, CV_RGBA2BGRA)
	buf.Release()

	return dst
}
func FromImageUnsafe(img *image.RGBA) *IplImage {
	b := img.Bounds()
	buf := CreateImageHeader(
		b.Max.X-b.Min.X,
		b.Max.Y-b.Min.Y,
		IPL_DEPTH_8U, 4)
	dst := CreateImage(
		b.Max.X-b.Min.X,
		b.Max.Y-b.Min.Y,
		IPL_DEPTH_8U, 4)

	buf.SetData(unsafe.Pointer(&img.Pix[0]), CV_AUTOSTEP)
	CvtColor(buf, dst, CV_RGBA2BGRA)
	buf.Release()

	return dst
}
func FromImageUnsafe ( img * image . RGBA ) * IplImage { b := img . Bounds ( ) buf := CreateImageHeader ( b . Max . X - b . Min . X , b . Max . Y - b . Min . Y , IPL_DEPTH_8U , 4 ) dst := CreateImage ( b . Max . X - b . Min . X , b . Max . Y - b . Min . Y , IPL_DEPTH_8U , 4 ) buf . SetData ( unsafe . Pointer ( & img . Pix [ 0 ] ) , CV_AUTOSTEP ) CvtColor ( buf , dst , CV_RGBA2BGRA ) buf . Release ( ) return dst }
/* FromImageUnsafe create an opencv.IplImage that shares the buffer with the
go image.RGBA image. All changes made from opencv might affect go! */
/ * FromImageUnsafe create an opencv . IplImage that shares the buffer with the go image . RGBA image . All changes made from opencv might affect go!