How can I develop an object detection system that counts the number of objects and determines their position in an image?
If you want to get experience, you should probably start with some easier task. Object detection and localization are relatively hard and writing a neural network and image processing pipeline from scratch will take you a long time.
If you want to build up an intuition about how NN's work, you might want to code some simple task from scratch. This is an example.
When you got some intuition about how NN's work, then you should proceed to your task. In here, you have a similar question and answer provided. The current state-of-the-art approach for your task would probably be point 3, that is object detection network, like YOLO or Faster-RCNN.