Skip to content

Commit

Permalink
Create 3d-reconstruction.js
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Jul 22, 2024
1 parent 49940b7 commit 8da1f97
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions app/3d-reconstruction.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import * as cv from 'opencv.js';

class Realtime3DReconstruction {
constructor() {
this.orb = new cv.ORB();
this.bruteForceMatcher = new cv.BruteForceMatcher();
}

async reconstruct3D(imageStream) {
const frames = [];
for (let i = 0; i < 10; i++) {
const frame = await imageStream.read();
frames.push(frame);
}
const points3D = this.orb.reconstruct3D(frames);
return points3D;
}
}

export default Realtime3DReconstruction;

0 comments on commit 8da1f97

Please sign in to comment.