本文整理匯總了Golang中github.com/lazywei/go-opencv/opencv.IplImage.GetROI方法的典型用法代碼示例。如果您正苦於以下問題:Golang IplImage.GetROI方法的具體用法?Golang IplImage.GetROI怎麽用?Golang IplImage.GetROI使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/lazywei/go-opencv/opencv.IplImage
的用法示例。
在下文中一共展示了IplImage.GetROI方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: ProcessRoi
func ProcessRoi(img *opencv.IplImage, gradeOfCanny int) *opencv.IplImage {
var roi = img.GetROI()
w := roi.Width()
h := roi.Height()
// Create the output image
cedge := opencv.CreateImage(w, h, opencv.IPL_DEPTH_8U, 3)
//defer cedge.Release()
// Convert to grayscale
gray := opencv.CreateImage(w, h, opencv.IPL_DEPTH_8U, 1)
edge := opencv.CreateImage(w, h, opencv.IPL_DEPTH_8U, 1)
//newimage := opencv.CreateImage(w, h, opencv.IPL_DEPTH_8U, 1)
defer gray.Release()
defer edge.Release()
opencv.CvtColor(img, gray, opencv.CV_BGR2GRAY)
opencv.Smooth(gray, edge, opencv.CV_BLUR, 3, 3, 0, 0)
opencv.Not(gray, edge)
// Run the edge detector on grayscale
opencv.Canny(gray, edge, float64(gradeOfCanny), float64(gradeOfCanny*3), 3)
opencv.Zero(cedge)
// copy edge points
opencv.Copy(img, cedge, edge)
return cedge
}