ImagePro>IpBlbGet(GETRANGESTATS . . .)?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ImagePro>IpBlbGet(GETRANGESTATS . . .)?
- To: <imagepro-users[at]lists.mediacy.com> (Image-Pro Plus Users Email List)
- Subject: ImagePro>IpBlbGet(GETRANGESTATS . . .)?
- From: "Anderson, Brian D (AS)" <BAnderson[at]crt.xerox.com>
- Date: Wed, 12 Dec 2001 15:14:52 -0500
- List-Archive: <http://lists.mediacy.com:80/Lists/imagepro-users/List.html>
- List-Unsubscribe: <mailto:imagepro-users-off@lists.mediacy.com>
- Reply-To: <imagepro-users[at]lists.mediacy.com> (Image-Pro Plus Users Email List)
- Sender: <imagepro-users[at]lists.mediacy.com> (Image-Pro Plus Users Email List)
Hi,
I was just wondering if this function has been added to image-pro. I was
in need of obtaining the measurement statistics for different color ranges,
and was having problems. I did a search on the list and found the
following. I'd like to know if this has been added, and I missed it . . .
or if it is still being worked on. Thanks . . . and a big thumbs up to this
list, and the searchable archive . . . they've come in very handy.
-Brian Anderson
Jean-Paul Martin" <jp@mediacy.com> writes:
Aryeh,
In IPP 4.0, the class number argument in IpBlbGet refers to the
classes found by the two measurement-based classification
functions in Count/Size: Auto-Classification and Single Variable
Classification. It does not refer to the intensity or color
range number.
For all its worth, IPP 4.0 allows you to display both the Range
Statistics table and the classification table. This was made
possible by separating the range number from the class number.
IPP 3.0 did not allow you to do so, and class numbers were
overwritten by range numbers when Range Statistics were
displayed.
Until we release a new version of IpBlbGet with a new command
(GETRANGESTATS) to get the range statistics, you can use Data
Collector as Lou suggested, or you can call the macro below (For
IPP4.0/IPBasic only):
Jean-Paul Martin.
Type BLOBSTATS
Min As Single
Max As Single
Range As Single
Sum As Single
Mean As Single
StdDev As Single
tagmin As Integer
tagmax As Integer
Count As Integer
End Type
' Low level function called by IPP to get statistics.
' Declaration must remain on one single line.
Declare Function BlbControl& Lib "halblb32" (ByVal hblob%, ByVal
blbcmd%, ByVal objid%, ByVal lParam&, lpParam As Any)
' This function gets intensity range statistics
' rangeId: 0-based range number
' rstats: array of at least 9 singles
' return: 0 if success, -1 if failed
Function RangeStats(ByVal rangeId%, rstats!()) As Integer
RangeStats = -1
' check there is a count and that rangeId is correct
Dim numranges%
ret = IpBlbGet(GETNUMRANGES, 0, 0, numranges)
If RangeId < 0 Or RangeId >= numranges Then Exit Function
' set active range
ret = IpBlbRange(rangeId)
' get blob environment for active range
Dim hblob&
ret = IpBlbGet(GETHBLOB, 0, 0, hblob)
' get stats
Dim bstats As BLOBSTATS
ret = BlbControl(hblob, 10, 0, 0, bstats)
rstats(0) = bstats.Mean : rstats(1) = bstats.StdDev
rstats(2) = bstats.Min : rstats(3) = bstats.Max
rstats(4) = bstats.Range : rstats(5) = bstats.Sum
rstats(6) = bstats.tagmin : rstats(7) = bstats.tagmax
rstats(8) = bstats.Count
' reset active range
ret = IpBlbRange(0)
RangeStats = 0
End Function
' example macro using RangeStats()
Sub Get_Range_Stats()
Dim stats(10) As Single
' ask stats for second range
ret = RangeStats(1, stats)
If ret < 0 Then Exit Sub
' display mean value
Debug.Print stats(0)
'...
End Sub
***********************************************************
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