I have a C# desktop application. I am using EMGU as a wrapper for OpenCV.
I am receiving images in JPEG format that were originally taken by an analogue camera.
The quality of the image is poor (compared to digital cameras).
I want to see if I can use filters/methods derived from OpenCV/EMGU that could enhance the image.
What I mean by enhancement is to make the image a bit sharper.
I have played around with median, bilateral, contrast stretching to see if the image can be improved.
Nothing has worked.
Even if it can be confirmed to me that nothing I can do will enhance the image that will be an answer in itself. I can stop trying and persuade the client to use a digital camera instead...
This is the image:
This is the code that I apply to the original image to get the image you can see here:
int factor = Shared.factor;
int xVal = 288;
int yVal = 360;
using (Image<Bgr, Byte> color = new Image<Bgr, byte>(grid))
{
byte[] data = null;
for (int x = 0; x < xVal; x++)
{
for (int y = 0; y < yVal; y++)
{
grid[x, y, 0] = (byte)(grid[x, y, 0] / factor);
grid[x, y, 1] = (byte)(grid[x, y, 1] / factor);
grid[x, y, 2] = (byte)(grid[x, y, 2] / factor);
}
}
color.Data = grid;
data = ImageToByteArray(color.ToBitmap());
}
private byte[] ImageToByteArray(Image imageIn)
{
byte[] data = null;
try
{
using (MemoryStream ms = new MemoryStream())
{
imageIn.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
imageIn.Dispose();
data = ms.ToArray();
}
}
catch (Exception ex)
{
//do something
}
finally
{
if (imageIn != null)
{
imageIn.Dispose();
}
}
return data;
}
As requested this is an original image but from a different view: