Slika tekst Finder za .NET
Претходни Чланак Истраживање слике за текст за .NET
Image Text Finder for .NET је плугин који омогућава програмерима да извлаче текст из слика у својим .НЕТ апликацијама. Овај водич ће вас проћи кроз карактеристике плагина и пружити примере кода о томе како га користити.
Подржани формати датотека
Image Text Finder za .NET podržava sledeće formate datoteke slike:
- БМП
- ЈПЕГ
- ПНГ
- ГИФ
- Тифф
Можете претражити текст у овим сличним датотекама користећи АПИ плагина.
Пронађите текст у сликама
To extract text from an image, you need to create an instance of the AsposeOcr
class and call the ImageHasText
method. Here is an example:
using Aspose.OCR;
AsposeOcr recognitionEngine = new AsposeOcr();
bool isFound = recognitionEngine.ImageHasText("sample1.png", "Aspose");
In this example, we open a file stream to the image file and pass it to the ImageHasText
method. The method returns if the text was found or not.
Пронађите не-англиски текст у сликама
To extract non-English text from an image, you need to create an instance of the ImageTextFinder
class and call the ExtractText
method. Here is an example:
using Aspose.OCR;
AsposeOcr recognitionEngine = new AsposeOcr();
RecognitionSettings settings = new RecognitionSettings(Language.Ara);
bool isFound = recognitionEngine.ImageHasText("sample1.png", "Aspose", settings);
In this example, we open a file stream to the image file and pass it to the ImageHasText
method. The method returns if the text was found or not.
Најбоља пракса
Овде су неке од најбољих пракси за коришћење Изображења текста за .NET:
- Уверите се да је слика датотека у подржаном формату.
- Користите исправно подешавање језика за текст на слици.
- Експериментирајте са различитим величинама шрифта како бисте побољшали прецизност екстракције.
- Управљајте грешкама и изузецима исправно како би се осигурало јако понашање апликације.