Concern about the health of people who traveled on board was raised in the COVID-19 outbreak on the Diamond Princess cruise ship. The ship narrow space offers an environment conducive to the virus spread. Close contact isolation remains one of the most important current measures to stop the rapid spread of the virus. Contacts can be identified efficiently by detecting smart devices nearby. The smartphone Bluetooth RSSI signal is significant data for positioning. The traditional indoor positioning algorithm cannot be directly applied in the mobile ship environment. It is necessary to study the indoor positioning algorithm which applies to the mobile ship environment. In this paper, we propose an in-ship localization algorithm, which can achieve indoor positioning without the fingerprint map, with an RMSE of 1.63 m.