/** * Changes the type of image the camera frame is converted to */ protected void setImageType( ImageType type , ColorFormat colorFormat ) { synchronized (boofImage.imageLock){ boofImage.colorFormat = colorFormat; if( !boofImage.imageType.isSameType( type ) ) { boofImage.imageType = type; boofImage.stackImages.clear(); } synchronized (lockTiming) { totalConverted = 0; periodConvert.reset(); } } }
/** * @see ThresholdBlockOtsu */ public InputToBinarySwitch(InputToBinary alg, Class<T> inputType) { this.alg = alg; this.inputType = ImageType.single(inputType); if( !alg.getInputType().isSameType(this.inputType)) { work = (ImageGray)alg.getInputType().createImage(1,1); } }
/** * Internal function which manages images and invokes {@link #processImage}. */ private void processImageOuter( ImageBase image ) { long startTime = System.currentTimeMillis(); // this image is owned by only this process and no other. So no need to lock it while // processing processImage(image); // If an old image finished being processes after a more recent one it won't be visualized if( !visualizeOnlyMostRecent || startTime > timeOfLastUpdated ) { timeOfLastUpdated = startTime; // Copy this frame renderBitmapImage(bitmapMode,image); // Update the visualization runOnUiThread(() -> displayView.invalidate()); } // Put the image into the stack if the image type has not changed synchronized (boofImage.imageLock) { if( boofImage.imageType.isSameType(image.getImageType())) boofImage.stackImages.add(image); } }
throw new RuntimeException("Process is not thread safe but the pool is larger than 1!"); if( processor.getImageType().isSameType(image.getImageType())) { long before = System.nanoTime(); try {