Creating an Improved Digital Zoom
Ok, so I have a given video source (for the sake of the example, it is a camera). It does not have optical zoom, but we supply digital zoom instead. Now this digital zoom is pretty simple, simply cropping the image to a specified portion, and filling the screen with that portion.
The开发者_StackOverflow社区 problem is that the zoomed video can have pretty rubbish quality when the digital zoom is enabled.
I am wondering if anyone knows of an approach by which a higher quality of digital zoom can be achieved in real-time.
The software is on Windows, and the video is rendered using DirectShow, but it isn't a platform solution I'm necessarily after, more just a better approach to the problem.
Cheers
I discovered two posts by Jeff Atwood on this topic. If you want better than bilinear resizing, fractal resizing seems to be a good alternative.
The link Jeff gives to the CodeProject example is dead, but I think he's referring to this article.
You can apply filters which try to improve the image quality, but there is a definite limit to what you can do. You can't produce information (i.e. image quality) out of thin air.
The enhance button does not exist.
There are algorithms that can produce pretty impressive enhancements for some specific input (for example there are good solutions for pixel art), but applying those to other kinds of input produces much worse output.
Take a look on Google for upscaling of standard def video using ffdshow. This will show you what algorithms you need to look at to get a reasonable increase in visual quality.
Two suggestions:
use the best interpolation method that you can, e.g. Lanczos
if you have several consecutive frames with little or no motion between them (e.g. if it's video) then you may be able to combine the frames to get better upsampling for a single frame
精彩评论