Skip to content

Instantly share code, notes, and snippets.

@AlexJoz
Last active November 29, 2015 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexJoz/b04af9f8bbde1c6eee63 to your computer and use it in GitHub Desktop.
Save AlexJoz/b04af9f8bbde1c6eee63 to your computer and use it in GitHub Desktop.
Transform 2D to 1D array coordinates, where x - col and y - row
// transform (x,y) to 1D
// where x - colomn, y - row (for CV applications or picture filtering)
//this.x = picture.width();
private int p(int x, int y) {
return y * this.x + x + 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment