Image or video recognition using optical means, e.g. reference filters, holographic masks, frequency domain filters or spatial domain filters