Applications of Optimization and Machine Learning in Image Processing and IoT