Skip to content

tottok-ug/ProjectOxfordJavaClient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Project Oxford Java Client

Project Oxford

How To Use

OxfordComputerVisionClient visionClient = new OxfordComputerVisionClient(new BasicOxfordCredentilas(
				"**********"));
		InputStream stream = getClass().getResourceAsStream("test.png");

		OCRRequest request = new OCRRequest();
		request.withDetectOrientation(true).withLanguage(Language.JAPANESE).withInputStream(stream);
		OCRResponse response = visionClient.recognizeText(request);
		if (response.getStatus() == 200) {
			Language language = response.getLanguage();
			int textAngle = response.getTextAngle();
			String orientation = response.getOrientation();
			List<Region> regions = response.getRegions();
			for (Region region : regions) {
				BoundingBox boundingBox = region.getBoundingBox();
				boundingBox.getMinX();
				boundingBox.getMinX();
				boundingBox.getWidth();
				boundingBox.getHeight();

				List<Line> lines = region.getLines();
				for (Line line : lines) {
					line.getBoundingBox();
					List<Word> words = line.getWords();
					for (Word word : words) {
						BoundingBox b = word.getBoundingBox();
						String text = word.getText();
					}
				}
			}
		}
		

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages