This commit is contained in:
25
docs/snippets/rust/metadata/image_preprocessing.md
Normal file
25
docs/snippets/rust/metadata/image_preprocessing.md
Normal file
@@ -0,0 +1,25 @@
|
||||
```rust title="Rust"
|
||||
use kreuzberg::{ExtractionConfig, ImagePreprocessingConfig, OcrConfig, TesseractConfig};
|
||||
|
||||
fn main() {
|
||||
let config = ExtractionConfig {
|
||||
ocr: Some(OcrConfig {
|
||||
tesseract_config: Some(TesseractConfig {
|
||||
preprocessing: Some(ImagePreprocessingConfig {
|
||||
target_dpi: 300,
|
||||
denoise: true,
|
||||
deskew: true,
|
||||
contrast_enhance: true,
|
||||
binarization_method: "otsu".to_string(),
|
||||
..Default::default()
|
||||
}),
|
||||
..Default::default()
|
||||
}),
|
||||
..Default::default()
|
||||
}),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
println!("{:?}", config.ocr);
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user