Abstract Polarimetry plays an indispensable role in the light-matter interactions. Nevertheless, conventional components developed for polarization measurements suffer from bulky volume and spatial alignment schemes, causing them to reveal limited performance in determining inhomogeneous polarization distributions. Here, we propose a polarization detection scheme based on pixelated all-dielectric metasurfaces using spin-multiplexing coding techniques. The polarization resolving capability of the pixelated metasurface under homogeneous linearly polarized illumination was first evaluated, and the extracted peak coordinates were used to establish an exact functional relationship with the azimuthal angle. Subsequently, the measurement of spatial inhomogeneous polarization was further explored with a focusing matrix assembled from pixelated metasurfaces. The proposed polarization detection strategy can be extended to other spectral bands without discrimination, stimulating potential applications in high-resolution imaging, sensing and data communication.