2013-02-24 403 views

回答

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); 

希望它有帮助。

+0

据我所知,这是不到位可能调整大小(即,调整图像大小,影响它调用调整图像大小)使用Emgu CV。例如你需要这样做:'''var im = new Image (filename); ...逻辑... im = im.Resize(...)'''而不是'''var im = new图片(文件名)...逻辑... im.Resize(...) '' – user3791372 2015-03-13 02:09:35

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); 
0

答案很简单我如何调整图像。

让我们假设图像的路径是“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