我不知道這是否有幫助,我沒有使用emgu。然而,這是我能夠用opencv在圖像中完成圖像的方式。
drawIntoArea(Mat &src, Mat &dst, int x, int y, int width, int height)
{
Mat scaledSrc;
// Destination image for the converted src image.
Mat convertedSrc(src.rows,src.cols,CV_8UC3, Scalar(0,0,255));
// Convert the src image into the correct destination image type
// Could also use MixChannels here.
// Expand to support range of image source types.
if (src.type() != dst.type())
{
cvtColor(src, convertedSrc, CV_GRAY2RGB);
}else{
src.copyTo(convertedSrc);
}
// Resize the converted source image to the desired target width.
resize(convertedSrc, scaledSrc,Size(width,height),1,1,INTER_AREA);
// create a region of interest in the destination image to copy the newly sized and converted source image into.
Mat ROI = dst(Rect(x, y, scaledSrc.cols, scaledSrc.rows));
scaledSrc.copyTo(ROI);
}
你使用的是C還是Python?你究竟如何做Large = Small作業?既然你說它不起作用,你可能有一些代碼,所以如果你也發佈了這個代碼會很好。 – 2011-06-16 21:35:55
因爲他被標記爲「emgu」,所以它可能是emgucv。我希望emgucv的人會停止標記/調用它opencv ... – etarion 2011-06-16 21:43:38
沒有注意到有關EMGU的一點,所以它不是C和Python之間的選擇。但問題仍然存在:您使用哪種語言? – 2011-06-16 21:45:08