anhtuduong / UR5LegoVision

Vision-Based Lego Detection, Localization, and Assembly Using UR5 Robot Arm
MIT License
16 stars 1 forks source link

Image as input #33

Open anhtuduong opened 9 months ago

anhtuduong commented 9 months ago

Steps for Simple Image-Based Analysis:

1. Preprocessing:

2. Block Detection:

3. Matching Algorithm:

4. Hierarchical Assembly Interpretation:

5. Planning Robotic Actions:

6. Testing and Validation:

7. Iterative Refinement:

Example Approach:

For instance, if the outline represents a 3-level castle with a 5x1, 3x1, and 1x1 block:

Considerations:

While this method aims for precision without machine learning or 3D understanding, it requires robust image processing and shape-matching algorithms to accurately interpret the outline and infer the assembly sequence. Testing with various outlines and refining the algorithm iteratively will be crucial to achieving reliable results.

anhtuduong commented 9 months ago

Template matching:

References: https://docs.opencv.org/3.4/d4/dc6/tutorial_py_template_matching.html https://pyimagesearch.com/2015/01/26/multi-scale-template-matching-using-python-opencv/ https://docs.opencv.org/4.x/dc/dc3/tutorial_py_matcher.html https://stackoverflow.com/questions/4761940/opencv-template-matching-and-transparency https://answers.opencv.org/question/16535/alpha-dependent-template-matching/ https://stackoverflow.com/questions/4761940/opencv-template-matching-and-transparency https://github.com/opencv/opencv/issues/4837 https://stackoverflow.com/questions/12139381/alpha-dependent-template-matching https://stackoverflow.com/questions/65945434/template-matching-with-python-3-9-1-opencv-python-4-5-1-48-and-mask-transparen