To manage the propagation of infectious diseases, particularly fast-spreading pandemics, it is necessary to provide information about possible infected places and individuals, however, it needs diagnostic tests and is time-consuming and expensive. To smooth these issues, and motivated by the current Coronavirus disease (COVID-19) pandemic, in this paper, we propose a learning-based system and a hidden Markov model (i) to assess hazardous places of a contagious disease, and (ii) to predict the probability of individuals’ infection. To this end, we track the trajectories of individuals in an environment. For evaluating the models and the approaches, we use the Covid-19 outbreak in an urban environment as a case study. Individuals in a closed population are explicitly represented by their movement trajectories over a period of time. The simulation results demonstrate that by adjusting the communicable disease parameters, the detector system and the predictor system are able to correctly assess the hazardous places and determine the infection possibility of individuals and cluster them accurately with high probability, i.e., on average more than 96%. In general, the proposed approaches to assessing hazardous places and predicting the infection possibility of individuals can be applied to contagious diseases by tailoring them to the influential features of the disease.