2010-11-18 31 views

回答

0

怎麼樣在this鏈接的僞代碼。

它是這樣的:

for each row in image left to right 
    for each column in image top to bottom 
     if(pixel is in region){ 
     set pixel to 1 + minimum value of the north east neighbours 
     }else{ 
     set pixel to zero 
     } 
    } 
    } 

    for each row right to left 
    for each column bottom to top 
     if(pixel is in region){ 
     set pixel to min(value of the pixel,1 + minimum value of the south west neighbours) 
     }else{ 
     set pixel to zero 
     } 
    } 
    } 
0

所以這是我目前用於BLOB提取的草火的修改版本。它需要數字化(圖像已被修改,使所有值都是1或0),並返回最大的邊界框向量。代碼相當長,但在src/cvLib.cpp文件中的https://github.com/bstadt/JHU-Robotics-compVis的公開回購庫中。另外請注意,邊界框是我自己寫的一個類,所以你也需要這個類。它的源代碼位於src文件夾中,頭文件位於include目錄中,因此一定要抓住這兩者。