How to detect direction (up/down) of products?

How to determine the direction (up/down) of products after detecting products with the “Predict Pick Point (Any Objects)” function?

In the example below I have the detection of products in a bin but the direction of the markers does not correspond to the direction of the products.

I would like the X coordinate of the pick markers to point towards the top of the product (towards the cap), can you help me?

Can you please provide the Mech-Vision project along with the data, and we will take a look at it.

If you have a way to accurately detect the caps, you can use the [Point Poses to Reference Positions] step. We have used a DLK model for this before but other methods should also be possible.

Hello DIHAO, please find the link where I submitted the mech-vision project.

@Timo : I use the “3d workpiece recognition” function to detect the bottle cap (see image_0).

I would like to use the “Adjust Poses V2” function to point the pick point obtained by the “Predict Pick Points (Any Object)” function to the point of the “3d workpiece recognition” function.
But to do this I need to find which product corresponds to the cap I detected. Is there a method to search for the correspondence of a product thanks to the cap?

The approach you mentioned it is a feasible solution. Need to use a Python script to perform a one-to-one nearest sorting of the poses obtained from the two locations. However, in some cases, the retrieved neighboring poses may be incorrect because the closest pose could be from another object.

Another solution is to directly use 3D matching . And adjust the pose based on the object’s length.

But if you have more types of bottles (with different shapes), you’ll need to continually add templates for matching.

Please check the modifications I’ve made to the Mech-Vision project:Unique Download Link | WeTransfer

Thanks @DIHAO but I have a problem with scipy module

image_3

Can you please check the version of “numpy” and “scipy” python module?

I don’t have scipy module for a pip list.

How can I install it ? I tried this command " python -m pip install scipy" but it is not work.

  1. Switch to the “python” directory of the Mech-Vision software, such as C:\Mech-Mind\Mech-Vision & Mech-Viz-1.8.2\Mech-Vision\python.
  2. Execute the command ” .\python -m pip install library_name “

Also check that in “Execution Flags” in the “Calc Result By Python” step “Reload File” is acticated or Mech-Vision will only reload the file when restarting the solution.

Thanks for the help I was able to install the scipy module.

I can run the Mech-Vision project.

The methodology is good but I noticed that when we have two bottles side by side the expected result is not good.

Do you have any ideas to make the process more reliable?

As I mentioned, finding the nearest one-to-one correspondence for objects and poses may not always be accurate in certain situations. It may require adding some threshold to avoid similar issues, but in more complex scenarios, even with added thresholds, errors may still occur. Therefore, I think using the 3D matching method is currently the more stable approach.

1 Like

thanks @DIHAO for the help I’ll keep looking :+1: