1 | initial version |
I finally tracked this down.
Subsequent to the cvtColor call, but before my display function, I had a findContours call that I did not include in the code snippet above as I did not think it was relevant.
While it was a bit surprising, findContours alters the image it is working on. I would not have expected that but there is a note in the documentation on this.
Perhaps it makes sense to consider making this fact more prominent as this is not something that at least the lay person would suspect. Then again, maybe I am just a poor reader.
Once I ran findContours on a temporary copy of the image, everything worked correctly.