gocv/gocv_core.go
func GcvMatToMat64(mat GcvMat) *mat64.Dense {
	col := mat.GetCols()
	row := mat.GetRows()

	data := []float64{}

	for i := 0; i < row; i++ {
		for j := 0; j < col; j++ {
			if fltPtr, ok := mat.GcvAtf64(i, j).(*float64); ok {
				data = append(data, *fltPtr)
			} else {
				panic("Non *float64 passed to MatToMat64")
			}

		}
	}

	return mat64.NewDense(row, col, data)
}
func GcvMatToMat64(mat GcvMat) *mat64.Dense {
	col := mat.GetCols()
	row := mat.GetRows()

	data := []float64{}

	for i := 0; i < row; i++ {
		for j := 0; j < col; j++ {
			if fltPtr, ok := mat.GcvAtf64(i, j).(*float64); ok {
				data = append(data, *fltPtr)
			} else {
				panic("Non *float64 passed to MatToMat64")
			}

		}
	}

	return mat64.NewDense(row, col, data)
}
// Convert Mat, which defined by SWIG, to *mat64.Dense.
// The reason is the latter is much easier to handle
// in Go.
// GcvMat is assumed to be 2-dimensional matrix.