Up | ExternalLogic - 14 | ExternalScalar - 2 | ExternalText - 40 | ExternalPoint - 39 | ExternalLine - 38 | ExternalData - 66 | ExternalPolygon - 76 | ExternalPolygon2 - 156 | ExternalDictionary - 71 | LinearScaleTool - 4 | LogicPack - 18 | ToolBox - 92 | DataImport - 93 | ToolImport - 94 | Classifier - 86

 

  

 
ExternalPolygon2 - 156
ExternalPolygon is a data tool defining a series of polygons. It differs from ExternalPolygon by adding persistence options to make it similar in operation to the other external data tools.

The polygons can be defined by clicking in the image. More on polygon operations.

        
The image shows the region of interest for a ColorMatcher driven from python - the path is defined in an ExternalPolygon.


Setup

Behaviour

  • Set to initial value before inspection - Resets the tool's values before every inspection
  • Make external changes permanent - Activating this value will make the values persistent

Initial values

  • Numbered list - ordered list of polygons
  • New - Make room for new polygon to be typed or pasted in
  • Delete - Delete selected polygon
  • Up - Move selected polygon up in list
  • Dpwn - Move selected polygon down in list
  • Paste new - Paste polygon from clipboard into new position at end of list
  • Highlight selection - Show polygon in red in main image
  • Copy - Copy selected polygon to clipboard
  • Paste - Paste polygon from clipboard into selected position

Further commands are available by right-clicking the numbered list.

The pushbuttons on the bottom:

  • Selected - transfer selected value to results
  • Selected - set selected value from results
  • All - transfer all values to results
  • All - set all values from results

 


Visualisation

Polygon Any polygon results (not initial values)


Results

Count

Number of defined polygons

Polygon[1]-Polygon[64]

The first 64 defined polygons, as Python tuples

Note that only the first 64 polygons are reported as results - use executeCmd to access the remaining polygons.


Example: Using polygon results in scripts

  points = eval(GetValue('top_polygons.Polygon[1]')) # converts the result string to a python tuple


ExecuteCmd support
(see also executeCmd)

Command

Parameters

Return values

Comments

Set Object=ROI;Number=<n>;Value=<polygon> ok,None Set an existing polygon's value from StrVec format
Add Object=ROI;Value=<polygon> ok,None Add new polygon from StrVec format
Get Object=ROI;Number=<n> ok,<polygon> Retrieve polygon in StrVec format, open polygon
Get Object=Count ok,<count> Retrieve number of defined polygons
Get Object=Tuple;Number=<n> ok,<tuple> Retrieve polygon as a Python tuple
Delete Object=ROI;Number=<n> ok,None Delete numbered polygon
DeleteAll - ok,None Delete all polygons

 

 

Scorpion Vision Version XII : Build 646 - Date: 20170225
Scorpion Vision Software is a registered trademark of Tordivel AS.
Copyright 2000 - 2017 Tordivel AS.