Misc 自动拼图 CTF | 您所在的位置:网站首页 › 在线拼图照片怎么拼图 › Misc 自动拼图 CTF |
Misc 自动拼图
需要使用python遗传算法脚本gaps和拼图脚本montage
安装montage
不同linux环境下的安装命令
1. \#Debian
2. apt-get install graphicsmagick-imagemagick-compat
3.
4. \#Ubuntu
5. apt-get install graphicsmagick-imagemagick-compat
6.
7. \#Alpine
8. apk add imagemagick6
9.
10. \#Arch Linux
11. pacman -S imagemagick6
12.
13. \#Kali Linux
14. apt-get install graphicsmagick-imagemagick-compat
15.
16. \#Raspbian
17. apt-get install graphicsmagick-imagemagick-compat
18.
19. \#Docker
20. docker run cmd.cat/montage montage
安装gaps
$ git clone https://github.com/nemanja-m/gaps.git #gaps官网
$ cd gaps
$ pip install -r requirements.txt #这一行代码经常行会出错,推测由于所包含的库为旧版无法安装,下面给出解决方案
$ sudo apt-get install python-tk
$ pip install -e . #验证安装是否成功,但可以不执行
如果$ pip install -r requirements.txt 出现错误,则要手动安装numpy 、opencv-python 、matplotlib 、pytest 、 pillow,并将对应的库的版本在requirements.txt上修改
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple numpy
#加入镜像源速度更快,分别安装**numpy 、opencv-python 、matplotlib 、pytest 、 pillow**
vim requirements.txt #并非一定是以下版本号
以ctf中的一道训练题puzzle为例 如果图片为碎片状,根据总数确定拼块长宽数量,并用montage进行第一次拼接补充:gaps各参数的作用 –image 指向拼图的路径 –size 拼图块的像素尺寸 –generations 遗传算法的代的数量 –population 个体数量 –verbose 每一代训练结束后展示最佳结果 –save 将拼图还原为图像 总结最有挑战性的地方莫过于安装gaps和对gaps参数的把握,特别是sized的计算,需要先使图片的拼块恰好为像素最大的一条边的正方形,size=该边长像素。另外,pip和python库要提前安装完毕 引用链接 https://blog.csdn.net/m0_47643893/article/details/113778577 https://blog.csdn.net/qq_45836474/article/details/105353690 https://blog.csdn.net/fjh1997/article/details/107585782 https://github.com/nemanja-m/gaps https://commandnotfound.cn/linux/1/493/montage-%E5%91%BD%E4%BB%A4 |
CopyRight 2018-2019 实验室设备网 版权所有 |