32. A method of processing an image, comprising: decomposing the image into a plurality of channels, each being characterized by a different depth-of-field, and storing said decomposed image in a memory; accessing, by a digital image processor, a non-transitory computer readable medium storing an in-focus dictionary defined over a plurality of dictionary atoms, and an out-of-focus dictionary defined over a plurality of sets of dictionary atoms, each set corresponding to a different out-of-focus condition, wherein said out-of-focus dictionary comprises a plurality of sub-dictionaries, each being characterized by a defocus parameter, and wherein different sub-dictionaries correspond to different values of said defocus parameter; computing, by said image processor, at least one sparse representation of said decomposed image over said dictionaries and storing said at least one sparse representation in a memory; and generating by said image processor a processed image using said sparse representation, and displaying said processed image on a display device.
32. A method of processing an image, comprising: decomposing the image into a plurality of channels, each being characterized by a different depth-of-field, and storing said decomposed image in a memory; accessing, by a digital image processor, a non-transitory computer readable medium storing an in-focus dictionary defined over a plurality of dictionary atoms, and an out-of-focus dictionary defined over a plurality of sets of dictionary atoms, each set corresponding to a different out-of-focus condition, wherein said out-of-focus dictionary comprises a plurality of sub-dictionaries, each being characterized by a defocus parameter, and wherein different sub-dictionaries correspond to different values of said defocus parameter; computing, by said image processor, at least one sparse representation of said decomposed image over said dictionaries and storing said at least one sparse representation in a memory; and generating by said image processor a processed image using said sparse representation, and displaying said processed image on a display device. 36. The method according to claim 32 , further comprising constructing a depth map of the scene, based on said sparse representation.