Quantum Image Segmentation Based on Grayscale Morphology

Wenjie Liu, Lu Wang, Mengmeng CuiarXiv 2023 · DOI

Abstract

Image segmentation is a fundamental task in computer vision, often complicated by uneven illumination in real-world scenes. This paper proposes a quantum algorithm for image segmentation based on grayscale morphology. By leveraging the Novel Enhanced Quantum Representation (NEQR) and developing optimized quantum circuits for morphological operations like dilation and erosion, the algorithm achieves an exponential speedup of $O(n^2 + q)$ compared to classical methods. The feasibility of the approach is demonstrated through simulations on the IBM Q platform, highlighting its potential for the Noisy Intermediate-Scale Quantum (NISQ) era.

Introduction

Image segmentation involves partitioning a digital image into multiple segments to simplify its representation and facilitate analysis. While classical grayscale morphology is highly effective at handling images with inconsistent lighting, the computational cost grows exponentially with image resolution. Previous quantum approaches often relied on global thresholds, which fail in the presence of shadows or varying brightness levels.

Comparison of standard binarization versus morphological bottom-hat transformation for images with uneven lighting.

As shown in Figure 3, standard binarization struggles to extract clear features from images with uneven backgrounds. This paper addresses this by implementing quantum versions of Top-hat and Bottom-hat transformations, which "flatten" the background and allow for robust segmentation even under poor lighting conditions.

Methodology

The proposed framework is built upon the Novel Enhanced Quantum Representation (NEQR) model. NEQR encodes both the spatial position and the grayscale intensity of pixels into a quantum state.

The NEQR model representing a 2x2 grayscale image using quantum states for position and intensity.

Quantum Circuit Design

To implement morphological operations efficiently, the authors designed several specialized quantum units:

  1. Optimized Quantum Comparator: A circuit that compares binary qubit sequences with minimal auxiliary qubits and gate depth.
  2. Quantum Subtractor: Performs bit-by-bit subtraction, a prerequisite for calculating morphological gradients.
  3. Cycle Shift Transformation (CT): Enables the algorithm to shift the entire image in four cardinal directions, allowing simultaneous access to neighboring pixel values through quantum superposition.

Morphological Operations

By integrating these units, the algorithm performs dilation (local maxima) and erosion (local minima) across the entire image state simultaneously. These operations form the basis for Top-hat and Bottom-hat transforms, which isolate targets by subtracting the background extracted via morphological filtering.

Results and Discussion

The primary advantage of the proposed quantum algorithm is its theoretical efficiency. For an image of size $2^n \times 2^n$ with $q$ grayscale levels, the complexity is $O(n^2 + q)$, a significant improvement over the classical $O(2^{2n})$.

Hardware Feasibility

The algorithm was validated using the ibm_qasm_simulator. Tests on $4 \times 4$ grayscale images produced probability histograms that matched theoretical expectations, proving the functional correctness of the designed circuits. Furthermore, the optimized comparator reduces the resource burden, requiring only 3 auxiliary qubits and a gate cost of $18n - 3$, making it more suitable for NISQ-era hardware than previous designs.

Conclusion

This research provides a robust, lighting-aware tool for quantum image segmentation. While current hardware limitations prevent the processing of high-resolution images, the exponential speedup and reduced circuit complexity offer a promising path forward. Future work will explore adaptive structure elements and the impact of physical quantum noise on deep morphological circuits.

Summary updated

BibTeX
@misc{liu2023quantum,
  author = {Wenjie Liu and Lu Wang and Mengmeng Cui},
  title = {{Quantum Image Segmentation Based on Grayscale Morphology}},
  year = {2023},
  eprint = {2311.11952},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.11952},
}
Figure