This article presents a novel in-X-ray-detector computing scheme based on CsPbBr3 single-crystal detectors, which offer convenient polarity reconfigurability, good linear dynamic range, and robust stability. The detector features a stable, trap-free structure and achieves a high linear dynamic range of 106 dB. It can perform edge extraction imaging with a data compression ratio of approximately 50% and is capable of pattern recognition tasks with 100% accuracy. The in-X-ray-detector computing approach addresses the challenges of data transmission and power consumption in conventional X-ray detection systems, making it a promising platform for intelligent X-ray imaging. The study demonstrates the potential of this technology in various applications, including security screening, medical imaging, and industrial flaw inspection.This article presents a novel in-X-ray-detector computing scheme based on CsPbBr3 single-crystal detectors, which offer convenient polarity reconfigurability, good linear dynamic range, and robust stability. The detector features a stable, trap-free structure and achieves a high linear dynamic range of 106 dB. It can perform edge extraction imaging with a data compression ratio of approximately 50% and is capable of pattern recognition tasks with 100% accuracy. The in-X-ray-detector computing approach addresses the challenges of data transmission and power consumption in conventional X-ray detection systems, making it a promising platform for intelligent X-ray imaging. The study demonstrates the potential of this technology in various applications, including security screening, medical imaging, and industrial flaw inspection.