How do I detect if an image is pixelated?
-
More specifically, I want to be able distinguish a clear image of something like a grid (texture image) http://www.vectorstock.com/i/composite/21,67/262167/fabric-texture-with-squares-vector.jpg from a pixelated image (of fireworks) http://www.caughtinthefire.com/wp-content/uploads/2009/03/fireworks-pixelate-02.gif? More generally, let's assume that the grid-like image does not have repeating patterns like this one, although, adjacent pixels may have the same value.
-
Answer:
Differentiate the image, that is take derivatives of the "image signal" in both x and y directions. If the image is pixelated you would see a lot of huge derivatives. If it is not, the derivative of the image will be bounded. You could possibly use a heuristically determined threshold to separate a pixelated image from a smooth one. Another possible way is to use a 2D Fourier transform, and to look at the magnitudes of high 2D frequencies (both $${\omega_x} and $${\omega_y}). Small magnitudes mean a smooth images, and high magnitudes mean a pixelated one. These methods definitely need experimentation and testing to figure out which gives a more robust and repeatable classification of the particular set of images you are working with.
Ripul Bhutani at Quora Visit the source
Other answers
In addition to the frequency domain analysis described in the other answers, a slightly alternative way to detect the difference would be to try to compress it. The pixellated image would be highly compressible due to the regular structure and low information content whereas the texture would be less so. ...or maybe get the difference between the original image and a pixellated version of itself. The difference between a pixellated image and a re-pixellated copy of itself will be small. The texture-image, less so.
Steve Tickle
If neighboring voxels tend to have exactly the same value, it should be a good indication that the image is pixelated. Otherwise, I think you should see pretty clear patterns in the frequency domain. Probably a pretty straightforward problem. Have you checked what the literature (search google scholar) has to offer?
Joël Schaerer
In case you do expect regular patterns, like lines in the first image, you could use Hough transform.
Vadim Zaliva
Related Q & A:
- How do I add a background image to my JFrame?Best solution by Stack Overflow
- How can I detect changes in XML?Best solution by Stack Overflow
- How do I change the picture image on my profile?Best solution by Yahoo! Answers
- How can I print a big image on 4 sheets A4?Best solution by Yahoo! Answers
- How can I change an internet image to 300 DPI?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.