Problems with Opencv in Qt Creator

Asked

Viewed 109 times

2

Program shows no error when build, but when running the code it displays the following message:

libopencv_core.so. 3.4: cannot open Shared Object file: No such file or directory

the file . pro is so:

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = Pixel_manipulation
TEMPLATE = app

INCLUDEPATH += /usr/local/include/opencv2
SOURCES += main.cpp\
    mainwindow.cpp

HEADERS  += mainwindow.h

FORMS    += mainwindow.ui

LIBS += -L/usr/local/lib/
LIBS += -lopencv_core
LIBS += -lopencv_highgui
LIBS += -lopencv_imgcodecs
LIBS += -lopencv_imgproc
LIBS += -lopencv_features2d
LIBS += -lopencv_calib3d
LIBS += -lz

The code I’m trying to execute:

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <opencv2/opencv.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>

using namespace cv;
using namespace std;
MainWindow::MainWindow(QWidget *parent) :
 QMainWindow(parent),
   ui(new Ui::MainWindow)
{
ui->setupUi(this);
Mat image;
image = imread("bolhas.jpeg",CV_LOAD_IMAGE_GRAYSCALE);
namedWindow( "Display window", WINDOW_AUTOSIZE );
  imshow("imagem",image);

}

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

I am using Ubuntu 14.04 and Opencv 3.3

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.