When I invoke the drawKeypoints function and I reuse the output Mat in imShow I get an exception. When I comment out drawKeypoints or just rename the output array it resolves the problem but I can’t use the output array with the rest of the program. I’ve narrowed it down to the output array of the drawKeypoints output array - or so I believe.
So this works fine:
Mat im_with_keypoints
..
ReadIMage
{
...
rawImage = BytestoMat(frameData->pu8ImageData, cameraCfg.u32Width, cameraCfg.u32Height);
im_with_keypoints = rawImage;
//drawKeypoints(rawImage, keypoints, im_with_keypoints, Scalar(0, 0, 255), DrawMatchesFlags::DRAW_RICH_KEYPOINTS);
}
...
Main
{
...
if (im_with_keypoints.data == NULL)
{
cout << "No image found! Check path." << endl;
//return 1;//ERROR
}
else
{
imshow("TEST--+", im_with_keypoints);
//cvui::image(frame, 455, 25, target_still); //525, 500// <----here
waitKey(1);//without this image won't be shown
}
im_with_keypoints above appears only in those places above that are shown, throughout the program.
This throws the exception, when I enter the drawKeypoints command:
drawKeypoints(rawImage, keypoints, im_with_keypoints, Scalar(0, 0, 255), DrawMatchesFlags::DRAW_RICH_KEYPOINTS);
Mat im_with_keypoints
..
ReadIMage
{
...
rawImage = BytestoMat(frameData->pu8ImageData, cameraCfg.u32Width, cameraCfg.u32Height);
im_with_keypoints = rawImage;
*drawKeypoints(rawImage, keypoints, im_with_keypoints, Scalar(0, 0, 255), DrawMatchesFlags::DRAW_RICH_KEYPOINTS);*
...
}
Main
{
...
if (im_with_keypoints.data == NULL)
{
cout << "No image found! Check path." << endl;
//return 1;//ERROR
}
else
{
imshow("TEST--+", im_with_keypoints);
//cvui::image(frame, 455, 25, target_still); //525, 500// <----here
waitKey(1); //without this image won't be shown
}
Introduction of the 2nd array by drawKeypoints causes an exception with im_show below it but doesn’t without it.
I’ve tried researching the nature of the output array in drawKeypoints and different ways of defining the matrix but to no avail.