But, like I said, this all worked with OCV 2.4 and 3.4. My app depends on multi-threading. I’m sure there is something that changed that, once I find it, I can work around it.
The chrCameraBuffer1 is an unsigned char
unsigned char * chrCameraBuffer1;
Later today, when I get a chance, I will just to a loadImage into mTmpImage and see what happens. That might at least point to where the problem is. In the main thread I am doing a VideoCapture.read() so I guess that is at least one difference between what is happening here on this thread and the main frame.
Edit…the imread() of a jpg worked. So, the problem is in the chrCameraBuffer1. I’ll have to play with that and see which format works. Instead of the imread() I had also tried
mTmpImage.data = chrCameraBuffer1;
but that didn’t work either. The problem has to be in the chrCameraBuffer1. I’ll let you know what I find.
I swear that I originally had the line
mTmpImage.data = chrCameraBuffer1
and that didn’t work so that is why I changed it to imread() just to test that. I went to the docs for data and it said that it needed a pointer to a uchar and that is exactly what I had. So I put back the .data = line and now it works.
As I mentioned, I bunched up this code in one location to make debugging easier. I need now to go back to the original code to test again why it wasn’t working.
I should never trust myself at the end of a long day. Jeeeeze!
OK I am back to the original code that caused problems
If I put up some test code right before that
that works with testWindow. So I am back to my original question someplace else. I can get a handle to “cameraWindow” with
HWND hwCameraWindow = (HWND)FindWindow(NULL, _T(“cameraWindow”));
so the window is there plus I see the blank window on my screen as I debug. I can even do a new
right before the imshow(“cameraWindow” but that does not help.
So I guess the question is. Are there ways to check if a named window is good to show in before the imshow? Obviously something is wrong with this named window at this point ( a point at when OCV 2.4 and 3.4 had no problem with) but I have no way that I know of to check or fix the problem.