How do i detect pixellation in an image

Hi, i am currently trying to detect pixelation in an image but my current approach is really accurate. Here is the code

def do_canny(image):
    gray = cv2.imread(image,0)
    canny = cv2.Canny(gray,50,150,apertureSize = 3)
    minLineLength = 100
    maxLineGap = 10
    lines = cv2.HoughLinesP(canny,1,np.pi/180,100,minLineLength,maxLineGap)
    return gray, canny,lines

def plot_images(gray, canny):
    plt.subplot(121),plt.imshow(gray,cmap = 'gray')
    plt.title('Original Image'), plt.xticks([]), plt.yticks([])
    plt.subplot(122),plt.imshow(canny,cmap = 'gray')
    plt.title('Edge Image'), plt.xticks([]), plt.yticks([])
    
def do_laplacian(image):
    gray = cv2.imread(image,0)
    variance = cv2.Laplacian(gray,cv2.CV_64F)
    var=np.var(variance)
    return var
    
gray, canny,lines = do_canny(img_path)
plot_images(gray, canny)

Can you elaborate what do you mean by pixelation? Some example images maybe?
And what doesn’t work?