I would like to run the following sample program using OpenCV 4.0.0 and VisualStudio c++, line 33
CV_WINDOW_AUTOSIZE | CV_WINDOW_FREERATIO
The identifier "CV_WINDOW_AUTOSIZE" "CV_WINDOW_FREERATIO" is not defined.
appears with an error.I tried typing cv_
and looked for something similar in the predictive transformation. Do I need to do something else to use the cv::namedWindow
user interface?
Can't I use this version?Also, please let me know if there is a code with the same meaning.
#include<iostream>
# include<opencv2/imgproc/imgproc.hpp>
# include <opencv2/highgui/highgui.hpp>
# if defined_DEBUG
# define CV_EXT "d.lib"
# else
# define CV_EXT ".lib"
#endif
# pragma comment (lib, "opencv_core2413" CV_EXT)
# pragma comment (lib, "opencv_imgproc2413" CV_EXT)
# pragma comment (lib, "opencv_highgui2413" CV_EXT)
int main()
{
cv::Mat srcImg=cv::imread("lenna.jpg");
if(srcImg.empty())
return1;
cv::namedWindow("image", CV_WINDOW_AUTOSIZE | CV_WINDOW_FREERATIO);
cv::imshow("image", srcImg);
cv::waitKey();
return 0;
}
CV_WINDOW_AUTOSIZE
is the C API for the C language, where cv:WINDOW_AUTOSIZE
© 2024 OneMinuteCode. All rights reserved.