warpAffine without Interpolation
Hi, what flags do i need by cv::warpAffine to do no interpolation ? Or is there a way to mark the "outliners" in a special color ?
Hi, what flags do i need by cv::warpAffine to do no interpolation ? Or is there a way to mark the "outliners" in a special color ?
Each pixel in warped image should be calculated from one or more pixels of original image. Usually using more than one pixel give best result and this is default option for warpAffine (bilinear interpolation). But sometimes we may need that warped image will have only colors of original image, i.e. each new pixel should get its value from exactly one pixel of original image. Is this what you meant by "without interpolation"? If yes, you can use INTER_NEAREST flag. By the way, this is also the fastest way to perform warping because it needs less calculations.
Well yes it indeed looks worse than other types of interpolation, but it still may be OK for his purpose.
Asked: 2013-08-13 08:33:06 -0600
Seen: 1,793 times
Last updated: Aug 14 '13
You cant avoid the interpolation which is kind of obvious. Lets take an example that you want to scale up an image. How do you want to determine the new pixels that get added without interpolation? The same applies to rotations and translations.