Skip to content
Snippets Groups Projects
Commit c5f43390 authored by Céline  TREBEAU's avatar Céline TREBEAU
Browse files

Encapsulation of code into a method for parallelization purposes

parent 312494dc
No related branches found
No related tags found
1 merge request!10Surface reconstruction Refactoring
......@@ -101,13 +101,20 @@ public class LocalOtsuClassification
for ( Interval interval : intervals )
{
IntervalView< T > viewSource = Views.offsetInterval( input, interval );
IntervalView< T > viewGrid = Views.offsetInterval( grid, interval );
T threshold = Otsu.getThreshold( viewSource );
viewGrid.forEach( pixel -> pixel.set( threshold ) );
computeLocalThreshold( input, grid , interval );
}
}
public static < T extends RealType< T > & NativeType< T > > void
computeLocalThreshold( Img< T > input, Img< T > grid , Interval interval )
{
IntervalView< T > viewSource = Views.offsetInterval( input, interval );
IntervalView< T > viewGrid = Views.offsetInterval( grid, interval );
T threshold = Otsu.getThreshold( viewSource );
viewGrid.forEach( pixel -> pixel.set( threshold ) );
}
/**
*
* @param input the input {@link Img}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment