How to choose good features for my machine vision application?
The choice of the algorithm is dependent on the constraints of the application. If you are able to collect (or find) thousands of labeled images covering many possible scenarios, then the popular approach would be to train a deep neural network for semantic segmentation (sidewalk, road, car and etc.). The features are learnt and are not hand-crafted. There are many packages such as Tensorflow or Torch for doing this, as well as trained models. This is one of the technologies powering autonomous driving these days. 

If you would need a faster solution and do not have the resources to invest in such data collection, then I would say it is still doable because roads and sidewalks can look very different (depends which sidewalks of course). As the texture of the two classes will be quite dissimilar, I would say that any classical algorithm, capable of capturing texture features could do a decent job. If we are thinking of using OpenCV, then I would immediately try with a HoG (histogram of oriented gradients) + SVM (support vector machines) pair to extract features and classify, respectively. There is already an OpenCV demo (link 1, link 2) for performing object detection in a similar way. Similarly, one could do a sliding HoG extraction + binary classification in order to do a segmentation. 

Of course one needs to gather some amount of data for both approaches, but I would say much less for the second one. Rough estimation is difficult, as I haven't seen your sidewalks or roads and cannot predict the variation in the data.