我正在使用ANN编写手写识别系统,但我遇到了一个问题: 我想分离扫描图像上的字符并获取每个图像的AABB(我不想绘制它的形象,但只计算此)计算图像上多个对象的AABB
可以认为字符只有黑色和背景只有白色(我已经写了已经阈值算法)
std::vector < unsigned char > px; // pixel data (RGBARGBARGBARGBA...)
unsigned w, h; // width and height of image
lodepng::decode(px, w, h, infile); // i use LodePNG to decode image
for(int i = 0; i < px.size(); i += 4)
{
unsigned char & r = px[ i ], & g = px[ i + 1 ], & b = px[ i + 2 ], & a = px[ i + 3 ];
// and what now?
}
lodepng::encode(outfile, px, w, h);
Image of problem(抱歉,但我还没有得到足够的代表张贴图像:()
什么是“AABB”? – MSalters 2014-09-22 09:39:36
[链接](http://en.wikipedia.org/wiki/Minimum_bounding_box) – kubawal 2014-09-22 09:41:57
Axis Aligned Bounding Box - ok。 – MSalters 2014-09-22 09:44:48