1. Computer-readable media embodying instructions executable by a computer to perform a method comprising: receiving a first two-dimensional array; generating a plurality of second two-dimensional arrays based on the first two-dimensional array, wherein each of the second two-dimensional arrays is generated using a different threshold number, and wherein each entry of the second two-dimensional arrays indicates whether a corresponding entry in the first two-dimensional array exceeds the respective threshold number; generating a first vector, wherein each entry in the first vector represents a number of connected components for a respective one of the second two-dimensional arrays; generating a second vector based on the first vector, wherein each entry of the second vector represents a variance of a plurality of entries, including a corresponding entry, of the first vector; generating a third vector, comprising filtering the second vector; and selecting, based on the third vector, at least one of one of the threshold numbers; and one of the second two-dimensional arrays.