1

I have a program in which I display a video feed in an OpenCV namedWindow(). The program allows me to click within the namedWindow, but if I try to move the window around on my desktop it triggers an error in convert.cpp reading

First-chance exception at 0x00D061A8 in AlcesSandboxApp.exe: 0xC0000005: Access violation reading location 0x44374050.

If there is a handler for this exception, the program may be safely continued.

Here is the line where I initialize the window:

        namedWindow(wndDisplay, WINDOW_AUTOSIZE);

I have also tried using WINDOW_NORMAL. How should I create a namedWindow that will tolerate being moved?

UPDATE: Additional Code

//Display the new image
while(true){
    //dispImg is a shared pointer that is updated in another thread.
    cv::applyColorMap(dispImg, colorMat, colorMap);
    imshow(wndDisplay, colorMat);
}
Community
  • 1
  • 1
stranger
  • 390
  • 4
  • 17
  • Not enough context to tell. Could you please post more of your code? – Jan Korous Jun 10 '16 at 20:28
  • I added some more code, but there really isn't a lot more to it than that. – stranger Jun 13 '16 at 17:36
  • Your code is clearly accessing memory it shouldn't and it is not clear from the code you've provided where might be the issue. – Jan Korous Jun 15 '16 at 21:44
  • I don't believe it's a memory issue. The program runs fine as long as I don't try to physically move the window around the screen. I think it's an issue with how the window is declared. Possibly moving the window also triggers a resize, and I'm not handling that? – stranger Jun 23 '16 at 14:34

1 Answers1

0

it may be for yor OpenCV configuration. Are you use 32bit or 64bit? Are you config Opencv depending on operating system and debug or release? The best test way is to compile an very very simple sample like this sample! like reading an image and showing it, if it works correctly, then check your code, if not check configuration steps by this link: Configuration steps

Community
  • 1
  • 1
opencv train
  • 29
  • 2
  • 13