2

我在文件夹图像中有图像如何在打开图像时使用 emgucv 中的图像框调整图像大小?谢谢。。

4

3 回答 3

6
// To get orginal image from the OpenFileDialog
Image<Bgr, Byte> captureImage = new Image<Bgr, byte>(openImageFileDialog.FileName);

// To resize the image 
Image<Bgr, byte> resizedImage = captureImage.Resize(width, height, Emgu.CV.CvEnum.INTER.CV_INTER_LINEAR);

希望能帮助到你。

于 2013-06-11T12:31:58.243 回答
2

答案很简单。

让我们假设图像的路径是“C:\image.jpg”。

Mat frame = new Mat();   //Declaration
string path = @"C:\image.jpg";
int width = 640, height = 480;

frame = CvInvoke.Imread(path , LoadImageType.AnyColor);

CvInvoke.Resize(frame, frame, new Size(imagebox1.Width, imagebox1.Height), 0, 0, Inter.Linear);    //This resizes the image to the size of Imagebox1 
OR
CvInvoke.Resize(frame, frame, new Size(width, height), 0, 0, Inter.Linear);    //This resizes the image into your specified width and height
于 2016-11-04T09:21:13.167 回答
0

这就是我如何使用 EmguCV 调整图像大小

            Bitmap bitmap = new Bitmap(FileUpload1.PostedFile.InputStream);
            Image<Hsv, Byte> Iimage = new Image<Hsv, byte>(bitmap);
            Image<Hsv, Byte> HsvImage = Iimage.Resize(384, 256,INTER.CV_INTER_LINEAR);
于 2016-03-04T05:42:38.757 回答