Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6702857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:06:09+00:00 2026-05-26T07:06:09+00:00

I am working on an app that reads QR codes and I need the

  • 0

I am working on an app that reads QR codes and I need the orientation of the code.
The ZXING source states that the orientation can be obtained from a hashtable ResultMetaData through the key ORIENTATION

Now, my issue is that the getResultMetaData() is not returning any results when I run the following:

orientation = (Integer) Returned[v].getResultMetadata().get("ORIENTATION");

However, the line directly above this,

points = Returned[v].getResultPoints();

Works just fine, so I know that the code is being read, and it is returning data.

Does anyone know of a fix for this or a different method of obtaining the orientation?

One last note: I am using QRCodeMultiReader which is why Returned is an array.

Thanks,
Zander

EDIT I just found that getResultMetaData only supports orientation for 1D barcodes, So I guess the questions is now: How do I get the orientation of a QR code?

EDIT #2 Here is the code to get the rotation (doesn’t support perspective)

ResultPoint a= points[1];
ResultPoint b= points[2];
ResultPoint c= points[0];
float distance = Math.abs(a.getX()-b.getX());
RectF rect = new RectF(a.getX(), a.getY(), a.getX()+distance, a.getY()+distance);
//Find the degree of the rotation that is needed
double z = Math.abs(a.getX()-b.getX());
double x = Math.abs(a.getY()-b.getY());
double theta = Math.atan(x/z);

if((b.getX()<a.getX())&&(b.getY()>a.getY())){//-+   
    theta=180-theta;
}else if((b.getX()<a.getX())&&(b.getY()<a.getY())){//--
    theta=180+theta;
}else if((b.getX()>a.getX())&&(b.getY()<a.getY())){ //+-
    theta=360-theta;
}
//theta stores the degree of rotation
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T07:06:10+00:00Added an answer on May 26, 2026 at 7:06 am

    Result has a getResultPoints method. That will return the locations of the finder patterns (the large black squares) in a QR code. Since those appear top-left, top-right, and bottom-left of the code, you can figure out the orientation that they describe. There are some static helper methods in the ResultPoint class.

    For an image with no perspective, the three points should describe an isosceles right triangle. If there is perspective, things get more complicated.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on an app that reads the contact names from the mobile
I'm working on an app that creates an user profile. I need to be
I'm working on an app that downloads meta tags from websites and saves then.
I've coded an node.js app that when get executed need to return CWD from
I'm working on an app that can be downloaded and, once the user runs
I'm working with an MVC2 app that had migrated from an MVC1 app quite
Ok. so I'm working on an app that retrieves items from a db and
I have a working Java app that can find the most recently created file
Im working on an app that now has to go to a URL online
I'm working on an app that works out debts and who owes what to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.