Effective analysis helps players evaluate their performance, make necessary adjustments, and develop diverse game strategies. Moreover, the analysis provides viewers with different perspectives, enhancing their understanding of the game. This study aims to develop a basketball player detection and analysis system to assist in analyzing on-court situations. The system uses perspective transformation to obtain player tracking information on the top view image in basketball games. The system uses a modified you only look once (YOLO) v5 model that replaces the backbone of YOLOv5s with the MobileNetv3-small architecture for player detection. Compared to the original YOLOv5, the modified YOLOv5 reduces parameters from 7.02 × 106 to 3.5 × 106, a decrease of 49.8%. The number of frames obtainable per second increases from 12.4 to 17.5, an improvement of about 41.1%. Finally, the system performs perspective transformation and tracks the detected player positions onto the top-view court image using the YOLOv5 model.