Crosshairs on live image
In response to a recent question, whether it would be possible to display cross-hairs on a live image to align a specimen, the answer is yes.
Workspace Preview (available for all cameras in Image-Pro) displays the live camera image in a normal Image-Pro Plus workspace, with all processing options available. While the frame rate (due to the additional processing) will not be as fast as the standard live preview, the additional functionality can be very useful.
First, add the following macro to your active script file:
Sub Crosshair()Dim source As IntegerDim dInfo As IPDOCINFODim annotNum As Integer' Check to see if the crosshairs have been drawn yet' (this prevents repeated redraws)ret = IpAnGet(GOOBJGET_OBJ_NUMBER, annotNum)If annotNum >= 2 Then Exit Sub' Get image informationret = IpDocGet(DOCGET_GETACTDOC, 0, source)ret = IpDocGet(DOCGET_GETDOCINFO, source, dInfo)' If not present, draw crosshairs on the imageret = IpAnCreateObj(GO_OBJ_LINE)ret = IpAnMove(0, 0, dInfo.Height/2)ret = IpAnMove(2, dInfo.Width-1, dInfo.Height/2)ret = IpAnCreateObj(GO_OBJ_LINE)ret = IpAnMove(0, dInfo.Width/2, 0)ret = IpAnMove(2, dInfo.Width/2, dInfo.Height-1)End Sub
In the Video/Ditgital Capture dialog, check Workspace Preview. Expand the dialog (using the More >> button), and click on the Macro tab. Select the "Crosshair" macro for Workspace Preview. now any workspace preview will have crosshairs drawn - and the check on the number of annotation objects will prevent constant redraws.
This technique can be used to draw crosshairs, stereology dissectors, protractors, or any other overlay needed for live previews.
0
Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions