Dictionary Learning for Super-resolution and Demosaicing