using IronOcr;// Instantiate IronTesseractIronTesseract ocrTesseract = new IronTesseract();// Add imageusing var imageInput = new OcrImageInput("paragraph_skewed.png");// Rotate the image 180 degrees clockwiseimageInput.Rotate(180);// Export the modified imageimageInput.SaveAsImages("rotate");
using IronOcr;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Add image
using var imageInput = new OcrImageInput("paragraph_skewed.png");
// Rotate the image 180 degrees clockwise
imageInput.Rotate(180);
// Export the modified image
imageInput.SaveAsImages("rotate");
ImportsIronOcr' Instantiate IronTesseractDim ocrTesseract As New IronTesseract()' Add imageUsing imageInput = New OcrImageInput("paragraph_skewed.png") ' Rotate the image 180 degrees clockwise imageInput.Rotate(180) ' Export the modified image imageInput.SaveAsImages("rotate")EndUsing
Imports IronOcr
' Instantiate IronTesseract
Dim ocrTesseract As New IronTesseract()
' Add image
Using imageInput = New OcrImageInput("paragraph_skewed.png")
' Rotate the image 180 degrees clockwise
imageInput.Rotate(180)
' Export the modified image
imageInput.SaveAsImages("rotate")
End Using
using IronOcr;// Instantiate IronTesseractIronTesseract ocrTesseract = new IronTesseract();// Add imageusing var imageInput = new OcrImageInput("paragraph_skewed.png");// Rotate the image 180 degrees clockwiseimageInput.Rotate(180);// Export the modified imageimageInput.SaveAsImages("rotate");
using IronOcr;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Add image
using var imageInput = new OcrImageInput("paragraph_skewed.png");
// Rotate the image 180 degrees clockwise
imageInput.Rotate(180);
// Export the modified image
imageInput.SaveAsImages("rotate");
ImportsIronOcr' Instantiate IronTesseractDim ocrTesseract As New IronTesseract()' Add imageUsing imageInput = New OcrImageInput("paragraph_skewed.png") ' Rotate the image 180 degrees clockwise imageInput.Rotate(180) ' Export the modified image imageInput.SaveAsImages("rotate")EndUsing
Imports IronOcr
' Instantiate IronTesseract
Dim ocrTesseract As New IronTesseract()
' Add image
Using imageInput = New OcrImageInput("paragraph_skewed.png")
' Rotate the image 180 degrees clockwise
imageInput.Rotate(180)
' Export the modified image
imageInput.SaveAsImages("rotate")
End Using
using IronOcr;// Instantiate IronTesseractIronTesseract ocrTesseract = new IronTesseract();// Add imageusing var imageInput = new OcrImageInput("paragraph_skewed.png");// Rotate the image 180 degrees clockwiseimageInput.Rotate(180);// Export the modified imageimageInput.SaveAsImages("rotate");
using IronOcr;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Add image
using var imageInput = new OcrImageInput("paragraph_skewed.png");
// Rotate the image 180 degrees clockwise
imageInput.Rotate(180);
// Export the modified image
imageInput.SaveAsImages("rotate");
ImportsIronOcr' Instantiate IronTesseractDim ocrTesseract As New IronTesseract()' Add imageUsing imageInput = New OcrImageInput("paragraph_skewed.png") ' Rotate the image 180 degrees clockwise imageInput.Rotate(180) ' Export the modified image imageInput.SaveAsImages("rotate")EndUsing
Imports IronOcr
' Instantiate IronTesseract
Dim ocrTesseract As New IronTesseract()
' Add image
Using imageInput = New OcrImageInput("paragraph_skewed.png")
' Rotate the image 180 degrees clockwise
imageInput.Rotate(180)
' Export the modified image
imageInput.SaveAsImages("rotate")
End Using
/* :path=/static-assets/ocr/content-code-examples/how-to/image-orientation-correction-combined.cs */using IronOcr;// Create OCR engine with optimized configurationIronTesseract ocrTesseract = new IronTesseract();// Load and process image with all correctionsusing var imageInput = new OcrImageInput("skewed_document.png");// Apply corrections in optimal sequenceimageInput .Rotate(90) // Fix major orientation .Deskew(15) // Correct minor tilts .Scale(150, true); // Enhance for OCR// Perform OCR on corrected imageOcrResult result = ocrTesseract.Read(imageInput);// Access extracted textstring extractedText = result.Text;
/* :path=/static-assets/ocr/content-code-examples/how-to/image-orientation-correction-combined.cs */
using IronOcr;
// Create OCR engine with optimized configuration
IronTesseract ocrTesseract = new IronTesseract();
// Load and process image with all corrections
using var imageInput = new OcrImageInput("skewed_document.png");
// Apply corrections in optimal sequence
imageInput
.Rotate(90) // Fix major orientation
.Deskew(15) // Correct minor tilts
.Scale(150, true); // Enhance for OCR
// Perform OCR on corrected image
OcrResult result = ocrTesseract.Read(imageInput);
// Access extracted text
string extractedText = result.Text;
ImportsIronOcr' Create OCR engine with optimized configurationDim ocrTesseract As New IronTesseract()' Load and process image with all correctionsUsing imageInput As New OcrImageInput("skewed_document.png") ' Apply corrections in optimal sequence imageInput _ .Rotate(90) _ ' Fix major orientation .Deskew(15) _ ' Correct minor tilts .Scale(150, True) ' Enhance for OCR ' Perform OCR on corrected image Dim result AsOcrResult = ocrTesseract.Read(imageInput) ' Access extracted text Dim extractedText AsString = result.TextEndUsing
Imports IronOcr
' Create OCR engine with optimized configuration
Dim ocrTesseract As New IronTesseract()
' Load and process image with all corrections
Using imageInput As New OcrImageInput("skewed_document.png")
' Apply corrections in optimal sequence
imageInput _
.Rotate(90) _ ' Fix major orientation
.Deskew(15) _ ' Correct minor tilts
.Scale(150, True) ' Enhance for OCR
' Perform OCR on corrected image
Dim result As OcrResult = ocrTesseract.Read(imageInput)
' Access extracted text
Dim extractedText As String = result.Text
End Using
What are the best practices for combining image corrections in IronOCR?
For optimal results, apply corrections in the order: first, use rotation for major orientation issues; second, deskew to fine-tune alignment; lastly, apply scaling to standardize dimensions for consistent OCR processing.
How can I automate the detection of page orientation in IronOCR?
IronOCR's DetectPageOrientation method automatically determines the correct image orientation through text analysis, streamlining the preprocessing workflow and improving OCR accuracy.
Can IronOCR handle multi-page documents with different orientations?
Yes, IronOCR can process multi-page documents with various orientations by applying rotation, deskewing, and scaling corrections to each page, ensuring consistent OCR results across the entire document.
What additional preprocessing can enhance OCR results in IronOCR?
Beyond orientation correction, applying color correction, quality filters, and computer vision techniques can further improve OCR results. IronOCR also supports async operations for batch processing efficiency.
How can I export corrected images or OCR results using IronOCR?
Corrected images can be exported using the SaveAsImages method, while OCR results can be saved as searchable PDFs, hOCR HTML for web integration, or PDF streams for cloud storage.