cv::Mat make VS 2017 Freeze when hovered

asked 2018-05-27 23:49:27 -0600

dEmz gravatar image

updated 2018-05-28 02:07:07 -0600

hey, I'm new to OpenCV, and i encountered with weird bug... somehow, when I hover the mouse to cv::Mat, my visual studio just go freeze. the only way I can fix it is either closed the program, is there any fix regarding this issue?

let me elaborate the problems more,

using namespace std;
using namespace cv;
int main()
{
    std::vector<uchar> array;
    enter code here
    Mat getImage = imread("image.jpg", CV_LOAD_IMAGE_GRAYSCALE);
    if (!getImage.data)
    {
        cout << "Could not open or find the image" << std::endl;
    }
    else
    {
        //imshow("Open an Image", getImage);

        if (getImage.isContinuous()) {
            array.assign(getImage.datastart, getImage.dataend);
        }
        else {
            for (int i = 0; i < getImage.rows; ++i) {
                array.insert(array.end(), getImage.ptr<uchar>(i), getImage.ptr<uchar>(i) + getImage.cols);
            }
        }
    }
    cvWaitKey(0);
    destroyAllWindows();

the problem occur when I hover my mouse to "Mat" from "Mat getImage"

i'm using visual studio 2017

edit retag flag offensive close merge delete

Comments

It is not an opencv bug but a problem with your install : check https://www.google.com/search?q=vs201.... I use VS2017 (communauty or enterprise) and there is no problem

LBerger gravatar imageLBerger ( 2018-05-28 01:26:59 -0600 )edit

@LBerger thanks for responding my question, but so far i didn't have this problem until I installed OpenCV, I work on .net on same VS2017 before, and it's work fine. Is there any way other than reinstalling VS2017?

dEmz gravatar imagedEmz ( 2018-05-28 01:44:51 -0600 )edit

How did you install opencv? If you use git clone try to disable git inside VS2017

LBerger gravatar imageLBerger ( 2018-05-28 02:48:39 -0600 )edit

@LBerger by downloading from https://opencv.org/releases.html, then adding the instalation path to windows environtment, and add include folder, linker, and so on. I can run the code just fine, and the opencv show fine, but only when i hover to Mat the VS is Hang.

I search it online, kinda like this problem https://developercommunity.visualstud... and https://stackoverflow.com/questions/5... thanks

dEmz gravatar imagedEmz ( 2018-05-28 03:24:14 -0600 )edit

Have you try Andrew T answer?

LBerger gravatar imageLBerger ( 2018-05-28 03:36:47 -0600 )edit

@LBerger yep i tried, it's work, but the downside i can't see the tool tip anymore >.< just want to share if it's was a bug here or on the VS2017 side. (i just found about the 1st link after posting it here though)

dEmz gravatar imagedEmz ( 2018-05-28 03:47:30 -0600 )edit

try to wait 5 minutes database need to be update

LBerger gravatar imageLBerger ( 2018-05-28 03:56:08 -0600 )edit