quscope.image_processing.quantum_segmentation

Quantum image segmentation using Grover’s algorithm and amplitude amplification.

This module provides quantum algorithms for image segmentation tasks, including threshold-based, edge-based, and region-based segmentation. It implements Grover’s algorithm with custom oracles for different segmentation criteria and provides utilities for result interpretation and visualization.

Functions

apply_grovers_algorithm(circuit, oracle[, ...])

Apply Grover's algorithm for image segmentation.

calculate_optimal_iterations(marked_items, ...)

Calculate the optimal number of Grover iterations.

create_custom_oracle(circuit, oracle_function)

Create a custom oracle using a user-defined function.

create_edge_oracle(circuit, image_shape[, ...])

Create an oracle for edge-based segmentation.

create_pattern_oracle(circuit, target_pattern)

Create an oracle that marks specific target patterns.

create_region_oracle(circuit, seed_points, ...)

Create an oracle for region-based segmentation.

create_threshold_oracle(circuit, threshold)

Create an oracle for threshold-based segmentation.

interpret_results(result_counts, image_shape)

Interpret the results of quantum image segmentation.

optimize_circuit(circuit)

Optimize a quantum circuit for better performance.

segment_image(img_array[, method, ...])

Segment an image using quantum algorithms.

Classes

SegmentationMethod(value[, names, module, ...])

Enumeration of supported segmentation methods.

SegmentationResult(counts, original_shape, ...)

Class to store and analyze segmentation results.

Exceptions

OracleConstructionError

Exception raised when oracle construction fails.

SegmentationError

Base exception for segmentation errors.