Reputation: 13636
Here is my C# code:
public static void FilterNoises(Bitmap bmp)
{
Image<Bgr, Byte> img = new Image<Bgr, byte>(bmp);
img.PyrUp().PyrDown();
img.Save(@"C:\Users\Desktop\Road Images\Filtered Images\" + "filename.extension");
}
I need to get the file name and extansion from bmp object. Any idea how to do it?
Upvotes: 0
Views: 1549
Reputation: 245
You should have the file name and extension from when you loaded the bitmap, you can get the filename directly from the Bitmap object itself
var filename = @"C:\Filename.bmp";
var bitmap = new Bitmap(System.Drawing.Image.FromFile(fileName, true));
Upvotes: 1