diff --git a/Book_Reader.py b/Book_Reader.py new file mode 100644 index 0000000..996dac0 --- /dev/null +++ b/Book_Reader.py @@ -0,0 +1,29 @@ +import cv2 # pip install opencv-python +import pytesseract #open the url:- https://medium.com/@marioruizgonzalez.mx/how-install-tesseract-orc-and-pytesseract-on-windows-68f011ad8b9b#:~:text=How%20install%20Tesseract%20%E2%80%94%20ORC%20and%20Pytesseract%20on,in%20your%20path%3F%20...%204%20Functionality%20test.%20?msclkid=b450aef2a9bc11eca0586aca2ea2f8fa +import speech_recognition as sr # pip install speechRecognition +import pyttsx3 # pip install pyttsx3 +import time +def speak(str): + engine = pyttsx3.init() + engine.say(str) + engine.runAndWait() +def book_read(): + pytesseract.pytesseract.tesseract_cmd='C:\\Program Files\\Tesseract-OCR\\tesseract.exe' + frameWidth = 640 + frameHeight = 480 + cap = cv2.VideoCapture(0) + cap.set(3, frameWidth) + cap.set(4, frameHeight) + cap.set(10, 150) + + while True: + success, img = cap.read() + cv2.imshow("Result", img) + if cv2.waitKey(1) & 0xFF == ord('q'): + img1 = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) + cv2.imshow("Result1", img1) + print(img1) + print(pytesseract.image_to_string(img1)+"hello") + speak(pytesseract.image_to_string(img1)) +book_read() + diff --git a/PA.py b/PA.py index 15ff913..3cb5f28 100644 --- a/PA.py +++ b/PA.py @@ -26,10 +26,16 @@ import winshell as winshell # pip install winshell from geopy.geocoders import Nominatim # pip install geopy and pip install geocoder from geopy import distance + +import cv2 # pip install opencv-python +import pytesseract #open the url:- https://medium.com/@marioruizgonzalez.mx/how-install-tesseract-orc-and-pytesseract-on-windows-68f011ad8b9b#:~:text=How%20install%20Tesseract%20%E2%80%94%20ORC%20and%20Pytesseract%20on,in%20your%20path%3F%20...%204%20Functionality%20test.%20?msclkid=b450aef2a9bc11eca0586aca2ea2f8fa +import Book_Reader + import turtle # pip install turtle import random # pip install random import snake_game # user-defined + engine = pyttsx3.init() def fun_talk(audio): @@ -122,7 +128,11 @@ def get_command(): "Programs\\Eclipse\\Eclipse IDE for Java Developers - 2020-06") elif 'open notepad' in query: - os.startfile("C:\\Windows\\notepad.exe") + + os.startfile("C:\\Users\\91954\\AppData\\Roaming\\Microsoft\\Windows\\" + "Start Menu\\Programs\\Accessories\\Notepad") + elif 'read book' in query: + Book_Reader.book_read() elif 'open pycharm' in query: os.startfile("C:\\Program Files\\JetBrains\\PyCharm Community Edition 2020.1.1\\bin\\pycharm64.exe")