Halcon - verify if region is empty

1.5k views Asked by At

This row:

intersection(CurrentZplaneTransRegion, Unshifted, CurrentRegion)

sometimes returns a empty region. I need to catch this situation. How can I verify if the currentRegion is empty?

2

There are 2 answers

0
Andrea Mannari On BEST ANSWER

There are 2 possibilities for this.

First:

area_center (CurrentRegion, AreaCurrentRegion, _, _)
if (AreaCurrentRegion==0)
    * CurrentRegion is empty
else
    * CurrentRegion is not empty
endif

Second:

gen_empty_region (EmptyRegion)
if (CurrentRegion==EmptyRegion)
    * CurrentRegionn is empty
else
    * CurrentRegion is not empty
endif
0
Kilian Hohm On

You can use the operator area_center(CurrentRegion, Area, Row, Column) for this and check the Area result if it is zero.