/** * Set the source (left) image */ public void setSource( GrayF32 image ) { locationSrc.clear(); locationDst.clear(); if( image == null ) { hasLeft = false; } else { hasLeft = true; graySrc.setTo(image); ConvertBitmap.grayToBitmap(image,bitmapSrc,storage); } }
/** * Set the destination (right) image */ public void setDestination( GrayF32 image ) { locationSrc.clear(); locationDst.clear(); if( image == null ) { hasRight = false; } else { hasRight = true; grayDst.setTo(image); ConvertBitmap.grayToBitmap(image,bitmapDst,storage); } }
/** * Provides an initial estimate for the flow by interpolating values from the previous layer. */ protected void interpolateFlowScale(int widthNew, int heightNew) { // warping isn't done until later so use those images as temporary storage GrayF32 enlargedU = warpDeriv2X; GrayF32 enlargedV = warpDeriv2Y; // use the previous low resolution flow estimate to initialize the new image interpolateFlowScale(flowU, enlargedU); interpolateFlowScale(flowV, enlargedV); flowU.reshape(widthNew, heightNew); flowV.reshape(widthNew, heightNew); // save the initial flow values flowU.setTo(enlargedU); flowV.setTo(enlargedV); }
@Override public void invert(GrayF32 transformed, GrayF32 original) { temp.reshape(transformed.width,transformed.height); copy.reshape(transformed.width,transformed.height); copy.setTo(transformed); WaveletTransformOps.inverseN(desc,copy,original,temp,numLevels,minPixelValue,maxPixelValue); }
public void setSource( GrayF32 image ) { distortedLeft.setTo(image); detDesc.detect(image); describeImage(listSrc, locationSrc); associate.setSource(listSrc); }
public void setDestination( GrayF32 image ) { distortedRight.setTo(image); detDesc.detect(image); describeImage(listDst, locationDst); associate.setDestination(listDst); }
/** * Provides an initial estimate for the flow by interpolating values from the previous layer. */ protected void interpolateFlowScale(int widthNew, int heightNew) { initFlowX.reshape(widthNew,heightNew); initFlowY.reshape(widthNew,heightNew); interpolateFlowScale(flowX, initFlowX); interpolateFlowScale(flowY, initFlowY); flowX.reshape(widthNew,heightNew); flowY.reshape(widthNew,heightNew); // init flow contains the initial estimate of the flow vector (if available) // flow contains the estimate for each iteration below flowX.setTo(initFlowX); flowY.setTo(initFlowY); }
@Override public GrayF32 transform(GrayF32 original, GrayF32 transformed) { if( transformed == null ) { ImageDimension d = UtilWavelet.transformDimension(original,numLevels); transformed = new GrayF32(d.width,d.height); } temp.reshape(transformed.width,transformed.height); copy.reshape(original.width,original.height); copy.setTo(original); WaveletTransformOps.transformN(desc,copy,transformed,temp,numLevels); return transformed; }
@Override public void processImage(int sourceID, long frameID, final BufferedImage buffered, ImageBase gray) { this.input = buffered; synchronized ( this ) { binary = ConvertBufferedImage.checkDeclare(gray.getWidth(), gray.getHeight(), binary, BufferedImage.TYPE_INT_RGB); grayPrev.setTo((GrayF32)gray); } try { processFrame(); } catch( RuntimeException e ) { e.printStackTrace(); UtilImageIO.saveImage(buffered,"crash_image.png"); } if( controlPanel instanceof DetectCalibrationPolygonPanel ) { DetectCalibrationPolygonPanel c = (DetectCalibrationPolygonPanel)controlPanel; c.polygonPanel.getThresholdPanel().updateHistogram(grayPrev); } else { if( controlPanel.threshold != null ) controlPanel.threshold.updateHistogram(grayPrev); } }
undistorter.apply(input,undistorted); } else { undistorted.setTo(input);
intensities[spaceIndex].setTo(detector.getIntensity());
to.setTo(from.getBand(0)); } else if( numBands == 3 ) { GrayF32 band0 = from.getBand(0);
input.setTo(output);
disparityMin = disparity.getDisparityAlg().getMinDisparity(); disparityMax = disparity.getDisparityAlg().getMaxDisparity(); disparityImage.setTo(disparity.getDisparity()); visualize.setMatches(disparity.getInliersPixel()); visualize.forgetSelection(); disparityMin = disparity.getDisparityAlg().getMinDisparity(); disparityMax = disparity.getDisparityAlg().getMaxDisparity(); disparityImage.setTo(disparity.getDisparity());
levelIn.setTo(levelOut); if( i > 1 ) { scale /= 2;