Struct subtile_ocr::Opt
source · pub struct Opt {
pub threshold: f32,
pub dpi: i32,
pub border: u32,
pub output: Option<PathBuf>,
pub tessdata_dir: Option<String>,
pub lang: String,
pub config: Vec<(Variable, String)>,
pub input: PathBuf,
pub dump: bool,
}Expand description
Handle application parameter from cli with Clap.
Fields§
§threshold: f32Threshold for subtitle image binarization.
Must be between 0.0 and 1.0. Only pixels with luminance above the threshold will be considered text pixels for OCR.
dpi: i32DPI of subtitle images.
This setting doesn’t strictly make sense for DVD subtitles, but it can influence Tesseract’s output.
border: u32Border in pixels to surround the each subtitle image for OCR.
This can have subtle effects on the quality of the OCR.
output: Option<PathBuf>Output subtitle file; stdout if not present.
tessdata_dir: Option<String>Path to Tesseract’s tessdata directory.
lang: StringThe Tesseract language(s) to use for OCR.
config: Vec<(Variable, String)>Set values for config variables.
This works like the tesseract command’s -c argument. One
particularly useful option is tessedit_char_blacklist=|\/_~` or
similar, to prevent the OCR from misidentifying characters as symbols
rarely used in subtitles.
input: PathBufSet the path of the file to process.
dump: boolDump processed subtitle images into the working directory as PNGs.
Trait Implementations§
source§impl CommandFactory for Opt
impl CommandFactory for Opt
source§impl FromArgMatches for Opt
impl FromArgMatches for Opt
source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches ) -> Result<Self, Error>
source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches ) -> Result<(), Error>
ArgMatches to self.source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches ) -> Result<(), Error>
ArgMatches to self.source§impl Parser for Opt
impl Parser for Opt
source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
Auto Trait Implementations§
impl Freeze for Opt
impl RefUnwindSafe for Opt
impl Send for Opt
impl Sync for Opt
impl Unpin for Opt
impl UnwindSafe for Opt
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more