Results 1 to 3 of 3

Thread: linking with opencv

  1. #1
    Join Date
    Feb 2013
    Posts
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default linking with opencv

    hi friends,

    i am new to Qt and opencv, i am developing gui application for image loading
    i have done this process in my .pro

    #-------------------------------------------------
    #
    # Project created by QtCreator 2013-02-26T12:00:38
    #
    #-------------------------------------------------

    QT += core gui

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = MyGuiAPP1
    TEMPLATE = app


    SOURCES += main.cpp\
    mainwindow.cpp

    HEADERS += mainwindow.h

    FORMS += mainwindow.ui

    INCLUDEPATH+= C:\opencv243\build\include
    LIBS+= -LC:\opencv243\build\x86\vc10\lib\
    -lopencv_features2d243
    -lopencv_highgui243
    -lopencv_calib3d243
    -lopencv_core243


    and i am getting error


    D:\QTPROJS\MyGuiAPP1\mainwindow.cpp:22: error: C2374: 'image' : redefinition; multiple initialization

    D:\QTPROJS\MyGuiAPP1\mainwindow.cpp:21: see declaration of 'image'


    Thanks and help me
    karuna

  2. #2
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Thanks
    75
    Thanked 24 Times in 21 Posts
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: linking with opencv

    Can u post mainwindow.cpp?

  3. #3
    Join Date
    Feb 2013
    Posts
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: linking with opencv

    Hai ,

    this is my mainwindow.cpp

    mainwindow.cpp



    #include "mainwindow.h"
    #include "ui_mainwindow.h"



    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    ui->setupUi(this);
    }

    MainWindow::~MainWindow()
    {
    delete ui;
    }

    void MainWindow:n_pushButton_clicked()
    {
    QString fileName = QFileDialog::getOpenFileName(this,tr("OpenImage"), ".",
    tr("Image Files(*.png*.jpg*.jpeg*.bmp)"));
    image=cv::imread(fileName.toStdString().data());
    //image= cv::imread("C:/Users/image procesing2/Desktop/snapshots/test_001.jpg");
    cv::namedWindow("Original Image");
    cv::imshow("Original Image", image);
    }

    void MainWindow:n_pushButton_2_clicked()
    {
    /* cv::flip(image,image,1);
    cv::namedWindow("output Image");
    cv::imshow("Output Image",image);*/

    }

    Thanking you

    hai
    this is mainwindow.cpp

    #include "mainwindow.h"
    #include "ui_mainwindow.h"



    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    ui->setupUi(this);
    }

    MainWindow::~MainWindow()
    {
    delete ui;
    }

    void MainWindow:n_pushButton_clicked()
    {
    QString fileName = QFileDialog::getOpenFileName(this,tr("OpenImage"), ".",
    tr("Image Files(*.png*.jpg*.jpeg*.bmp)"));
    image=cv::imread(fileName.toStdString().data());
    //image= cv::imread("C:/Users/image procesing2/Desktop/snapshots/test_001.jpg");
    cv::namedWindow("Original Image");
    cv::imshow("Original Image", image);
    }

    void MainWindow:n_pushButton_2_clicked()
    {
    /* cv::flip(image,image,1);
    cv::namedWindow("output Image");
    cv::imshow("Output Image",image);*/

    }
    thanking you
    Last edited by karuna; 27th February 2013 at 11:22. Reason: spelling corrections

Similar Threads

  1. [OpenCV] Linking problem
    By danioto in forum Newbie
    Replies: 3
    Last Post: 1st November 2012, 01:33
  2. Replies: 3
    Last Post: 7th February 2012, 10:40
  3. Linking Error Qt OpenCV
    By Songi in forum Installation and Deployment
    Replies: 4
    Last Post: 28th August 2011, 04:03
  4. Trying to use OpenCV
    By danilodsp in forum Newbie
    Replies: 6
    Last Post: 18th August 2011, 08:41
  5. Linking NokiaQT with OpenCV
    By tan88122 in forum Newbie
    Replies: 1
    Last Post: 14th March 2011, 07:16

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.