How to determine if an image/video is pixelated or not [closed]
I have come across a use case where i have to determine if a video/frame is pixelated or not.
I was refering stackoverflowImagepixelation but it doesn't work for me. Please suggest the solution
import numpy as np
import Image, ImageChops
im = Image.open('tryanypixelatedimagefromGoogle.jpeg')
im2 = im.transform(im.size, Image.AFFINE, (1,0,1,0,1,1))
im3 = ImageChops.subtract(im, im2)
im3 = np.asarray(im3)
im3 = np.sum(im3,axis=0)[:-1]
mean = np.mean(im3)
peak_spacing = np.diff([i for i,v in enumerate(im3) if v > mean*2])
mean_spacing = np.mean(peak_spacing)
std_spacing = np.std(peak_spacing)
print 'mean gap:', mean_spacing, 'std', std_spacing
could you add, what you actually tried, (on your own) ?
a link to an SO question is not really helpful here.
Its just we have a video quality parameter where we have to determine how pixelated video is, since i am new to open cv so i just wanted to know how to determine pixelation using opencv
no, i meant: show your code / image, please ;)
(put it all into your question :)
i don't see any opencv related code, above ;\
(we can't help with arbitrary python code here)