  The classical image segmentation algorithm based on local adaptive threshold
can effectively segment images with uneven illumination, but with the increase
of the image data, the real-time problem gradually emerges. In this paper, a
quantum segmentation algorithm based on local adaptive threshold for NEQR image
is proposed, which can use quantum mechanism to simultaneously compute local
thresholds for all pixels in a gray-scale image and quickly segment the image
into a binary image. In addition, several quantum circuit units, including
median calculation, quantum binarization, etc. are designed in detail, and then
a complete quantum circuit is designed to segment NEQR images by using fewer
qubits and quantum gates. For a $2^n\times 2^n$ image with q gray-scale levels,
the complexity of our algorithm can be reduced to $O(n^2+q)$, which is an
exponential speedup compared to the classic counterparts. Finally, the
experiment is conducted on IBM Q to show the feasibility of our algorithm in
the noisy intermediate-scale quantum (NISQ) era.
