Ask Your Question

What is the method to retrieve text written vertically (in Japanese format) from png images using R?

asked 2021-12-16 11:00:00 +0000

djk gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-04-22 03:00:00 +0000

lalupa gravatar image

There are multiple ways to retrieve text written vertically (in Japanese format) from png images using R, but one possible method is to use OCR (Optical Character Recognition) software.

OCR software is designed to recognize and convert text within an image into a machine-readable format, such as a text file. To use OCR in R, the "tesseract" package can be installed (using the command "install.packages('tesseract')") and loaded ("library(tesseract)").

Once the package is loaded, the "ocr" function can be used to extract the text from the image. For example:

img <- image_read("path/to/image.png")
text <- ocr(img, engine = tesseract("jpn", options = list(page_orientation = "vertical")))

In this example, the "image_read" function loads the png image from the specified path, and the "ocr" function applies OCR to the image using the Japanese language ("jpn") and specifying the page orientation as vertical. The resulting text is stored in the "text" variable as a character vector.

Note that the accuracy of OCR may vary depending on the quality of the image and the complexity of the text. In some cases, pre-processing techniques such as image binarization and deskewing may be necessary to improve the OCR results.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer

Question Tools


Asked: 2021-12-16 11:00:00 +0000

Seen: 7 times

Last updated: Apr 22 '21