首页 > 其他分享 >读取shexiangtou问题点

读取shexiangtou问题点

时间:2023-02-19 21:22:58浏览次数:27  
标签:问题 const 读取 img QObject shexiangtou Camera include public

1、error: 'explict' does not name a type e

#ifndef CAMERA_H
#define CAMERA_H
#include <QImage>
#include <QDebug>
#include <QTimer>
#include <opencv2/opencv.hpp>
using namespace cv;
using namespace std;

class Camera :public QObject
{
public:
    explict Camera{QObject *parent=0};//错误定位至此处,去除explict 括号写成了大括号
    ~Camera();
private:
    VideoCapture *capture;
    QTimer *timer;
    QImage matToImage(const Mat&);


2、

E:\QTprogram\0215camere\camera.h:10: error: new types may not be defined in a return type
class Camera :public QObject

class Camera :public QObject //定位至此处  类Camera 末尾未加;
{
public:
     Camera(QObject *parent=0);
    ~Camera();
private:
    VideoCapture *capture;
    QTimer *timer;
    QImage matToImage(const Mat&);

 signals:
    void readyImage(const QImage&);

参照:现类的声明时没加“;” 

 class 类名
 {
      public:
     protected:

     private:
  } ---------这里没有“;”

 3、

E:\opencv3.4.0\OpenCV-MinGW-Build-OpenCV-3.4.5\include\opencv2\core\hal\interface.h:83: error: invalid use of member (did you forget the '&' ?)
#define CV_MAKETYPE(depth,cn) (CV_MAT_DEPTH(depth) + (((cn)-1) << CV_CN_SHIFT))
^

QImage Camera::matToImage(const Mat &img)
{
    if(img.type==CV_8UC3)  //img不是类, 是对象 后面调用类的成员函数 需要加() img.type()
    {

标签:问题,const,读取,img,QObject,shexiangtou,Camera,include,public
From: https://www.cnblogs.com/dq0618/p/17131615.html

相关文章