ivapylibs / puzzle_solver

1 stars 2 forks source link

Map board :: Initial to Desired position #33

Closed aevela closed 2 years ago

aevela commented 2 years ago

A wrapper to call task optimizer to solve puzzles.

Requires mapping of board instance from x_o (initial x,y position) to x_d (desired x,y position) of the puzzle pieces.

Uio96 commented 2 years ago

Dear Prof. Adan Vela,

I have added an interface for your code stuff: https://github.com/ivapylibs/puzzle_solver/blob/master/puzzle/solver/simple.py#L277-L293. See the comments for more details.

I also added a test script for you: https://github.com/ivapylibs/puzzle_solver/blob/master/puzzle/simulator/testing/60pRotateSolverNewPlan_basic.py.

The basic idea is to simulate an exploded puzzle board then solve it according to a plan. Currently, the simulator will execute all the actions in one step. So if everything goes well, you should see an assembled board from the exploded one after the execution. The board may be with rotated pieces, which can be changed here https://github.com/ivapylibs/puzzle_solver/blob/master/puzzle/simulator/testing/60pRotateSolverNewPlan_basic.py#L18.

Other details: The position is defined as the top-left corner of the bounding box for a puzzle piece (after rotation correction). We follow the OpenCV's style that x represents column coordinate while y represents row coordinate.

aevela commented 2 years ago

Hi, do puzzle pieces have a unique id?

Uio96 commented 2 years ago

yep

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: aevela @.> Sent: Wednesday, November 3, 2021 2:30:06 AM To: ivapylibs/puzzle_solver @.> Cc: Lin, Yunzhi @.>; Comment @.> Subject: Re: [ivapylibs/puzzle_solver] Map board :: Initial to Desired position (Issue #33)

Hi, do puzzle pieces have a unique id?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/ivapylibs/puzzle_solver/issues/33#issuecomment-958684271, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADDZ4KO3UB6B5GVOVTWNGR3UKDQH5ANCNFSM5HGXEGWQ.

aevela commented 2 years ago

Okay -- I created a small package that can be used. It can be downloaded here: https://github.com/ADCLab/puzzleSolvers

aevela commented 2 years ago

That is incredibly cool! Great job.

Uio96 commented 2 years ago

That is incredibly cool! Great job.

Thanks, I just fixed a bug and updated the plot: 60pRotateSolverNewPlan