How to get coordinates(x(time),y(frequency)) of spectral peaks from spectrogram?
Under the hood, your spectrogram consists of multiple, consecutive FFT frames (of length N) and each FFT frame contains N/2 frequency bins (even if you have N frequency bins, the upper part is discarded).

An FFT frame denotes a temporal position from the beginning of a signal and this temporal position can be computed as

time_pos = frame_number *  N / sampling_rate; //frame_number runs from 0......N-1


As an example, if your signal is sampled at 8000 Hz and N is 1024, the 10th frame will be at 10 * 1024 / 8000  = 1.28 sec from the beginning of the signal.

Just like every FFT frame has a fixed length (N samples long), each frequency bin has a fixed width in Hz (frequency resolution). This frequency resolution is given by the sampling rate divided by the frame/fft length so

freq_res = sampling_rate / N;


In order to find the frequency for a particular bin, simply multiply the bin index by the frequency resolution.

freq_10bin = 10 * freq_res;


In order to get the coordinates of the spectral peaks, you should iterate through all the frames and find those bins that have a value above some threshold thus indicating a peak.
The frame indexes and bin indexes respectively are then used to compute the temporal and frequency coordinates for every peak (and the corresponding displacements).