Skip to content

fansity/puzzle

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

基于 hsv 的马赛克拼图效果


知乎链接:利用爬虫技术能做到哪些很酷很有趣很有用的事情?



一、安装环境  


use python3(若同时装有python2,以下命令均加前缀 python3 -m 如:)


python3 -m pip install Scrapy

1.安装 Scrapy 爬虫框架 (install Scrapy)


pip install Scrapy

windows 安装可以 点击此处
推荐使用 wheel 来安装 opencv 点击此处

2.安装 numpy 科学计算库 (install numpy)


pip install numpy

3.安装 Pillow 图像处理库 (install Pillow)


pip install Pillow

推荐使用 wheel 来安装 Pillow 点击此处



二、使用 puzzle 生成拼图 (use puzzle.py create mosaik puzzle)


爬取图片(catch images)


Scrapy crawl images or run catchImage.bat

创建拼图图片 (create puzzle image)


python puzzle.py -i test.jpg -d D:/acg/acg/img/ -o output/ or run start.bat

命令行参数(Command line parameters)


  • -s -- save 已经存在output文件夹已经有马赛克图片,快速生成图片 Created faster when there have mosaik pictures
  • -i -- input 原始图片路径 input image path
  • -d -- database 爬虫图片数据集 your image database
  • -o -- output 马赛克图标生成路径 output mosaik pictures path
  • -is -os 输入(马赛克块)/ 输出(生成图) 图片尺寸 input size / output size
  • -r --repate(int) 重复(建议在图片集少的时候设置) mosaik repate (When image is not enough)



test.jpg

image

output jpg

image

About

Mosaic puzzle by hsv

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.4%
  • Batchfile 0.6%