17
votes

I want to install opencv in ubuntu 17.04 and I know that the jasper library is removed from ubuntu 17.04

what should I do to complete install opencv correctly ???

I tried used this two below command that showed here but it does not work

sudo apt-get install opencv-data

sudo apt-get install libopencv-dev

5

5 Answers

31
votes

Use these commands:

sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
sudo apt update
sudo apt install libjasper1 libjasper-dev
6
votes

Try this answer

You will be able to install the libjasper-dev from a previous release

1
votes

To build the latest version of libjasper as package for Ubuntu do the following:

Download the Jasper source code from here: https://github.com/jasper-software/jasper/tree/version-2.0.25

Run the following script:

#!/bin/bash

VERSION=2.0.25

unzip jasper-version-$VERSION.zip
cd jasper-version-$VERSION
mkdir compile

SOURCE_DIR=`pwd`
BUILD_DIR=compile
INSTALL_DIR=/usr
OPTIONS=

cmake -G "Unix Makefiles" -H$SOURCE_DIR -B$BUILD_DIR -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR $OPTIONS

cd compile
make clean all

cat >description-pak <<EOF
JasPer Image Processing/Coding Tool Kit
EOF

fakeroot checkinstall --fstrans --install=no --pkgname=libjasper --pkgversion=$VERSION --pkgrelease 1 --pkglicense="JasPer 2.0" \
         bash -c "make install" </dev/null

mv libjasper_$VERSION-1_amd64.deb ../..
cd ../..
rm -rf jasper-version-$VERSION

Result is a Debian package that can be installed using dpkg or apt.

0
votes

Under Ubuntu18.04, if you directly add-apt-repository will encounter another GPG error.

$ sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://dl.yarnpkg.com/debian stable InRelease: The following signatures were invalid: ...EXPKEYSIGhttps://dl.yarnpkg.com/debian/dists/stable/InRelease  The following signatures were invalid: EXPKEYSIG ...

You have to update the key

sudo apt-key adv --refresh-keys --keyserver keyserver.ubuntu.com

Then you are now safe to install libjasper-dev.

sudo apt-get install libjasper-dev

Reference

0
votes

This Solution was tested on mendel(debian) with arm64 architecture. If this works for Ubuntu is not clear.

Open terminal and run the following commands:

cd /etc/apt/sources.list.d
sudo nano multistrap-main.list

Add there these two lines:

deb http://ports.ubuntu.com/ubuntu-ports xenial-security main
deb http://ports.ubuntu.com/ubuntu-ports impish main

save and exit. Then run:

sudo apt update

If there is a key missing use the following and run again update:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <key>

Then install jasper:

sudo apt-get install libjasper-dev

Finally remove or comment out the added repositories from multistrap-main.list.