@Override public void handleAlgorithmChange() { alg = FactoryDistort.deformMls(control.getConfigMLS()); p2p.setTransform(alg); alg.setImageShape(undistorted.width,undistorted.height); controlPointsModified(); }
@Override public void processImage(int sourceID, long frameID, BufferedImage buffered, final ImageBase undistorted) { // do this here instead of a reshape to ensure the number of bands is the same distorted = (T)undistorted.createSameShape(); BufferedImage tmp = distortedBuff; distortedBuff = ConvertBufferedImage.checkDeclare( undistorted.width,undistorted.height,distortedBuff,buffered.getType()); if( tmp != distortedBuff ) { distorted.reshape(undistorted.width, undistorted.height); this.undistorted.reshape(undistorted.width, undistorted.height); gui.setPreferredSize(new Dimension(undistorted.width,undistorted.height)); alg.setImageShape(undistorted.width,undistorted.height); synchronized (pointsUndistorted){ validTransform = false; pointsUndistorted.clear(); pointsDistorted.clear(); } } if( inputMethod == InputMethod.IMAGE ) { this.undistorted.setTo((T)undistorted); } renderDistorted(buffered, (T)undistorted); }