我在文件夹图片中有图像 如何在打开图像的emgucv中使用imagebox调整图像大小? 日Thnx ..
答案 0 :(得分: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);
希望它有所帮助。
答案 1 :(得分: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);
答案 2 :(得分:0)
答案很简单。
让我们假设图像的路径是&#34; C:\ image.jpg&#34;。
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