Camera filter in real time

Is it possible to make a filter in the camera?
My objective is to use the image to text recognizer…

so i want the user to point the camera and the API recognize the text… but not in all the photo, only in a specific area…

exemple: WhatsApp web

can someone just point to the right direction? how to make this filter and get the filtered image
many thanks.