Image Histogram
Hi,
I need to get the image histogram info (RGB image).
I tried this code
I need to get the image histogram info (RGB image).
I tried this code
'---------------------------------------------------------------------- Dim hist As MediaCy.IQL.Operations.McHistogram = ImEmpty.Histogram Dim dMedia As Double = hist.Mean <---- Error Type mismatch (10080) Dim dMinimo As Double = hist.Min<---- Error Type mismatch (10080) Dim dMassimo As Double =hist.Max<---- Error Type mismatch (10080) Dim dStdDev As Double = hist.StdDev<---- Error Type mismatch (10080) Dim dModa As Double = hist.Mode<---- Error Type mismatch (10080) '---------------------------------------------------------------------- NOTE ImEmpty is a McImage instance According to the IQL reference the Mean is a double parameter In case of AOI presence on the image should I use the region access method ( some think similar at the follow code)? Dim ra As McRegionAccess=ImEmpty.CreateRegionAccess()If yes which is the correct sintax to be used ? Thank you Maurizio
ra.RegionMask=ImEmpty.Aoi'process only active ROI
0
Answers
If image is color, the Mean will be an array of values for every channel:
If you don't know what output type is, I recommend using Object :
Public Sub TestHist2 Dim hist As MediaCy.IQL.Operations.McHistogram = ThisApplication.ActiveImage.Histogram Dim dMedia As Object = hist.Mean Debug.Print ThisApplication.GlobalTools.McToText(dMedia).Value End Sub
Regards,
Yuri
Yuri