IMcProfileEdgesWeightedProfiles Property
|
|
The weighted profile upon which edges are detected.
Namespace:
MediaCy.IQL.Features
Assembly:
MediaCy.IQL.Features (in MediaCy.IQL.Features.dll) Version: 10.0.6912.0
SyntaxProperty WeightedProfiles (
<OptionalAttribute> Selector As Object
) As Object
Get
Set
Parameters
- Selector (Optional)
- Type: SystemObject
An empty variant, a single negative value, a single index value,
or an array of zero or more index values (negative index values are legal
but will be ignored).
If the Selector argument is a non-negative scalar index value, then the
weighted profile for just the indicated profile is returned or assigned to
as or from a 1-D array. The index value must fall between zero and
ProfilesAncestor.CountOfProfiles-1.
If the Selector argument is Empty, Error or Null, or any negative scalar
value, then profiles are returned or assigned to for all
ProfilesAncestor.CountOfProfiles profiles. In this case, the returned value
or assigning value will be an array of Variant, where each Variant is a 1-D
array that is the weighted profile from the ProfilesAncestor's profile at
the same index.
If Selector is an array, then zero or positive values are treated as indices
into the ProfilesAncestor profiles, negative values are legal but ignored.
In this case, weighted profiles only for the indicated profiles, and the
returned value or assigning value is an array of Variant, with each holding
one weighted profile array. Index values greater or equal to the
ProfilesAncestor.CountOfProfiles property are illegal.
Property Value
Type:
Object
RemarksAfter calling FindEdges, the weighted profile for each ProfilesAncestor
profile that was selected in the FindEdges call will be available in this
property. Each weighted profile is a 1-D array of Double that is the same
length as the number of samples in the ProfilesAncestor profile; that is,
for profile N, ProfilesAncestor.NumberOfSamples(N).
Examining the weighted profiles can be critical to understanding the effect
of the properties that control the weighting process (EdgeFindingMethod,
Weights or Pattern, MatchLength, SizeWeighting and WeightingFlags).
The WeightedProfiles property can also be assigned to directly for those rare
cases where the weighting that FindEdges does is not adequate (e.g., some
analysis of a color profile). When a weighted profile is assigned to, any
existing automatically found edges on it are removed and new edges are detected
based on the assigned weighted profile and the the AbsoluteMaxWeightValue,
ThresholdForEdges, mcpeofAbsoluteThresholding bit of OptionFlags, MatchLength,
MatchHotspot, MinEdgesPerProfile and MaxEdgesPerProfile properties. Any existing
edges that were added by the AddEdges method (ones with the mcpeeaAddedEdgeFlag
set in the EdgeAttributes property) will not be cleared before detecting new
edges. You may need to assign to the AbsoluteMaxWeightValue property just before
assigning to WeightedProfiles. This is especially true if the
mcpeofAbsoluteThresholding bit of OptionFlags is set, because that makes
ThresholdForEdges act as a fixed percentage of AbsoluteMaxWeightValue.
All, one or a selected sub-set of weighted profiles may be accessed or assigned.
When multiple profiles are accessed or assigned they are exposed or assigned
from an array of Variant, each Variant holding one profile array.
If any edges were added, changed or removed on assignment then an McObjMgr
McObjStandardNotify.SpecialNotify is fired on the McObject backing this
McProfileEdges. The notify code will be SNC_NOTIFY_HO_PROPERTYCHANGED and the
notify data will be ID_IMcProfileEdges_EdgeCounts. You can use an instance of
McNotifySink WithEvents in VBA to track these notifies.
Examples
With ThisApplication.ActiveImage.LineFeatures.Profiles
.VirtualWidth = VirtualWidth
.Interpretation = mciRGB
.CalibratedIntensity = True
.SampleMode = mclpsmFixedSampleLength
.CalibratedLength = False
.LengthPerSampleDesired = 1 / c_dSamplesPerPixel
.CalibratedLength = c_bUseCalibratedDistances
End With
With ThisApplication.ActiveImage.LineFeatures
Dim RedPE As McProfileEdges, GreenPE As McProfileEdges, BluePE As McProfileEdges
Set RedPE = CreateOperator("McProfileEdges", .Profiles)
Set GreenPE = CreateOperator("McProfileEdges", .Profiles)
Set BluePE = CreateOperator("McProfileEdges", .Profiles)
End With
GreenPE.ChannelOfInterest = 1
GreenPE.EdgeFindingMethod = mcpefmRisingEdges
RedPE.ChannelOfInterest = 0
RedPE.EdgeFindingMethod = mcpefmValleys
BluePE.ChannelOfInterest = 2
BluePE.EdgeFindingMethod = mcpefmValleys
Dim mcobjCombinedWeights As McObject
Set mcobjCombinedWeights = McObjectTemp( GreenPE.WeightedProfiles)
mcobjCombinedWeights.OpSelfMul RedPE.WeightedProfiles
mcobjCombinedWeights.OpSelfMul BluePE.WeightedProfiles
With ThisApplication.ActiveImage.LineFeatures.Profiles.ProfileEdges
.AbsoluteMaxWeightValue = GreenPE.AbsoluteMaxWeightValue * _
RedPE.AbsoluteMaxWeightValue * BluePE.AbsoluteMaxWeightValue
.WeighteProfiles = mcobjCombinedWeights
MsgBox "On " & ProfilesAncestor.CountOfProfiles & _
" profiles, we found " & McToText( .EdgeCounts) & " edges going green."
End With
See AlsoReference
ThresholdForEdges