Optical neural networks (ONNs) exhibit significant potential for accelerating artificial intelligence task processing due to their low latency, high bandwidth, and parallel processing capabilities. Photonic crystals (PhCs) are extensively utilized in integrated optoelectronics because of their unique photonic bandgap properties and precise control of light waves. In this study, we propose an optical reconfigurable convolutional kernel based on PhCs. This kernel can perform convolutional operations on weights by constructing a PhC weight bank. The convolutional kernel demonstrates exceptional performance within the developed optical convolutional neural network framework, successfully realizing various image edge processing tasks. It achieves blind recognition accuracies of 97.81% for the MNIST dataset and 80.31% for the Fashion-MNIST dataset. This study not only demonstrates the feasibility of constructing optical neural networks based on PhCs but to our knowledge, also offers new avenues for the future development of optical computing.