When upgrade to Ubuntu 18.04, some libraries are still needed for OpenCV 3.4 and others, but not provided by the new OS. We can install it like this:
sudo add-apt-repository “deb http://security.ubuntu.com/ubuntu xenial-security main”
sudo apt update
sudo apt install libjasper1 libjasper-dev