Thresholding
After removing the background, we only have to binarize the image for future segmentation. We are going to do this with threshold. Threshold is a simple function that sets each pixel's values to a maximum value (255, for example). If the pixel's value is greater than the threshold value or if the pixel's value is lower than the threshold value, it will be set to a minimum (0):

Now, we are going to apply the threshold function using two different threshold values: we will use a 30 threshold value when we remove the light/background because all non-interesting regions are black. This is because we apply background removal. We will also a medium value threshold (140) when we do not use a light removal method, because we have a white background. This last option is used to allow us to check the results with and without background removal:
// Binarize image for segment Mat img_thr; if(method_light!=2){ threshold(img_no_light, img_thr, 30, 255, THRESH_BINARY); }else{ threshold(img_no_light, img_thr, 140, 255, THRESH_BINARY_INV); }
Now, we are going to continue with the most important part of our application: the segmentation. We are going to use two different approaches or algorithms here: connected components and find contours.
- 大數據可視化
- 文本挖掘:基于R語言的整潔工具
- 區塊鏈通俗讀本
- 數據要素五論:信息、權屬、價值、安全、交易
- 智能數據分析:入門、實戰與平臺構建
- 數字媒體交互設計(初級):Web產品交互設計方法與案例
- Hadoop集群與安全
- 大數據數學基礎(Python語言描述)
- 中文版Access 2007實例與操作
- 數據庫查詢優化器的藝術:原理解析與SQL性能優化
- Deep Learning with R for Beginners
- Swift Functional Programming(Second Edition)
- 掌中寶:電腦綜合應用技巧
- GameMaker Game Programming with GML
- 高效使用Redis:一書學透數據存儲與高可用集群