Package cz.vutbr.fit.layout.cormier
Class CormierProvider
- java.lang.Object
-
- cz.vutbr.fit.layout.impl.BaseService
-
- cz.vutbr.fit.layout.impl.BaseParametrizedOperation
-
- cz.vutbr.fit.layout.impl.BaseArtifactService
-
- cz.vutbr.fit.layout.cormier.CormierProvider
-
- All Implemented Interfaces:
ArtifactService,ParametrizedOperation,Service
public class CormierProvider extends BaseArtifactService
Provider of the Cormier web segmentation method implemented withinCormierSegmentation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCormierProvider.CormierParameterParameters of the algorithm provided by this service.
-
Constructor Summary
Constructors Constructor Description CormierProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AreaTreecreateAreaTree(byte[] imageData, org.eclipse.rdf4j.model.IRI iri)AreaTreecreateAreaTree(Page page)List<Parameter>defineParams()org.eclipse.rdf4j.model.IRIgetConsumes()StringgetDescription()floatgetEdgeProbabilityThreshold()intgetHalfWindowWidth()StringgetId()intgetMaxLineLength()intgetMinSegmentLength()intgetMonteCarloTrials()StringgetName()floatgetPriorEdgeProbability()org.eclipse.rdf4j.model.IRIgetProduces()X-Y tree represented via theAreaTreeinterface.intgetPyramidLevels()floatgetSignLineProbThreshold()floatgetStandardDeviation()Artifactprocess(Artifact input)voidsetEdgeProbabilityThreshold(float edgeProbabilityThreshold)voidsetHalfWindowWidth(int halfWindowWidth)voidsetMaxLineLength(int maxLineLength)voidsetMinSegmentLength(int minSegmentLength)voidsetMonteCarloTrials(int monteCarloTrials)voidsetPriorEdgeProbability(float priorEdgeProbability)voidsetPyramidLevels(int pyramidLevels)voidsetSignLineProbThreshold(float signLineProbThreshold)voidsetStandardDeviation(float standardDeviation)-
Methods inherited from class cz.vutbr.fit.layout.impl.BaseArtifactService
getCategory, toString
-
Methods inherited from class cz.vutbr.fit.layout.impl.BaseParametrizedOperation
getParam, getParams, getParamString, setParam
-
Methods inherited from class cz.vutbr.fit.layout.impl.BaseService
getServiceManager, setServiceManager
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface cz.vutbr.fit.layout.api.Service
setServiceManager
-
-
-
-
Method Detail
-
getId
public String getId()
-
getName
public String getName()
-
getDescription
public String getDescription()
-
defineParams
public List<Parameter> defineParams()
- Overrides:
defineParamsin classBaseParametrizedOperation
-
getHalfWindowWidth
public int getHalfWindowWidth()
- See Also:
EdgeDetector.getHalfWindowWidth()
-
setHalfWindowWidth
public void setHalfWindowWidth(int halfWindowWidth)
- See Also:
EdgeDetector.setHalfWindowWidth(int)
-
getStandardDeviation
public float getStandardDeviation()
- See Also:
EdgeDetector.getStandardDeviation()
-
setStandardDeviation
public void setStandardDeviation(float standardDeviation)
- See Also:
EdgeDetector.setStandardDeviation(float)
-
getPriorEdgeProbability
public float getPriorEdgeProbability()
- See Also:
EdgeDetector.getPriorProbability()
-
setPriorEdgeProbability
public void setPriorEdgeProbability(float priorEdgeProbability)
- See Also:
EdgeDetector.setPriorProbability(float)
-
getPyramidLevels
public int getPyramidLevels()
- See Also:
EdgeDetector.setPyramidLevels(int)
-
setPyramidLevels
public void setPyramidLevels(int pyramidLevels)
- See Also:
EdgeDetector.setPyramidLevels(int)
-
getMaxLineLength
public int getMaxLineLength()
- See Also:
LineDetector.getMaxLineLength()
-
setMaxLineLength
public void setMaxLineLength(int maxLineLength)
- See Also:
LineDetector.setMaxLineLength(int)
-
getEdgeProbabilityThreshold
public float getEdgeProbabilityThreshold()
-
setEdgeProbabilityThreshold
public void setEdgeProbabilityThreshold(float edgeProbabilityThreshold)
-
getMonteCarloTrials
public int getMonteCarloTrials()
- See Also:
LineDetector.getMonteCarloTrials()
-
setMonteCarloTrials
public void setMonteCarloTrials(int monteCarloTrials)
- See Also:
LineDetector.setMonteCarloTrials(int)
-
getMinSegmentLength
public int getMinSegmentLength()
- Returns:
- Minimum length of any side of each segment.
-
setMinSegmentLength
public void setMinSegmentLength(int minSegmentLength)
- Parameters:
minSegmentLength- Minimum length of any side of each segment.
-
getSignLineProbThreshold
public float getSignLineProbThreshold()
- Returns:
- Minimum probability that line is significant for it to be used for segmentation.
-
setSignLineProbThreshold
public void setSignLineProbThreshold(float signLineProbThreshold)
- Parameters:
signLineProbThreshold- Minimum probability that line is significant for it to be used for segmentation.
-
getConsumes
public org.eclipse.rdf4j.model.IRI getConsumes()
-
getProduces
public org.eclipse.rdf4j.model.IRI getProduces()
X-Y tree represented via theAreaTreeinterface.
-
process
public Artifact process(Artifact input) throws ServiceException
- Throws:
ServiceException
-
createAreaTree
public AreaTree createAreaTree(Page page) throws IOException
- Parameters:
page- Page on which the segmentation will be applied. Make sure it's possible to get a screenshot of it usingPage.getPngImage().- Returns:
- X-Y tree of segmentations created by the
CormierSegmentationwith this instance'sCormierProvider.CormierParameters' values. - Throws:
IOException- If failed to process the screenshot of the given page.
-
createAreaTree
public AreaTree createAreaTree(byte[] imageData, org.eclipse.rdf4j.model.IRI iri) throws IOException
- Parameters:
imageData- Screenshot of a page on which the segmentation will be applied.iri- IRI which will be assigned to the resultingAreaTree.- Returns:
- X-Y tree of segmentations created by the
CormierSegmentationwith this instance'sCormierProvider.CormierParameters' values. - Throws:
IOException- If failed to process the provided image data.
-
-