ImagePro>Re: Temporary file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ImagePro>Re: Temporary file
Here's an example macro I wrote for this technique:
' Test of measuring objects based on edges
' This macro should be run on the demonstration "Spots.tif" image.
'
' The procedure is to extract outlines based on edge detection,
' use those edges to identify objects, then measure the pixel
' data in the original image. This general technique can be
' applied to almost any kind of edge filter, or even to combinations
' of several filters that bring out the edges. The thresholds for the
' edge images will be determined by the data and the user.
'
' Written 7/11/2000 Kevin Ryan Media Cybernetics
' Free for use as sample code
Option Explicit
Sub Measure_Edges()
Dim docOrig%, docEdge%
Dim fName As String
' Create an AOI so that we can blur some of the spots.
' This will show how we can find objects based on their
' edge strengths. This section is only here for demonstration purposes,
' and would not be present for a real experiment.
ret = IpListPts(Pts(0), "66 74 163 37 191 71 164 144 121 240 54 305 6 298 2
227 9 125 ")
ret = IpAoiCreateIrregular(Pts(0), 9)
ret = IpFltGauss(7, 10, 10)
ret = IpAoiShow(FRAME_NONE)
' Make a working copy for edge extraction
ret = IpDocGet( GETACTDOC, 0, docOrig )
docEdge = IpWsDuplicate( )
' Bring out the edges of the spots
' THIS IS WHERE YOUR CODE GOES IN!!! You must extract the edges
' from your image, possibly with variance, Sobel, laplacian, or FFT
' techniques. Play around with your images until you get the edges
' you want separable from other parts of the image.
ret = IpFltSobel()
' Count the now located spots based on edge intensity
ret = IpBlbShow(1)
ret = IpBlbCount()
ret = IpBlbUpdate(0)
' Save the outline for use with the original data,
' after first killing off any existing temp file.
fName = Dir$("C:\Temp\data.out")
If fName <> "" Then
Kill "C:\Temp\data.out"
End If
ret = IpBlbSaveOutline("C:\Temp\data.out")
' Select the original and measure it.
' Another related technique is to find the objects in the original
' (or some other derivative image), and measure the edges to classify
' those objects. In that case you would use the outlines from the object
' image on the edge image and classify them based on that.
ret = IpAppSelectDoc(docOrig)
ret = IpBlbLoadOutline("C:\Temp\data.out")
ret = IpBlbEnableMeas(BLBM_DENSITY, True)
ret = IpBlbMeasure()
ret = IpBlbUpdate(0)
End Sub
-- Kevin Ryan
kevin@mediacy.com
-----Original Message-----
From: Image-Pro Plus Users Email List
[mailto:imagepro-users@lists.mediacy.com]On Behalf Of LCV
Sent: Monday, November 19, 2001 12:40 PM
To: Image-Pro Plus Users Email List
Subject: ImagePro>Temporary file
Hello,
I need to know how to segment on the edges after duplicating the
image and performing a sobel filter on it and how to save the outline to a
temporary file. In reference to Kevin Ryan4s mail of friday 16, 2001.
Many thanks for you help
Gastsn Nicora
LCV s.r.l
Av. Calchaqum Km 23.5
Florencio Varela (1888)
Argentina
Te: 54-11-4275-7374/7422
lcv@lcvsrl.com.ar
***********************************************************
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