Why are there two peaks in FFT?
It's not two peaks, it's one peak, but an FFT is always mirror-symmetric. Only the first half is actually useful. Think of it this way: an FFT can't pick up signal data at more than half the sampling rate. When you try you get essentially garbage data that just so happens to be a mirrored refection of the "real" FFT.
What is peak detection algorithm?
A new automatic peak detection algorithm is developed and applied to histogram-based image data reduction (quantization). The algorithm uses a peak detection signal derived either from the image histogram or the cumulative distribution function to locate the peaks in the image histogram.