public class OpenCVReader extends StackReader
Depending on whether the file-path is ASCII-encoded or not-ASCII encoded, this occurs via two different implementations.
The non-ASCII method seems to be approximately 4 times slower empirically.
See this Stack Overflow post for more details on the problem/
Note that when reading image metadata only, this is computionally slow, as the entire image must be loaded into memory to determine the width and height. Users are recommended to use another library for this purpose.
However, unlike many other libraries, OpenCV has the advantage of automatically correcting the orientation (to give correct widths and heights) where EXIF rotation information is present - but only for the ASCII-mathod.
Constructor and Description |
---|
OpenCVReader() |
Modifier and Type | Method and Description |
---|---|
void |
checkMisconfigured(BeanInstanceMap defaultInstances)
Checks that a bean's properties conform to expectations.
|
OpenedImageFile |
openFile(Path path,
ExecutionTimeRecorder executionTimeRecorder)
Opens a file containing one or more images.
|
readStack
describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
public void checkMisconfigured(BeanInstanceMap defaultInstances) throws BeanMisconfiguredException
AnchorBean
checkMisconfigured
in class AnchorBean<StackReader>
defaultInstances
- all available default instances if the DefaultInstance
annotation is usedBeanMisconfiguredException
- if the bean has not been configured properly as XMLpublic OpenedImageFile openFile(Path path, ExecutionTimeRecorder executionTimeRecorder) throws ImageIOException
StackReader
This method should run as computationally quicky as possible. Image voxels should not yet be read.
openFile
in class StackReader
path
- where the file is located.executionTimeRecorder
- records the execution-times of certain operations.ImageIOException
- if the file cannot be read.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.