Seems pretty simple - sonar/lidar devices that detect dangerous ship vectors, the bridge already had gates and traffic control from some of the pictures.

Probably cheaper to do, than even the loss of one or two containers off of that container ship. Never mind the cost in human lives.