1. A visual recognition apparatus for identifying objects captured in a video stream having a captured time period, the apparatus comprising: a hardware processor; and programming in a non-transitory computer readable medium and executable on the hardware processor for: capturing a video stream on an electronic device having an image sensor, said video stream comprising a plurality of temporally adjacent images; enabling a user of the electronic device to select, from said video stream, a target object or scene for training; associating each frame in an image with a corresponding frame in temporally adjacent images, or in images taken from nearby vantage points; and temporally aggregating statistics computed at one or more collections of temporally corresponding frames, into a descriptor; wherein said programming ranks image features according to their structural stability margin; and wherein said structural stability margin comprises a maximum norm of the nuisance that does not cause a singularity in the detection mechanism.