return ConvertImage.convert((GrayU8)input,(int)min,(int)max,numValues,output); } else if( type == ImageDataType.S8) { return ConvertImage.convert((GrayS8)input,(int)min,(int)max,numValues,output); } else if( type == ImageDataType.U16 ) { return ConvertImage.convert((GrayU16)input,(int)min,(int)max,numValues,output); } else if( type == ImageDataType.S16 ) { return ConvertImage.convert((GrayS16)input,(int)min,(int)max,numValues,output); } else if( type == ImageDataType.S32 ) { return ConvertImage.convert((GrayS32)input,(int)min,(int)max,numValues,output); } else if( type == ImageDataType.S64 ) { return ConvertImage.convert((GrayS64)input,(long)min,(long)max,numValues,output); } else if( type == ImageDataType.F32 ) { return ConvertImage.convert((GrayF32)input,(float)min,(float)max,numValues,output); } else if( type == ImageDataType.F64 ) { return ConvertImage.convert((GrayF64)input,min,max,numValues,output); } else { throw new IllegalArgumentException("Unknown image type: " + type);
public synchronized void update( final CirculantTracker tracker ) { if( hasSelected ) { RectangleLength2D_F32 r = tracker.getTargetLocation(); selected.x0 = (int)r.x0; selected.y0 = (int)r.y0; selected.x1 = selected.x0 + (int)r.width; selected.y1 = selected.y0 + (int)r.height; GrayF64 template = tracker.getTargetTemplate(); GrayF64 response = tracker.getResponse(); if( this.template == null ) { this.template = new BufferedImage(template.width,template.height,BufferedImage.TYPE_INT_RGB); this.response = new BufferedImage(template.width,template.height,BufferedImage.TYPE_INT_RGB); tmp.reshape(template.width,template.height); } ConvertImage.convert(template,tmp); PixelMath.plus(tmp, 0.5f, tmp); PixelMath.multiply(tmp,255,0,255,tmp); ConvertBufferedImage.convertTo(tmp,this.template,true); ConvertImage.convert(response,tmp); VisualizeImageData.colorizeSign(tmp,this.response,-1); } repaint(); }
@Override public void process(GrayU8 input) { ConvertImage.convert(input, grayF); PixelMath.divide(grayF,255.0f,grayF); dft.forward(grayF, transform); DiscreteFourierTransformOps.shiftZeroFrequency(transform, true); DiscreteFourierTransformOps.magnitude(transform, grayF); PixelMath.log(grayF,grayF); float max = ImageStatistics.maxAbs(grayF); PixelMath.multiply(grayF, 255f / max, grayF); ConvertBitmap.grayToBitmap(grayF, bitmap, bitmapTmp); } }
ConvertImage.convert(inputBinary,inputGray); PixelMath.multiply(inputGray,255,inputGray);