How to Detect Orientation of a Detected Barcode

Contents
[ ]
todo:image_alt_text
Figure: A rotated barcode
The barcode (rotated 270 degrees) recognized after executing the code that follows is shown in the figure below:
todo:image_alt_text
Figure: The detected orientation is 270 degree after example code execution
// Instantiate BarCodeReader object
BarCodeReader reader = new BarCodeReader("rotatedbarcode.jpg", DecodeType.CODE_128);
// read Code128 bar code
for (BarCodeResult result : reader.readBarCodes()) {
// detect bar code orientation
System.out.println("Rotaion Angle: " + result.getRegion().getAngle());
}