Vehicle-based visual crowdsourcing is an emerging paradigm where the visual data collected from dash cameras are analyzed with the aim of measuring phenomena of common interest. To ensure the efficiency in vehicle-based visual crowdsourcing, there remain at least two technical challenges. First, to maximize the quality of information (QoI), which measures the amount of information extracted from the collected data, the context of data collection (e.g., camera position and orientation) must be taken into account in the process of task allocation. Second, intensive data collection from dense measurement points is key to ensure timely and accurate sensing of the targets of interest, whereas there exists a trade-off between the amount and rate of data collection and the computing and communication resources required to fulfill the latency constraint. To solve these challenges, we propose gathering and processing the collected data at the edge of the network and design a context-aware task allocation scheme, called FlexSensing, to jointly optimize the QoI and processing latency. We target application scenarios where commercial vehicles are turned into vehicular fog nodes (VFNs). These nodes gather and process the visual data collected from other vehicles within their coverage areas. The key idea of FlexSensing is to determine the rate of data collection for each sensing vehicle in the targeted area and to assign processing tasks to VFNs based on the estimated QoI and the workload of the VFNs. Given the excessive computational complexity of task allocation in this context, we formulate task allocation as a Markov decision process and apply a deep Q-network (DQN) to learn the optimized task allocation strategies for increasing the QoI of collected data while reducing the processing latency. To evaluate the effectiveness of FlexSensing, we simulate the mobility of different vehicles involved in the scenario at different times of the day based on real-world traffic data collected from the city of Helsinki and select a real-time object detection application for a case study. As compared with the existing task allocation strategies, the DQN-based task allocation strategies reduce the average processing latency by up to 51% and increase the QoI of the collected data by up to 34%.