Click or drag to resize

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
Syntax
VB
Property 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
Remarks
After 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
VB
'Mark sections of rising green
With ThisApplication.ActiveImage.LineFeatures.Profiles
.VirtualWidth = VirtualWidth 'set this to something like 1 to 3
.Interpretation = mciRGB 'we want RGB
.CalibratedIntensity = True 'we show calibrated intensity
.SampleMode = mclpsmFixedSampleLength 'always same sample length
.CalibratedLength = False 'specify LengthPerSampleDesired in pixels
.LengthPerSampleDesired = 1 / c_dSamplesPerPixel 'set sample length in pixels
.CalibratedLength = c_bUseCalibratedDistances 'but we may want to show result distances calibrated
End With 'ActiveImage.LineFeatures.Profiles
'Set up one McProfileEdges for each color channel
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 'ActiveImage.LineFeatures
'We weight for rising green
GreenPE.ChannelOfInterest = 1 'Green
GreenPE.EdgeFindingMethod = mcpefmRisingEdges
'We weight for low red and low blue
RedPE.ChannelOfInterest = 0 'Red
RedPE.EdgeFindingMethod = mcpefmValleys
BluePE.ChannelOfInterest = 2 'Blue
BluePE.EdgeFindingMethod = mcpefmValleys
'Combine the weights
Dim mcobjCombinedWeights As McObject
Set mcobjCombinedWeights = McObjectTemp( GreenPE.WeightedProfiles)
mcobjCombinedWeights.OpSelfMul RedPE.WeightedProfiles
mcobjCombinedWeights.OpSelfMul BluePE.WeightedProfiles
'Assign to ProfileEdges.WeighteProfiles to find "going green" edges
With ThisApplication.ActiveImage.LineFeatures.Profiles.ProfileEdges
'Set the AbsoluteMaxWeightValue as the product of the three
.AbsoluteMaxWeightValue = GreenPE.AbsoluteMaxWeightValue * _
RedPE.AbsoluteMaxWeightValue * BluePE.AbsoluteMaxWeightValue
.WeighteProfiles = mcobjCombinedWeights 'this finds the edges
MsgBox "On " & ProfilesAncestor.CountOfProfiles & _
" profiles, we found " & McToText( .EdgeCounts) & " edges going green."
End With 'ActiveImage.LineFeatures.Profiles.ProfileEdges
See Also

Reference

ThresholdForEdges