1. A system comprising: a light modulating device configured to modulate an incident stream of light by a series of spatial patterns to produce a modulated light stream, wherein the light modulating device includes a plurality light modulating elements; a light sensing device having one or more light sensing elements, wherein the one or more light sensing elements are fewer in number than the plurality of the light modulating elements; an optical subsystem configured to direct the modulated light stream onto the light sensing elements, wherein the light sensing device is configured to obtain measurements of intensity of the modulated light stream over time, wherein each of the measurements represents an inner product between a corresponding time portion of the incident light stream and a corresponding one of the spatial patterns, wherein the measurements comprise an encoded representation of an image or video sequence; wherein for an image or video sequence that is approximately K-sparse, the number of the measurements is O(K*log 2 (1+N/K)) or less.