Java 类sun.awt.Mutex 实例源码

项目:symVision    文件:ParticleFlowTracker.java   
public ParticleFlowTracker(IParticleConstructorDestructor<ParticleType> particleConstructorDestructor, Vector2d<Integer> imageSize, int imageDownscaleFactor, Mutex particleMutex) {
    this.particleConstructorDestructor = particleConstructorDestructor;
    this.imageDownscaleFactor = imageDownscaleFactor;
    this.imageSize = imageSize;
    this.particleMutex = particleMutex;

    denseFlow =
    //              FactoryDenseOpticalFlow.flowKlt(null, 6, ImageFloat32.class, null);
    //              FactoryDenseOpticalFlow.region(null,ImageFloat32.class);
    //              FactoryDenseOpticalFlow.hornSchunck(20, 1000, ImageFloat32.class);
    //              FactoryDenseOpticalFlow.hornSchunckPyramid(null,ImageFloat32.class);
    FactoryDenseOpticalFlow.broxWarping(null, ImageFloat32.class);


    // scaled down because the flow is computational expensive
    previous = new ImageFloat32(imageSize.x/imageDownscaleFactor, imageSize.y/imageDownscaleFactor);
    current = new ImageFloat32(imageSize.x/imageDownscaleFactor, imageSize.y/imageDownscaleFactor);

    flow = new ImageFlow(previous.width, previous.height);

    final int spatialAccelerationCellsX = 500;
    final int spatialAccelerationCellsY = 300;
    trackingParticleAcceleration = new SpatialAcceleration<>(spatialAccelerationCellsX, spatialAccelerationCellsY, (float)imageSize.x, (float)imageSize.y );

    setupSamplePositions();
}