Unable to Get Result from DetectHorizonRequest - Result is nil

I am using Apple’s Vision framework with DetectHorizonRequest to detect the horizon in an image. Here is my code:

func processHorizonImage(_ ciImage: CIImage) async {
    let request = DetectHorizonRequest()
    do {
        let result = try await request.perform(on: ciImage)
        print(result)
    } catch {
        print(error)
    }
}

After calling the perform method, I am getting result as nil. To ensure the request's correctness, I have verified the following:

The input CIImage is valid and contains a visible horizon. No errors are being thrown. The relevant frameworks are properly imported. Given that my image contains a clear horizon, why am I still not getting any results? I would appreciate any help or suggestions to resolve this issue.

Thank you for your support!

This is the image

Unable to Get Result from DetectHorizonRequest - Result is nil
 
 
Q