How to use gocv normalize function

Hello everyone, I’m having troubles with gocv function Normalize. that in the documentation goes like that.

func Normalize(src Mat, dst *Mat, alpha float64, beta float64, typ NormType)

I’m calling this at my code and get a segmentation error in response. Can you help me fix this call?
package main

import (
// “fmt”

/** CovarFlags
// CovarScrambled indicates to scramble the results.
CovarScrambled CovarFlags = 0

// CovarNormal indicates to use normal covariation.
CovarNormal CovarFlags = 1

// CovarUseAvg indicates to use average covariation.
CovarUseAvg CovarFlags = 2

// CovarScale indicates to use scaled covariation.
CovarScale CovarFlags = 4

// CovarRows indicates to use covariation on rows.
CovarRows CovarFlags = 8

// CovarCols indicates to use covariation on columns.
CovarCols CovarFlags = 16


func main() {

var size int

var normtype gocv.NormType = gocv.NormMinMax

size  = imageprocessing.FolderLength("./imageprocessing/Images/danger")

Images := make([]gocv.Mat,size)

GLCMs := make([]gocv.Mat,size)

normalizedGLCMs := make([]gocv.Mat,size)

means := make([]gocv.Mat,size)


//GroupGLCM(Images []gocv.Mat, GLCMs []gocv.Mat, means []gocv.Mat, show bool)
imageprocessing.GroupGLCM(Images, GLCMs, means, false)

//func Normalize(src Mat, dst *Mat, alpha float64, beta float64, typ NormType)
//min value of dst is alpha and max value of dst is beta
for i := 0; i < size; i++ {
	gocv.Normalize(GLCMs[i], &normalizedGLCMs[i], 0.0, 255.0, normtype )
	//imageprocessing.ShowImage("normalizedGLCMs", normalizedGLCMs[i], 100)


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.