On most Android devices, the image taken by the camera is while the camera is in landscape mode. Unfortunately, we don’t know by simply loading the image what the orientation is when the image was taken. The easiest way to rectify the situation is to lock our application in landscape mode:
void setup() {
orientation(LANDSCAPE);
...
}
The opposite is portrait mode:
orientation(PORTRAIT);