js-aruco icon indicating copy to clipboard operation
js-aruco copied to clipboard

6X6 improvement

Open truongva opened this issue 4 years ago • 2 comments

Nice work! Thank you so much for sharing.

I try with the original Aruco code and it worked perfectly. However when I try with 6x6 it not working. Can you help me to know how to make this work with 6x6?

The references : https://chev.me/arucogen/ Dictionary: 6x6(50,100,250,1000)

Thank you again!

truongva avatar Jan 08 '21 12:01 truongva

I am no an Author of this library but I am rewriting this library to Typescript, and probably latter I will try to compile with Assembly Script (Web Assembly). Currently I rewrite whole debug session but this have to be refactor, some of parts can be send to GPU and Fragment Shader, it will improve performance.

Regarding the 6x6 they are not supported yet, but I am working on it. So generally as you can see in debug.html it will recognize the couture for each marker but it not recognize it because bit matrix is not right, You can take look in this code here in aruco.js(ts):

  mat2id(bits: number[][]): number {
    let id = 0;

    for (let i = 0; i < 5; ++i) {
      id <<= 1;
      id |= bits[i][1];
      id <<= 1;
      id |= bits[i][3];
    }

    return id;
  }
  rotate(src: number[][]): number[][] {
    const dst = [];
    const len = src.length;

    for (let i = 0; i < len; ++i) {
      dst[i] = [];
      for (let j = 0; j < src[i].length; ++j) {
        dst[i][j] = src[src[i].length - j - 1][i];
      }
    }

    return dst;
  }

And this operation won't work in case of 6x6.

tosiek88 avatar Jan 09 '21 15:01 tosiek88

btw there is another repo https://github.com/damianofalcioni/js-aruco2/

tosiek88 avatar Jan 11 '21 19:01 tosiek88