我正在使用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