An example of why expertise still matters even when using LLMs.

I am doing some work on estimating the complexity of segmentation borders. To do this, I calculate the gradient along the segmentation border using the Sobel operator (a convolution with an edge-detection kernel). This was mostly coded by Github Copilot. However, can you tell something is strange about the result on the right?

For some reason, the gradient in the bottom-left is missing. Turns out, you need to specify the output type for convolutions in OpenCV. Since the output type was unsigned int by default, all negative values of the result were removed. The way to fix this is to explicitly set the output type to `cv.CV_32F ` in the `cv.filter2D()` function.

Noticing and fixing this error is something almost no current LLM can do.