Abstract:Gymnarchus niloticus, propelled by undulations of a long-based dorsal fin, is a typical representative of median and/or paired fin (MPF) fishes. Elongated-body theory (EBT) is one of the most effective theoretical models which can be applied to analyze the swimming performance of MPF fishes. This paper proposes an algorithm to detect the contour curve of undulations by the long-based dorsal fin, and furthermore the contour function is indeed a key factor in EBT. In this study, some videos are recorded when the specimen (which we name MPC-I) is freely swimming. We preprocess each frame of several selected video segments with a series of operations including rotation-calibrating, origin-matching, scale-regularizing as well as noise-reducing. Finally, the contour curve is fitted with a polynomial expression which is determined by a cluster of preprocessed undulation curve samples. The experimental results show that this algorithm is effective, and moreover the detected contour function is a good preparation for further analyses on the dorsal fin propulsion thrust and efficiency.