Class OpenCVReader
Object
AnchorBean<StackReader>
StackReader
OpenCVReader
public class OpenCVReader
extends StackReader
Reads a stack from the file-system using OpenCV.
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.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckMisconfigured(BeanInstanceMap defaultInstances) OpenedImageFileMethods inherited from class org.anchoranalysis.image.io.bean.stack.reader.StackReader
readStackMethods inherited from class org.anchoranalysis.bean.AnchorBean
describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
OpenCVReader
public OpenCVReader()
-
-
Method Details
-
checkMisconfigured
public void checkMisconfigured(BeanInstanceMap defaultInstances) throws BeanMisconfiguredException - Overrides:
checkMisconfiguredin classAnchorBean<StackReader>- Throws:
BeanMisconfiguredException
-
openFile
public OpenedImageFile openFile(Path path, ExecutionTimeRecorder executionTimeRecorder) throws ImageIOException - Specified by:
openFilein classStackReader- Throws:
ImageIOException
-