GithubHelp home page GithubHelp logo

puzzle's Introduction

基于 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

puzzle's People

Contributors

noisywinds avatar zhangxuri avatar

Watchers

James Cloos avatar sciw avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.