error c4430: 缺少类型说明符 - 假定为 int。注意: c++ 不支持默认 int
场景:opencv error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int解决思路
opencv error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
#include <opencv2/core/core.hpp>
#include <opencv2/gpu/gpu.hpp>
#include "cv.h"
#include "highgui.h"
//using namespace cv;
main (int argc, char* argv[]){
CvCapture* capture = 0;
capture = cvCreateFileCapture(argv[1]);
if (! capture)
{
return -1;
}
IplImage *bgr_frame = cvQueryFrame(capture);
double fps = cvGetCaptureProperty(capture,CV_CAP_PROP_FPS);
CvSize size = cvSize((int)cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_WIDTH),(int)cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_HEIGHT));
CvVideoWriter *writer = cvCreateVideoWriter(argv[2],CV_FOURCC('M','J','P','G'),fps,size);
IplImage *logpolar_frame = cvCreateImage(size,IPL_DEPTH_8U,3);
while ((bgr_frame = cvQueryFrame (capture)) != NULL)
{
cvLogPolar(bgr_frame,logpolar_frame,cvPoint2D32f(bgr_frame->width/2,bgr_frame->height/2),40,CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS);
cvWriteFrame(writer,logpolar_frame);
}
cvReleaseVideoWriter(&writer);
cvReleaseImage(&logpolar_frame);
cvReleaseCapture(&capture);
return (0);
}
错误::::error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
------解决方案--------------------
main (int argc, char* argv[]) ----> int main (int argc, char* argv[])
opencv error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
#include <opencv2/core/core.hpp>
#include <opencv2/gpu/gpu.hpp>
#include "cv.h"
#include "highgui.h"
//using namespace cv;
main (int argc, char* argv[]){
CvCapture* capture = 0;
capture = cvCreateFileCapture(argv[1]);
if (! capture)
{
return -1;
}
IplImage *bgr_frame = cvQueryFrame(capture);
double fps = cvGetCaptureProperty(capture,CV_CAP_PROP_FPS);
CvSize size = cvSize((int)cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_WIDTH),(int)cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_HEIGHT));
CvVideoWriter *writer = cvCreateVideoWriter(argv[2],CV_FOURCC('M','J','P','G'),fps,size);
IplImage *logpolar_frame = cvCreateImage(size,IPL_DEPTH_8U,3);
while ((bgr_frame = cvQueryFrame (capture)) != NULL)
{
cvLogPolar(bgr_frame,logpolar_frame,cvPoint2D32f(bgr_frame->width/2,bgr_frame->height/2),40,CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS);
cvWriteFrame(writer,logpolar_frame);
}
cvReleaseVideoWriter(&writer);
cvReleaseImage(&logpolar_frame);
cvReleaseCapture(&capture);
return (0);
}
错误::::error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
------解决方案--------------------
main (int argc, char* argv[]) ----> int main (int argc, char* argv[])