Emerging visual-based driving assistance systems involve time-critical and data-intensive computational tasks, such as real-time object recognition and scene understanding. Due to the constraints on space and power capacity, it is not feasible to install extra computing devices on all the vehicles. To solve this problem, different scenarios of vehicular fog computing have been proposed, where computational tasks generated by vehicles can be sent to and processed at fog nodes located for example at 5G cell towers or moving buses. In this paper, we propose Chameleon, a novel solution for task offloading for visual-based assisted driving. Chameleon takes into account the spatiotemporal variation in service demand and supply, and provides latency and resolution aware task offloading strategies based on partially observable Markov decision process (POMDP). To evaluate the effectiveness of Chameleon, we simulate the availability of vehicular fog nodes at different times of day based on the bus trajectories collected in Helsinki, and use the real-world performance measurements of visual data transmission and processing. Compared with adaptive and random task offloading strategies, the POMDP-based offloading strategies provided by Chameleon shortens the average service latency of task offloading by up to 65% while increasing the average resolution level of processed images by up to 83%.