import cv2

try:
    # Load the image in BGR format
    img = cv2.imread('image_1.jpg')

    # Convert the image to grayscale
    gray_img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

    # Apply a Gaussian blur
    blurred_img = cv2.GaussianBlur(gray_img, (7, 7), 0)

    # Save the processed image
    cv2.imwrite('blurred_image.jpg', blurred_img)
    print("Image processed and saved successfully.")

except cv2.error as e:
    print(f"OpenCV error: {e}")
except Exception as e:
    print(f"An error occurred: {e}")