我在文件夾圖像中有圖像 如何在emgucv中的圖像框中打開圖像調整圖像大小? thnx ..如何使用imagebox emgucv調整圖像大小?
2
A
回答
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
這是使用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
據我所知,這是不到位可能調整大小(即,調整圖像大小,影響它調用調整圖像大小)使用Emgu CV。例如你需要這樣做:'''var im = new Image(filename); ...邏輯... im = im.Resize(...)'''而不是'''var im = new圖片(文件名)...邏輯... im.Resize(...) '' –
user3791372
2015-03-13 02:09:35