ivapylibs / puzzle_solver

1 stars 2 forks source link

Gridded: Solve exploded view #24

Closed pv33 closed 3 years ago

pv33 commented 3 years ago

One process that will be needed is to establish the correct locations of a puzzle from the exploded view plus a puzzle solving process. This requires going from the exploded state to the solved state one step at a time.

  1. take puzzle sketch template and create solution.
  2. explode the solution to give the current puzzle state
    • hopefully one corner piece does not change coordinates under explosion. preferably the (0,0) piece.
  3. solve each piece one at a time until the puzzle is done.
    • should be in some ordered manner. row-wise, column-wise, frontier expansion wise. pick one.

This part can be a hard coded script to do the process for now.

Later, there will be a plan generated to do the same. I will soon add an issue in another milestone for you to generate this plan and to eventually build up the simulator to parse the plan.

Personal notes for this are in the 2021 Fall W01 notes. First as a simple simulator then as a layered simulator that can have pieces disappear by moving to another layer temporarily. The simulator will work with atomic actions as encoded within a plan and therefore more explicitly encode turn-based and time-based operations. It will get us one step closer to a ROS version that does the same.

Uio96 commented 3 years ago
Uio96 commented 3 years ago

I double-checked my codes, and I have already used deepcopy before https://github.com/ivapylibs/puzzle_solver/blob/master/puzzle/builder/gridded.py#L162.

Uio96 commented 3 years ago

demo_simple_explod02

Uio96 commented 3 years ago

Now we can work on 60 pieces with some certain image covers (The image difference needs to be distinct) by the sift feature. Our edge color feature matching cannot work very well. Usually, it would have 8-12 failure cases of the 60 matches.

demo_simple_explode03