Image processing for smart cameras