bpg编码器在ubuntu14.04上的配置

最近研究了下BPG编码器的安装编译:
分享下安装的辛酸历程

1.由于安装了anaconda的问题,默认Python始终为python3.6,改不回2.7.最后发现问题是要取消bashrc文件中的anaconda中的链接配置语句:

sudo gedit  ~/.bashrc
#注释掉anaconda的配置,注释如下图
source  ~/.bashrc#让修改生效

这里写图片描述

然后就可以按照下面链接的方法修改默认的python版本:
https://www.cnblogs.com/zl1991/p/9041554.html
这篇博客提供了4中方法,我用的是,采用update-alternatives 切换版本.

转换为Python2.7后,就可以使用sudo apt-get install XXX,来安装想安装的一些应用了.

2.BGP编码器的配置(参考的是google的解决方案)

sudo apt-get install -y libsdl-image1.2-dev libsdl1.2-dev libjpeg8-dev
sudo apt-get install --force-yes -y yasm#这句话是readme里面说要装的yasm
# download, configure, make and make install PNG 1.6 (You coul find a newer version like 1.16.18 for me)
#这里要下载libpng1.6.xx的库,自己到下面网址下载:
网址:
tar xf libpng-1.6.16.tar.xz
pushd libpng-1.6.16
./configure
make -j
sudo make install
#### The installation will take place in /usr/local by default and it's ok !
popd

# download, make and make install BPG
wget http://bellard.org/bpg/libbpg-0.9.6.tar.gz
tar xf libbpg-0.9.5.tar.gz
pushd libbpg-0.9.5

#### edit Makefile and insert the two following directive :
# "CFLAGS+=-I/usr/local/include" after the line CFLAGS+=-I.
# "LDFLAGS+=-L /usr/local/lib" before the line CFLAGS+=-g

make -j
sudo make install
popd
sudo ldconfig  # Required for bpgenc to find libpng16.

最后是3条最基本的使用指令:

1.显示bpg图片:
./bpgview 1.bpg
2.编码指令:
./bpgenc 1.jpg -o 1.bpg
3.解码指令:
./bpgdec 1.bpg -o 1.png

猜你喜欢

转载自blog.csdn.net/CV_YOU/article/details/82586122