How to pass back the information of the calculated 2D mask in Python to Mech-Vision

I would like to ask how to export 2D images from Mech-Vision to Python for CV processing. After calculating the 2D mask, how should it be passed back to Mech-Vision for cropping?

Hi,
Here is the solution:

image

Define Image[ ] in the output port of Step “Calc Results by Python”, note that it is a list. Then you can return your calculated result in the Python function.
The attachment is a sample code for reference:
pyEngine_2D.zip (7.6 MB)