Git Product home page Git Product logo

simpleip's Introduction

SimpleIP (Simple Image-Processing) 是一个不想用matlab写图像处理作业的学生写的跨平台图像处理框架。

屏幕快照 2017-10-17 下午8.31.29

尚在测试中的即将加入的增强学习部分的 demo

屏幕快照 2017-10-17 下午8.31.29 屏幕快照 2017-10-17 下午8.31.29

尚在调试中的边缘识别

屏幕快照 2017-10-17 下午8.31.29

窗口

1. 新建窗口

OpenIP::Board* board = new OpenIP::Board("MyWindow",640,480,new OpenIP::ColorRGB(255,255,255));

2. 窗口事件绑定

 board->setEventHandling();

3. 窗口渲染

 board->run();

图片操作

1. 读取png图片为RGB矩阵std::vector<std::vector<ColorRGB*>>

 PNGLoader *pngloader = new PNGLoader();
        std::vector<std::vector<ColorRGB *>> pixelsMap = pngloader->loadPNG("yz.png");

2.读取图像到PixelMap

PixelMap* pixelMap = new PixelMap(0, 0, width, height, new ColorRGB(255, 255, 255));
        pngLoader->loadPNGToPixelMap("yz.png",pixelMap);

3. PixelMap 像素矩阵

PixelMap* pixelmap = new PixelMap(0, 0, this->width / 4, this->height / 2, new ColorRGB(255, 255, 255));

3. PixelMap像素矩阵像素填充

for (int i = 0; i < this->width / 4; i++) {
            std::vector<Pixel *> pp;
            for (int j = 0; j < this->height / 2; j++) {
                pp.push_back(new Pixel(i, j, pixelsMap[j][i]));
            }
            pixels.push_back(pp);
}
pixelmap->setPixelMap(pixels);
        

4. PixelMap像素矩阵标准化【根据窗口大小】

pixelmap->normalize(width, height);

图像处理

1. 图像滤波

中值滤波

Fliter* fliter = new Fliter(pixelMap);
        pixelMap = fliter->median();

最大值滤波

Fliter* fliter = new Fliter(pixelMap);
       pixelMap = fliter->max();

最小值滤波

Fliter* fliter = new Fliter(pixelMap);
        pixelMap = fliter->min();

算数均值滤波

Fliter* fliter = new Fliter(pixelMap);
        pixelMap = fliter->arithmetic_mean();

几何均值滤波

Fliter* fliter = new Fliter(pixelMap);
        pixelMap = fliter->geometric_mean();

谐波均值滤波

Fliter* fliter = new Fliter(pixelMap);
        pixelMap = fliter->harmonics();

逆波均值滤波

Fliter* fliter = new Fliter(pixelMap);
        pixelMap = fliter->inverse_harmonic();

字体

1. 字体渲染

初始化

Font* font = new Font("default.otf", FONT_MODE::TRANSPARENT,new ColorRGB(255,255,255), new ColorRGB(0,255,0), 500, 500,100, 200);

绘制

 font->draw("this is my font");
        font->normalize(width,height);

渲染

font->render();

simpleip's People

Contributors

nerososft avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

simedcn

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.