Scorpion Vision XII – SMARTscript is Dynamic Configuration

Tordivel

scorpionxii-64x64In this post we describe another important element in the Scorpion Vision framework were we want to explain that

 Python SMARTscript is Dynamic Configuration

Scripting supplements the ease of point & click configuration to develop more accurate, robust and smarter 2D and 3D machine vision solutions.

This example, SDP-0147 DynamicResultPythonScript, uses an image of three valves. The image is from an old and simple 2D robot vision solution. The example is made to be an inspiration for Scorpion Vision developers.

is-2016-0020-precornerfilter_input
Image of three valves

The example shows how a simple script can do the following operations:

  • PreCornerFilter image using  the STC-0011-ImageFilter 4.1.0.52
  • FindCornerCandidates using the Blob4 tool
  • Display the filter image using a color palette.
  • Cluster the candidates using a smart python script
  • Display the clusters and the results using the STC-0013-DisplayResult 2.2.0.28
  • Create the ClusterArea for each Cluster – STC-0100-PolygonCreator2D 1.0.0.5
  • Display the ClusterArea
is-2016-0020-cluster_result_2
The updated PythonScript tool support dynamic results – the cluster results is shown

This is the 4th post in series of Scorpion Vision Software important tool improvements included in upcoming – Scorpion Vision XII.

Python makes Scorpion an Open Flexible Development Platform

Python is an integral part of Scorpion Vision Software. It makes Scorpion Vision an open, extendable and flexible development platform for the most advanced machine vision solutions.

Easy to import major Open-Source libraries like OpenCV 3, Numpy and SciPy.

is-2016-0020-cluster_opensource

The Zen of Python (PEP 20), which includes aphorisms such as:[45]

  • Beautiful is better than ugly
  • Explicit is better than implicit
  • Simple is better than complex
  • Complex is better than complicated
  • Readability counts

PreCornerFilter image using  the STC-0011-ImageFilter 4.1.0.52

The ImageFilter Scorpion Tool Component is very useful. The filter string does the following:

  • m3 – median filter image block size 3
  • p11,0.0005 – precornerfilter image with size 11 and scale 0.0005
  • X normalises the image
is-2016-0020-precornerfilter
The filter string to precorner filter an image

The image below shows the input image and the filtered image with a color palette.

is-2016-0020-pythonfilterresult

FindCornerCandidates using the Blob4 tool

The Blob4 tool locates the strongest peaks from the precorner filter to find corner candidates

is-2016-0020-blob4-intensitysort
New option to sort Blob4 result by intensity value

Cluster the candidates using a Smart Script

The core clustering uses a KDTree from Scipy to cluster all corner candidates. The script locates the largest cluster – removes repeatably the candidates in the largest cluster MaxIterations times and clusters again.

is-2016-0020-cluster_corescript_2
The clustering is fast – typical 1 ms

Display the clusters and the results using the STC-0013-DisplayResult 2.2.0.28

The DisplayResult displays the cluster string C1=(3,(315.7,334.2),11) in the image.

is-2016-0020-stc-dynamiclinking
The STC support %1i tool indexing that extract the index from the toolname Cluster1

Create the ClusterArea for each Cluster – STC-0100-PolygonCreator2D 1.0.0.5

The polygon creator uses the result from ClusterScript to create a polygon describing the cluser area.

is-2016-0020-polygoncreator

Display the ClusterArea

is-2016-0020-clusterarea
The Cluster Area shown – inside the Blob visualises all the corner candidates

Scorpion Tools in Action

The following Scorpion Tools and STCs, Scorpion Tool Components, are used in the demo profile SDP-0147 DynamicResultPythonScript – 1.0.0.5

  • PreCornerFilter – STC-0011-ImageFilter 4.1.0.52
  • FindCornerCandidates – Tool 87 – Blob4
  • ClusterScript – Tool 3 – PythonScript
  • ClusterN – STC-0013-DisplayResult 2.2.0.28
  • CircleN – STC-0100-PolygonCreator2D 1.0.0.5
is-2016-0020-cluster_script_2
The complete ClusterScript that defines the datamodel and performs clustering using the Spatial module in SciPy

Machine Vision – TordivelBlog


No Comments

Leave a Reply

Your e-mail address will not be published. Required fields are marked *

Tordivel
Video – Real-time neural fish tracking

A new generation fish farming applications are here. Scorpion Stinger Technology provides the industrial strength to succeed in your factory. Tordivel has provided industrial strength applications since 2000 based on this technology. On a Scorpion Stinger Neural PC we locate multiple fishes in 100 ms. In addition to locating the …

Tordivel
Scorpion Vision wins the PPMA Innovative Vision Solution award for 2019

Tribute to the Scorpion Vision team for winning the award for the Innovate Vision Solution @ the large PPMA Automation Show in Birmingham.   Paul Wilson – CEO  of Scorpion Vision Ltd is the proud winner of the PPMA 2019 Innovative Vision Solution award for the unique 3D Robotics Cheese …

Tordivel
Check-out Scorpion 3D StingerSMARTcam @ PPMA in Birmingham 1-3.october

We are to present the Scorpion 3D Stinger SMARTcamera @ PPMA in Birmingham 1.-3. October 2019 at Scorpion Vision Ltd Stand A03 Plug and play – connect to the internet – state-of-the art 3D machine vision in  box – long reference list for real world 3D applications Check out Scorpion …