new fx fy in ReadFromUploadImg
| | |
| | | } |
| | | logger.Debug("picMat.Data.len:", len(picMat.ToBytes())) |
| | | newMat := gocv.NewMat() |
| | | if picMat.Rows() > 1000 || picMat.Cols() > 1000 { |
| | | gocv.Resize(picMat,&newMat, image.Pt(0,0), 0.5, 0.5, gocv.InterpolationDefault) |
| | | size := 1024 |
| | | if picMat.Rows() > size || picMat.Cols() > size { |
| | | fx := float64(size)/float64(picMat.Rows()) |
| | | fy := float64(size)/float64(picMat.Cols()) |
| | | ff := fx |
| | | if fx > fy{ |
| | | ff = fy |
| | | } |
| | | gocv.Resize(picMat,&newMat, image.Pt(0,0), ff, ff, gocv.InterpolationDefault) |
| | | picMat = newMat |
| | | } |
| | | |