An Energy-Efficient CMOS Image Sensor with Embedded Machine Learning Algorithm