ImagePro>Re: Dark Objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ImagePro>Re: Dark Objects
Set a Count/Size segmentation with a 'Manual' threshold of 0 (or whatever is
appropriate for your images). This will find black objects. Filter them by
size, shape, etc., to limit them to the starting points you wish. Then:
ret = IpBlbEnableMeas(BLBM_CENTRX, 1) ' Look for center points
ret = IpBlbEnableMeas(BLBM_CENTRY, 1)
ret = IpBlbCount() ' Count
ret = IpBlbFilter() ' Remove out of range objects
ret = IpBlbUpdate(0) ' Update screen
ret = IpBlbUpdate(4) ' Delete out of range objects
ret = IpBlbGet(GETNUMOBJ, 0, 0, numobj) ' Get number of objects
' Redimension appropriate arrays
ReDim Centerx(0 To numobj-1) As Single
ReDim CenterY(0 To numobj-1) As Single
' Get measurement data
ret = IpBlbData(BLBM_CENTRX, 0, numobj - 1, Centerx(0))
ret = IpBlbData(BLBM_CENTRX, 0, numobj - 1, Centerx(0))
You then have the center points, and can use those as the starting points
for creating AOIs. See the help file on IpAoiCreateEllipse( ), use that code
offset from the center points of your black areas. Just iterate through the
areas you wish to measure and run Count/Size with the appropriate AOI active
to limit counts to that area. You will have to size your AOI to cover 1 cm
based on the images you have - if your images are calibrated you can get the
units/pixel as follows:
Dim xratio As Single
Dim xratio As Single
ret = IpCalGet("sXUnitPerPix", szout)
xratio = val(szout)
debug.print "unit/pix (x) = " + str$(xratio)
ret = IpCalGet("sYUnitPerPix", szout)
yratio = val(szout)
debug.print "unit/pix (y) = " + str$(yratio)
Use IpBlbSetAttr(BLOB_ADDCOUNT, 1) to set Count/Size to append the counts
together if you wish to accumulate the objects for all AOI's in your image;
do this before you start the loop on the number of dark areas.
-- Kevin Ryan
kevin@mediacy.com
-----Original Message-----
From: Image-Pro Plus Users Email List
[mailto:imagepro-users@lists.mediacy.com]On Behalf Of Yntarius .
Sent: Thursday, December 13, 2001 5:22 PM
To: Image-Pro Plus Users Email List
Subject: ImagePro>Dark Objects
Hi
I am trying to write a macro that will do the folowing:
1- It will search for the points (position, if possible) where it finds
black.
2- I need to be able to take this positions and, after a set of operations,
use it as a marker back on the image. Like, i would like that the macro
would only count objects in a radio of 1 cm around each of the positions.
Any ideas are welcome
Thanks
Ariel Ades
Student
University of Rochester Medical Center
***********************************************************
Need an Image-Pro macro or driver? Find it at http://www.Solutions-Zone.com
Got an Image-Pro macro or driver? Add it to http://www.Solutions-Zone.com
***********************************************************
This message is sent to you because you are subscribed to <imagepro-users@lists.mediacy.com>.
To unsubscribe, email to: <imagepro-users-off@lists.mediacy.com>
To switch to the DIGEST mode, email to <imagepro-users-digest@lists.mediacy.com>
To switch to the INDEX mode, email to <imagepro-users-index@lists.mediacy.com>
Send administrative queries to <imagepro-users-request@lists.mediacy.com>
To subscribe or unsubscribe visit http://www.solutions-zone.com/ipednld/subscriber.asp