Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть How to create your Optical Character Recognition (OCR) Android App and convert the text into speech?

  • Programmer World
  • 2020-04-11
  • 25815
How to create your Optical Character Recognition (OCR) Android App and convert the text into speech?
smartphonephonetextrecognizeimagepictureimage to textstringphotoreal imagereal lifefree hand textandroidoslayoutspeechsoundreadloudvoiceresultclassjavaappapplicationxmlconstraint layout
  • ok logo

Скачать How to create your Optical Character Recognition (OCR) Android App and convert the text into speech? бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно How to create your Optical Character Recognition (OCR) Android App and convert the text into speech? или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

  • Информация по загрузке:

Cкачать музыку How to create your Optical Character Recognition (OCR) Android App and convert the text into speech? бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео How to create your Optical Character Recognition (OCR) Android App and convert the text into speech?

This video shows how one can use google vision API (available from Play services) to implement the Optical Character Recognition in your Android App.

It uses TextRecognizer API from the google vision. To use this API the required libraries are implemented in the gradle (App) file. Once implemented in the gradle file, it makes the required APIs available in the Java code.

In layout, it creates a separate constraint layout for surface view. This surface view is used to project the camera focus area.

In the end, in this App, it also converts the read text into Speech using the TextToSpeech API.

In this video the App testing is shown in emulator. In the emulator, already there were 2 images created which read the text - "Hi, how are you?"

The details of this App development including the complete source code can be found at the below link:
https://programmerworld.co/android/ho...

This App is also hosted on the Google Play Store and can be found using the below link:
https://play.google.com/store/apps/de...


For any suggestions or queries, one can contact us at: https://programmerworld.co/contact/
or email at: [email protected]


Java Source code:

package com.example.ocr_opticalcharacterrecognition;

public class MainActivity extends AppCompatActivity {

private TextView textView;
private SurfaceView surfaceView;

private CameraSource cameraSource;
private TextRecognizer textRecognizer;

private TextToSpeech textToSpeech;
private String stringResult = null;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ActivityCompat.requestPermissions(this, new String[]{CAMERA}, PackageManager.PERMISSION_GRANTED);
textToSpeech = new TextToSpeech(this, new TextToSpeech.OnInitListener() {
@Override
public void onInit(int status) {
}
});
}

@Override
protected void onDestroy() {
super.onDestroy();
cameraSource.release();
}

private void textRecognizer(){
textRecognizer = new TextRecognizer.Builder(getApplicationContext()).build();
cameraSource = new CameraSource.Builder(getApplicationContext(), textRecognizer)
.setRequestedPreviewSize(1280, 1024)
.build();

surfaceView = findViewById(R.id.surfaceView);
surfaceView.getHolder().addCallback(new SurfaceHolder.Callback() {
@Override
public void surfaceCreated(SurfaceHolder holder) {
try {
cameraSource.start(surfaceView.getHolder());
} catch (IOException e) {
e.printStackTrace();
}
}

@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
}

@Override
public void surfaceDestroyed(SurfaceHolder holder) {
cameraSource.stop();
}
});


textRecognizer.setProcessor(new Detector.Processor ANGULAR_BRACKET TextBlock ANGULAR_BRACKET () {
@Override
public void release() {
}

@Override
public void receiveDetections(Detector.Detections ANGULAR_BRACKET TextBlock ANGULAR_BRACKET detections) {

SparseArray ANGULAR_BRACKET TextBlock ANGULAR_BRACKET sparseArray = detections.getDetectedItems();
StringBuilder stringBuilder = new StringBuilder();

for (int i = 0; i LESS_THAN sparseArray.size(); ++i){
TextBlock textBlock = sparseArray.valueAt(i);
if (textBlock != null && textBlock.getValue() !=null){
stringBuilder.append(textBlock.getValue() + " ");
}
}

final String stringText = stringBuilder.toString();

Handler handler = new Handler(Looper.getMainLooper());
handler.post(new Runnable() {
@Override
public void run() {
stringResult = stringText;
resultObtained();
}
});
}
});
}

private void resultObtained(){
setContentView(R.layout.activity_main);
textView = findViewById(R.id.textView);
textView.setText(stringResult);
textToSpeech.speak(stringResult, TextToSpeech.QUEUE_FLUSH, null, null);
}

public void buttonStart(View view){
setContentView(R.layout.surfaceview);
textRecognizer();
}
}

Комментарии

Информация по комментариям в разработке

Похожие видео

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]