How can I automate setting the draw region of the camera control to 100 pixel square on live images?
I am guessing it is something to do with mcatSubRegion but I don't know how to set the co-ordinates and width with height programmatically. I cannot find documentation on MediaCy.IQL mcatSubRegion.
0
Best Answers
-
You are correct that the mcatSubRegion attribute will set the capture region. However, there is a higher level method that is easier to implement that contains all of the commonly used camera settings. The macro script below shows how to set the capture region to (0, 0, 100, 100) for preview and (0, 0, 200, 200) for capture. Note that if you have capture and preview settings locked, than the last set value will apply for both of them. In this case then it would be (0, 0, 200, 200) if the lock was active.
Public Function CaptRegion() As SimpleScript CaptRegion = New SimpleScript With Capture.CaptureCommands.Settings(CaptRegion) .PreviewSettings = True .SubRegion = New System.Drawing.Rectangle(0, 0, 100, 100) .Run() End With With Capture.CaptureCommands.Settings(CaptRegion) .PreviewSettings = False .SubRegion = New System.Drawing.Rectangle(0, 0, 200, 200) .Run() End With End Function
0
Answers
The easiest way is to use Bitmap view (Image tab). It will give you a table of pixel intensities, which you can export to Excel.
Yuri
If you want to work with pixel intensities there are existing tools in Calc (Process tab) with full set of arithmetical and logical operations.
If you want to use your own routines you can use macro functions to access pixels, (GetArea). Here is the example:
Regards,
Yuri