| 90 | } |
| 91 | |
| 92 | void GraphCut::addFaces( FaceBitSet source, FaceBitSet sink ) |
| 93 | { |
| 94 | MR_TIMER; |
| 95 | assert( !filled_[Left].intersects( filled_[Right] ) ); |
| 96 | |
| 97 | // ignore faces marked simultaneously as source and sink |
| 98 | const auto bothLabels = source & sink; |
| 99 | source -= bothLabels; |
| 100 | sink -= bothLabels; |
| 101 | |
| 102 | // do not change already filled faces |
| 103 | const auto alreadyFilled = filled_[Left] | filled_[Right]; |
| 104 | source -= alreadyFilled; |
| 105 | sink -= alreadyFilled; |
| 106 | |
| 107 | for ( auto f : source ) |
| 108 | active_[Left].push_back( f ); |
| 109 | |
| 110 | for ( auto f : sink ) |
| 111 | active_[Right].push_back( f ); |
| 112 | |
| 113 | filled_[Left] |= source; |
| 114 | filled_[Right] |= sink; |
| 115 | |
| 116 | assert( !filled_[Left].intersects( filled_[Right] ) ); |
| 117 | } |
| 118 | |
| 119 | FaceBitSet GraphCut::fillLeft( const ProgressCallback& progress ) |
| 120 | { |
no test coverage detected