func (c *Classifier) performDetection(frame *gocv.Mat, results gocv.Mat) {
	for i := 0; i < results.Total(); i += 7 {
		confidence := results.GetFloatAt(0, i+2)
		if confidence > 0.8 {
			left := int(results.GetFloatAt(0, i+3) * float32(frame.Cols()))
			top := int(results.GetFloatAt(0, i+4) * float32(frame.Rows()))
			right := int(results.GetFloatAt(0, i+5) * float32(frame.Cols()))
			bottom := int(results.GetFloatAt(0, i+6) * float32(frame.Rows()))
			mask := image.Rect(left, top, right, bottom)
			gocv.Rectangle(frame, mask, color.RGBA{0, 255, 0, 0}, 2)
			if mask.Size().X > 0 && mask.Size().Y > 0 && mask.Max.X <= frame.Cols() && mask.Max.Y <= frame.Rows() {
				face := frame.Region(mask)
				name := c.computer.compareAndReturnName(face)
				gocv.PutText(frame, name, image.Pt(left, top), gocv.FontHersheyPlain, 1, color.RGBA{0, 0, 0, 255}, 2)
			}

		}
	}
}
// performDetection analyzes the results from the detector network,
// which produces an output blob with a shape 1x1xNx7
// where N is the number of detections, and each detection
// is a vector of float values
// [batchId, classId, confidence, left, top, right, bottom]
performDetection analyzes the results from the detector network,
which produces an output blob with a shape 1x1xNx7
where N is the number of detections, and each detection
is a vector of float values
[batchId, classId, confidence, left, top, right, bottom]
// performDetection analyzes the results from the detector network // which produces an output blob with a shape 1x1xNx7 // where N is the number of detections and each detection // is a vector of float values // [ batchId classId confidence left top right bottom ]
func (c *Classifier) performDetection(frame *gocv.Mat, results gocv.Mat) {
	for i := 0; i < results.Total(); i += 7 {
		confidence := results.GetFloatAt(0, i+2)
		if confidence > 0.8 {
			left := int(results.GetFloatAt(0, i+3) * float32(frame.Cols()))
			top := int(results.GetFloatAt(0, i+4) * float32(frame.Rows()))
			right := int(results.GetFloatAt(0, i+5) * float32(frame.Cols()))
			bottom := int(results.GetFloatAt(0, i+6) * float32(frame.Rows()))
			mask := image.Rect(left, top, right, bottom)
			gocv.Rectangle(frame, mask, color.RGBA{0, 255, 0, 0}, 2)
			if mask.Size().X > 0 && mask.Size().Y > 0 && mask.Max.X <= frame.Cols() && mask.Max.Y <= frame.Rows() {
				face := frame.Region(mask)
				name := c.computer.compareAndReturnName(face)
				gocv.PutText(frame, name, image.Pt(left, top), gocv.FontHersheyPlain, 1, color.RGBA{0, 0, 0, 255}, 2)
			}
		}
	}
}
func ( c * Classifier ) performDetection ( frame * gocv . Mat , results gocv . Mat ) { for i := 0 ; i < results . Total ( ) ; i += 7 { confidence := results . GetFloatAt ( 0 , i + 2 ) if confidence > 0.8 { left := int ( results . GetFloatAt ( 0 , i + 3 ) * float32 ( frame . Cols ( ) ) ) top := int ( results . GetFloatAt ( 0 , i + 4 ) * float32 ( frame . Rows ( ) ) ) right := int ( results . GetFloatAt ( 0 , i + 5 ) * float32 ( frame . Cols ( ) ) ) bottom := int ( results . GetFloatAt ( 0 , i + 6 ) * float32 ( frame . Rows ( ) ) ) mask := image . Rect ( left , top , right , bottom ) gocv . Rectangle ( frame , mask , color . RGBA { 0 , 255 , 0 , 0 } , 2 ) if mask . Size ( ) . X > 0 && mask . Size ( ) . Y > 0 && mask . Max . X <= frame . Cols ( ) && mask . Max . Y <= frame . Rows ( ) { face := frame . Region ( mask ) name := c . computer . compareAndReturnName ( face ) gocv . PutText ( frame , name , image . Pt ( left , top ) , gocv . FontHersheyPlain , 1 , color . RGBA { 0 , 0 , 0 , 255 } , 2 ) } } } }
performDetection analyzes the results from the detector network,
which produces an output blob with a shape 1x1xNx7
where N is the number of detections, and each detection
is a vector of float values
[batchId, classId, confidence, left, top, right, bottom]
performDetection analyzes the results from the detector network which produces an output blob with a shape 1x1xNx7 where N is the number of detections and each detection is a vector of float values [ batchId classId confidence left top right bottom ]