1.18k likes | 1.35k Views
An introduction to Scorpion based on Demo 1 – Label on syringe. Scorpion 1.70 16. January 2003 Thor Vollset – TORDIVEL AS. Label system description. Scorpion Vision Software Industrial PC (IPC) One industrial camera Lighting Host Communication. Task - Label. Measure
E N D
An introduction to Scorpionbased on Demo 1 – Label on syringe Scorpion 1.70 16. January 2003 Thor Vollset – TORDIVEL AS
Label systemdescription • Scorpion Vision Software • Industrial PC (IPC) • One industrial camera • Lighting • Host Communication Introduction to Scorpion - Demo 1- Label on Syringe
Task - Label • Measure • Label position on syringe • Resolution 1/100 mm • Tolerance 5/100 mm • Check • Position is between 3.6 and 3.85 mm. Introduction to Scorpion - Demo 1- Label on Syringe
Setup Image shows syringe with label. The syringe is illuminated with a diffuse lighting with a dark background. This reduces reflections and ensures edge contrasts. To measure the label position it is necessary to constructs a reference line defined by the two edgepoints where the syringe starts to get smaller. The image is captured with an industrial Sony b/w camera XC-75, 760 x 570 pixels and 256 graylevels Introduction to Scorpion - Demo 1- Label on Syringe
Scorpion in Operation Introduction to Scorpion - Demo 1- Label on Syringe
System Requirements • Regional Settings • English US Introduction to Scorpion - Demo 1- Label on Syringe
Operation Screen • Operation consists of • Image with visualization • Indicator panel • State panel • Web page – custom user interface • Statistics • User configuration Introduction to Scorpion - Demo 1- Label on Syringe
Label block diagram Introduction to Scorpion - Demo 1- Label on Syringe
Starting Scorpion • Starting Scorpion is normally executed from the Scorpion program group Introduction to Scorpion - Demo 1- Label on Syringe
Automatic start using a shortcut • A shortcut is defined by setting the path: • ..\scorpion.exe system=<path> • In the label demo the following is defined: • ...\scorpion.exe system=.\label Introduction to Scorpion - Demo 1- Label on Syringe
Profile selection dialog • If no path is specified on the Scorpion commandline the profile selection dialog is activated • The following operations is supported from the dialog: • Start profile • Create / delete and copying of profiles • Create shortcuts Introduction to Scorpion - Demo 1- Label on Syringe
Creating label test profile • Precondition • Scorpion 1.70 installed • Demo 1 – Label installed • Create shortcut to Scorpion.exe • Create test profile • Start Scorpion • Press New in profile selection dialog • Name profile Test • Select Default profile • Press Copy to transfer profile to test • Start Test profile by pressing OK Introduction to Scorpion - Demo 1- Label on Syringe
System log Error messages and events are collected in the System log There are five levels of messages System log operation is supported from a popup menu. It is an important source of information under operation and configuration. Hint 1 – If nothing happens or you do not understands what happens – take a look at the system log. Hint 2 – It is always save to restart Scorpion. The profile is always persistent. Introduction to Scorpion - Demo 1- Label on Syringe
Password protected profiles • Scorpion has three modes of operation: • Operation • Settings • Service • Password to service and settings are: • 911 • 1234 • Press Service • 911 OK opens Service Mode Introduction to Scorpion - Demo 1- Label on Syringe
Service mode • In service mode gives the user access to profile configuration • Main modules are • General • Scheduler • Actions • Toolbox • Camera • Communication Introduction to Scorpion - Demo 1- Label on Syringe
Camera Setup – Service.Camera • In this profile we grab images from a directory • Camera driver is FireGrab.dll • It is easy to switch from live camera to file • File simulation is turn on/off by Image Settings.Simulate Hint : Live video is also supported Introduction to Scorpion - Demo 1- Label on Syringe
Camera Setup • Add a new camera • Or choose an existing camera • Select grabber and port in Camera Setup • Port must be unique • Select camera type • ”Advance” opens the camera property pages • Documentation from camera vendor Introduction to Scorpion - Demo 1- Label on Syringe
Camera Support • All cameras are activated from Device Manager is available in Scorpion • WDM-Drivers and documentation is normally provide by the camera vendor • Scorpion is based on DirectShow and support all cameras with WDM-driver • Scorpion is tested with FireWire cameras from Sony, Unibrain, Imaging Source in addition to web cameras from Logitech Introduction to Scorpion - Demo 1- Label on Syringe
File simulation • Activate simulation under service/camera/image settings • Press Edit to change simulation directory • Set Image Name = Syringe • Directory selection – next page • A file filter is supported • Scorpion supports standard bitmap files in simulation mode Introduction to Scorpion - Demo 1- Label on Syringe
Choose simulation directory • Active Simulate under Service.Camera.Image Settings • Press Edit • Choose directory ... \Label\Images • Press OK • Close Image Configuration • Verify image directory by pressing Snapshot • Image of the Syringe is shown on the left hand side of Scorpion Introduction to Scorpion - Demo 1- Label on Syringe
Image operations By using the image menu on can perform operation on the active image The following operations are available by right clicking the mouse on an image • Cursorposition with intensity • Distance measurement • Copy/Store images with or without overlay graphics • Image zoom • Polygon construction Introduction to Scorpion - Demo 1- Label on Syringe
Image processing - Toolbox • The image processing is defined under Service.Toolbox • The image processing consists of a sequential list of user created and configured tools. • Scorpion has a number tool categories: • Basic, Data, Edge, Reference and Advanced tools • All tools can be activated / deactivated by the user or by using guards reflecting the image processing state • A tool is connected to an image and a reference tool Introduction to Scorpion - Demo 1- Label on Syringe
Help - Toolbox • All tools has a Help button • By pressing the help button context sensitive help is activated Introduction to Scorpion - Demo 1- Label on Syringe
Image processing steps Image processing typically divided in the following steps: • Define referencesystem • Declare external data • Locate object • Image Processing • Classification • Prepare data for host communication Introduction to Scorpion - Demo 1- Label on Syringe
Creating the Reference System • Activate Service.Toolbox.New to create MMReference of ScaleReference type • Set x and y scale to 24.8 • Active Results tab • Set unit for pixel resolution to mm by using the popupmenu Note that an image must be captured for Results.pixel resolution to be defined Introduction to Scorpion - Demo 1- Label on Syringe
Defining the reference system With Scorpion reference systems are defined with a family reference tools. In the label case MMReference of type ScaleReference is used to transform pixels to mm. With x and y scale of 24.8 the pixel resolution is 0.04 mm Check MMReference.Results The scalefactor was defined by using a ruler. Introduction to Scorpion - Demo 1- Label on Syringe
External Data The three tools Lowtolerance, Distance_Low and Distance_High of type ExternalScalar is set from the PLC using the user defined actions Mode_Lowtolerance og Mode_Hightolerance The data tools are later used to set boundary values for the corresponding Logic Tools Distance Cannot Measure is defined to capture values obvious wrong Introduction to Scorpion - Demo 1- Label on Syringe
Data Tools • Active Service.Toolbox.New to create the following tools: • ExternalScalar • Distance_Low • Distance_High • Distance Cannot Measure • ExternalLogic • Low tolerance Introduction to Scorpion - Demo 1- Label on Syringe
Limit values Two modes are defined: • Sample test – Lowtolerance • Operation Sample test limits are Low = 3.60 mm and High = 3.85 mm Operation mode limits are Low = 3.40 and High = 4.00 mm Distance Cannot Measure are 1.00 mm – The assumption is that all values less than 1.00 mm is erroneous and thus are classified Cannot Measure Introduction to Scorpion - Demo 1- Label on Syringe
Setup Distance_Low Open Service.ToolBox Update Distance_Low by selecting this tools and pressing Edit Active the Setup tab Turn on Make external changes permanent – Scorpion will remember this value after restart Initial value to 3.40 This is the Operation Mode limit Hint : Limit values for sample mode is set by user defined actions Introduction to Scorpion - Demo 1- Label on Syringe
Define precision and unit The user defines a result’s precision and unit manually by activating a tools results tab and right clicking the actual result. Set Distance_Low precision to two decimals and the unit to mm. Repeat the same for Distance_High and Distance Cannot Measure For Lowtolerance set precision to 0 and unit to [bool] Introduction to Scorpion - Demo 1- Label on Syringe
Setup External Data Set the following values:: • Distance_High • Initial value = 4.00 mm • Distance Cannot Measure • Initial Value = 1.00 • Low tolerance • Initial Value = 1 • 1 means operation mode Introduction to Scorpion - Demo 1- Label on Syringe
Backup of profile • Activate Service.Maintenance • Press Backup • Add comment • Press OK Hint : Profile Backup ensures simple restore of a working profile Introduction to Scorpion - Demo 1- Label on Syringe
Locate syringe The following steps are performed to locate the syringe: • Calculates blob threshold with Lightmeter • Finds course location of syringe with blob - FindSyringe • Establishes SyringeReference using three edgefinders: • Left Edge • Upper Left Edge and Upper Right Edge Introduction to Scorpion - Demo 1- Label on Syringe
Locate Syringe - LightMeter Activate Service.Toolbox Create LightMeter – IntensityTool. Set MMReference as reference. Using LightMeter an adaptive threshold for the blob Find Syringe is calculated. The LightMeter ROI is defined in a narrow band across the syringe. The LightMeter’s 70 % percentil is a good candidate for the Find Syringe threshold. Using this threshold makes Find Syringe robust to light variations. The LightMeter’s ROI is in a narrow band across the syringe. Introduction to Scorpion - Demo 1- Label on Syringe
Find Syringe Create Find Syringe – BlobTool. Set MMReference as reference. Find Syringe requires that the light area of the syringe is greater than 10 mm2. The ROI is around the syringe. The size defines how large variation in syringe position the system can tolerate. Hint : All values are in mm. This is defined by the reference MMReference Introduction to Scorpion - Demo 1- Label on Syringe
Verify – Find Syringe • Verify • Press Start • Check that Blob locates syringe on all images • Press Stop to terminate • Activate Find Syringe.Visualization • Turn off all elements except MaxContour and Center Of Gravity • Turn off Show graphics on LightMeter.Visualization Hint : A tool can be examined in detail using Visualization – this only Introduction to Scorpion - Demo 1- Label on Syringe
State – Syringe Present Create the Lag logic state Syringe Present - LogicTool Open Syringe Present and activate the Setup tab. Add a new condition pressing New Set Find Syringe.Total blob area greater than 40 mm2. Set Syringe Present to false if condition is undefined. In this case this means that Find Syringe has failed. Introduction to Scorpion - Demo 1- Label on Syringe
Locate Syringe Using edgefinders the upper left edges of the syringe is located. The following edgefinder – LineEdgeFinderTool is used: • Find Left Edge • Find Upper Left Edge • Find Upper Right Edge Tracecomb Find Upper Left Edge Introduction to Scorpion - Demo 1- Label on Syringe
Setup Find Left Edge • Create a tool – LineEdgeFinderTool named Find Left Edge • Set Find Syringe as reference • Press Apply • Turn on visualizations – tracelines • Activate Show Info – Image Menu • Position mouse at left edge to find center of ROI Hint – All values are in mm Introduction to Scorpion - Demo 1- Label on Syringe
Advances setup LineEdgeFinderTool • Differentiation = 1 • This means that seek peaks where the derivative is at it’s maximum. This is robust and handles light variations. • Smooth base and counter = 4 and 2 • Means that the tracecombs is filtered to remove noise • Fit-tolerance = 0,08 • This means that all points used in the curvefitting is in a band of 0.08 mm – approx 2 pixels • Good-fraction = 12 points • This means that more than 12 of the tracecombs has edges for the fitted line to be accepted Introduction to Scorpion - Demo 1- Label on Syringe
Verify Find Left Edge Activate Find Left Edge.Results Hint : Press Start and run live inspections – the results are updated continuously • Check the Gradient against Setup.Threshold • Gradient should be minimum 1.5 – 2 time the threshold • Line-fit 0.0247 means that the points on the calculated line has a noise approximately half a pixel • The edgeline has a greater accuracy than half a pixel • The LineEdgeFinderTool has sub-pixel resolution Introduction to Scorpion - Demo 1- Label on Syringe
Find Upper Right Edge • Activate Service.Toolbox • Select Find Left Edge • Open mouse menu • Press Copy • Open mouse menu • Press Paste • Select Copy of Find Left Edge • Name Find Upper Right Edge • Select Find Upper Right Edge • Press Edit • Move Find Upper Right Edge ROI to the right side of the syringe – see image • Remember to rotate tracecomb Introduction to Scorpion - Demo 1- Label on Syringe
Finn Upper Left Edge • Activate Service.Toolbox • Select Find Upper Right Edge • Open mouse menu • Press Copy • Open mouse menu • Press Paste • Select Copy of Find Upper Right Edge • Name Find Upper Left Edge • Select Find Upper Left Edge • Press Edit • Move ROI to left side of syringe Introduction to Scorpion - Demo 1- Label on Syringe
Locate – Reference Line • Create Reference Line - LineFromPoints • Reference Line is defined by the Find Upper Left and Find Upper Right Edge center points. Introduction to Scorpion - Demo 1- Label on Syringe
Locate – Syringe Reference Create Syringe Reference – PointLineReference Set the reference to MMReference Reference Line and Find Left Edge defines a reference system that handles syringe rotation and translation. The rest of the image analysis benefits from this. It is important that Reference Line is defined as the first tool in PointLineReference because the first points handles rotation. Introduction to Scorpion - Demo 1- Label on Syringe
Syringe Width Create Syringe Width- LineEdgeCaliper • Purpose measure width of syringe in mm LineEdgeCaliper has two tracecombs – see image. Select Syringe Reference as reference. Using Syringe Reference means that the tool is relatively positioned and all parameters and results are in mm inherited from MMReference. Set Trace line start and end point to 2 and 6 – remember to set the angle and threshold Remember to set fit-tolerance in mm. A good starting point is 0.04 mm – equal to the pixelsize. Set number of tracelines to 21 Set unit and precision of the width and line fit results to mm and two and four decimals. Nominal width is 8.90 mm Introduction to Scorpion - Demo 1- Label on Syringe
Measure label position Using two edgefinders the left edge and the left slope edge is found. The intersection of these lines defines where the syringe bends. The same applies to the right side of the syringe. The two bends points is used to construct a Label Reference Line. Using a blob Find Marker and an edgefinder the upper edge of the upper marker is located precisely. The label position is defined as the distance between the Label Reference Line and the Upper Marker Edge. The distance is classified and is presented in mm i the statepanel. Introduction to Scorpion - Demo 1- Label on Syringe
Find Left Slope Create Find Left Slope – LineEdgeFinderTool • Make a copy of Find Left Edge • Paste Find Left Slope Select Find Left Slope Set Syringe Reference as reference Activate image menu Show Info Set ROI center and correct angle Hint : By activating Visualization.Tracelines one can see where the tracecomb hits the edge Introduction to Scorpion - Demo 1- Label on Syringe