A boundary map and a first image are received as input. The boundary map indicates a plurality of fields. The boundary map is used to regularize, across a set comprising a plurality of pixels bounded by a first field in the plurality of fields, a set of one or more pixel brightness values. A regularized image is generated as output, where for each pixel in the first image bounded by the first field, a set of values in the corresponding pixel in the regularized image is assigned the set of regularized pixel brightness values.