The function add to tree the last retrieved/substituted contour, releases temp_storage, restores state of dst_storage (if needed), and returns pointer to root of the contour tree */
| 1249 | releases temp_storage, restores state of dst_storage (if needed), and |
| 1250 | returns pointer to root of the contour tree */ |
| 1251 | CV_IMPL CvSeq * |
| 1252 | cvEndFindContours( CvContourScanner * _scanner ) |
| 1253 | { |
| 1254 | CvContourScanner scanner; |
| 1255 | CvSeq *first = 0; |
| 1256 | |
| 1257 | if( !_scanner ) |
| 1258 | CV_Error( CV_StsNullPtr, "" ); |
| 1259 | scanner = *_scanner; |
| 1260 | |
| 1261 | if( scanner ) |
| 1262 | { |
| 1263 | icvEndProcessContour( scanner ); |
| 1264 | |
| 1265 | if( scanner->storage1 != scanner->storage2 ) |
| 1266 | cvReleaseMemStorage( &(scanner->storage1) ); |
| 1267 | |
| 1268 | if( scanner->cinfo_storage ) |
| 1269 | cvReleaseMemStorage( &(scanner->cinfo_storage) ); |
| 1270 | |
| 1271 | first = scanner->frame.v_next; |
| 1272 | cvFree( _scanner ); |
| 1273 | } |
| 1274 | |
| 1275 | return first; |
| 1276 | } |
| 1277 | |
| 1278 | |
| 1279 | #define ICV_SINGLE 0 |
no test coverage detected