I wrote bellow code to read and show an image from a path in widows:
#include "SIFT.h"
#include <Windows.h>
#include <opencv2/opencv.hpp>
#include <opencv2/features2d.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/core/core.hpp>
int main(int argc, const char* argv[])
{
cv::Mat input = cv::imread("F:/Personal/1.jpg", IMREAD_COLOR);
if (input.empty()){
cout << "is empty";
getchar();
return -1;
}
namedWindow("Display window", WINDOW_AUTOSIZE);// Create a window for display.
imshow("Display window", input);
cv::waitKey(0);
//cv::Mat* m = &input;
//implementSIFT s(input, nullptr, nullptr, nullptr);
return 0;
}
But the image seems empty. What is correct path to read an image? Or Where is the problem from?
Correct path should be :
cv::Mat input = cv::imread("F:\\Personal/1.jpg", IMREAD_COLOR);