Scorpion 8 has introduced a new low-cost licence Scorpion OpenCV that enables clever engineers to implement cost effective OEM solutions.
We target also Scientist and Universities with Scorpion OpenCV. Combining Scorpion OpenCV with the the open source libraries scipy and numpy turn Scorpion into a development tool for open source image processing solutions. Read more about Scorpion 8 and Python.
Scorpion OpenCV can of course be used to extend the capabilities of the Scorpion Toolbox.
The following components are used:
- Scorpion Vision 8
- Python 2.6
- ctypes-OpenCV wrapper – ctypes-opencv-0.8.0.win32-py26.exe
Scorpion Online Help – OpenCV
The following code will perform the following – provided to show you how this is implemented:
- GetImage Image1 from Scorpion
- Move Image to OpenCV
- Do an adaptiveTreshold on the Image
- Do some morphology
- Return the image back to Scorpion
from OcvImage import OcvImage import ctypes_opencv objectImage = OcvImage(GetTool(GetCurSource()).imageNo) object = objectImage.GetCvImage() try: #Example of a useful transform - adaptive threshold #cvAdaptiveThreshold(im,im2,max_value,adaptive_method,threshold_type,block_size,offset) #apply to OpenCV image, can be done in place ctypes_opencv.cvAdaptiveThreshold(object,object,125,ctypes_opencv.CV_ADAPTIVE_THRESH_MEAN_C,ctypes_opencv.CV_THRESH_BINARY_INV,7,10) #can apply morpholgy if desired, # - again safe to do in place or could make second image ctypes_opencv.cvDilate(object,object,None,1) # ctypes_opencv.cvErode(object,object,None,2) OcvImage().Assign(object, "Image2") except Exception, msg: print msg