• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

zw版_Halcon图像库delphi接口文件

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

zw版_Halcon图像库delphi接口文件

      Halcon图像库delphi接口文件,根据安装时用户设置的文件目录不同,会有所差异,笔者一般安装在delphi的import目录下。
     参见:《zw版·全程图解Halcon控件安装(delphi版)》,http://www.cnblogs.com/ziwang/p/4850958.html


     安装成功后,import目录下,会有一个文件:HALCONXLib_TLB.pas,大约3900k,
     这个文件,就是Halcon图像库的delphi接口文件,纯delphi源码,7w多行,近4M,挺大的,光THImageX一个图像类,就有数百个函数。
     为方便未安装Halcon图像库的用户,学习参考,特提供相关源码,和下载:
     https://files.cnblogs.com/files/ziwang/HALCONXLib_TLB.zip

【zw版《delphi与halcon系列原创教程》,网址,cnblogs.com/ziwang/】

全部相关源码7w多行,太大,无法上传,只发布其中最重要的 THImageX 类代码,其他自己下载分析:

   1 // *********************************************************************//
   2 // OLE Server Proxy class declaration
   3 // Server Object    : THImageX
   4 // Help String      : Represents an instance of an image object(-array).
   5 // Default Interface: IHImageX
   6 // Def. Intf. DISP? : No
   7 // Event   Interface: 
   8 // TypeFlags        : (2) CanCreate
   9 // *********************************************************************//
  10 {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  11   THImageXProperties= class;
  12 {$ENDIF}
  13   THImageX = class(TOleServer)
  14   private
  15     FIntf: IHImageX;
  16 {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  17     FProps: THImageXProperties;
  18     function GetServerProperties: THImageXProperties;
  19 {$ENDIF}
  20     function GetDefaultInterface: IHImageX;
  21   protected
  22     procedure InitServerData; override;
  23   public
  24     constructor Create(AOwner: TComponent); override;
  25     destructor  Destroy; override;
  26     procedure Connect; override;
  27     procedure ConnectTo(svrIntf: IHImageX);
  28     procedure Disconnect; override;
  29     function WienerFilterNi(const Psf: IHImageX; const NoiseRegion: IHRegionX; MaskWidth: Integer; 
  30                             MaskHeight: Integer): IHImageX;
  31     function WienerFilter(const Psf: IHImageX; const FilteredImage: IHImageX): IHImageX;
  32     procedure GenPsfMotion(PSFwidth: Integer; PSFheight: Integer; Blurring: Double; Angle: Integer; 
  33                            Type_: Integer);
  34     function SimulateMotion(Blurring: Double; Angle: Integer; Type_: Integer): IHImageX;
  35     procedure GenPsfDefocus(PSFwidth: Integer; PSFheight: Integer; Blurring: Double);
  36     function SimulateDefocus(Blurring: Double): IHImageX;
  37     function CompareExtVariationModel(const ModelID: IHVariationModelX; const Mode: WideString): IHRegionX;
  38     function CompareVariationModel(const ModelID: IHVariationModelX): IHRegionX;
  39     procedure TrainVariationModel(const ModelID: IHVariationModelX);
  40     function ProjMatchPointsDistortionRansacGuided(const Image2: IHImageX; Rows1: OleVariant; 
  41                                                    Cols1: OleVariant; Rows2: OleVariant; 
  42                                                    Cols2: OleVariant; 
  43                                                    const GrayMatchMethod: WideString; 
  44                                                    MaskSize: Integer; 
  45                                                    const HomMat2dGuide: IHHomMat2DX; 
  46                                                    KappaGuide: Double; DistanceTolerance: Double; 
  47                                                    MatchThreshold: OleVariant; 
  48                                                    const EstimationMethod: WideString; 
  49                                                    DistanceThreshold: OleVariant; 
  50                                                    RandSeed: Integer; out Kappa: Double; 
  51                                                    out Error: Double; out Points1: OleVariant; 
  52                                                    out Points2: OleVariant): IHHomMat2DX;
  53     function ProjMatchPointsDistortionRansac(const Image2: IHImageX; Rows1: OleVariant; 
  54                                              Cols1: OleVariant; Rows2: OleVariant; 
  55                                              Cols2: OleVariant; const GrayMatchMethod: WideString; 
  56                                              MaskSize: Integer; RowMove: Integer; ColMove: Integer; 
  57                                              RowTolerance: Integer; ColTolerance: Integer; 
  58                                              Rotation: OleVariant; MatchThreshold: OleVariant; 
  59                                              const EstimationMethod: WideString; 
  60                                              DistanceThreshold: OleVariant; RandSeed: Integer; 
  61                                              out Kappa: Double; out Error: Double; 
  62                                              out Points1: OleVariant; out Points2: OleVariant): IHHomMat2DX;
  63     function ProjMatchPointsRansacGuided(const Image2: IHImageX; Rows1: OleVariant; 
  64                                          Cols1: OleVariant; Rows2: OleVariant; Cols2: OleVariant; 
  65                                          const GrayMatchMethod: WideString; MaskSize: Integer; 
  66                                          const HomMat2dGuide: IHHomMat2DX; 
  67                                          DistanceTolerance: Double; MatchThreshold: OleVariant; 
  68                                          const EstimationMethod: WideString; 
  69                                          DistanceThreshold: Double; RandSeed: Integer; 
  70                                          out Points1: OleVariant; out Points2: OleVariant): IHHomMat2DX;
  71     function ProjMatchPointsRansac(const Image2: IHImageX; Rows1: OleVariant; Cols1: OleVariant; 
  72                                    Rows2: OleVariant; Cols2: OleVariant; 
  73                                    const GrayMatchMethod: WideString; MaskSize: Integer; 
  74                                    RowMove: Integer; ColMove: Integer; RowTolerance: Integer; 
  75                                    ColTolerance: Integer; Rotation: OleVariant; 
  76                                    MatchThreshold: OleVariant; const EstimationMethod: WideString; 
  77                                    DistanceThreshold: Double; RandSeed: Integer; 
  78                                    out Points1: OleVariant; out Points2: OleVariant): IHHomMat2DX;
  79     procedure ReceiveImage(const Socket: IHSocketX);
  80     procedure SendImage(const Socket: IHSocketX);
  81     function BinocularDistanceMg(const Image2: IHImageX; out Score: IHImageX; 
  82                                  CamParamRect1: OleVariant; CamParamRect2: OleVariant; 
  83                                  RelPoseRect: OleVariant; GrayConstancy: Double; 
  84                                  GradientConstancy: Double; Smoothness: Double; 
  85                                  InitialGuess: Double; const CalculateScore: WideString; 
  86                                  MGParamName: OleVariant; MGParamValue: OleVariant): IHImageX;
  87     function BinocularDisparityMg(const Image2: IHImageX; out Score: IHImageX; 
  88                                   GrayConstancy: Double; GradientConstancy: Double; 
  89                                   Smoothness: Double; InitialGuess: Double; 
  90                                   const CalculateScore: WideString; MGParamName: OleVariant; 
  91                                   MGParamValue: OleVariant): IHImageX;
  92     function GenBinocularProjRectification(const FMatrix: IHHomMat2DX; CovFMat: OleVariant; 
  93                                            Width1: Integer; Height1: Integer; Width2: Integer; 
  94                                            Height2: Integer; SubSampling: OleVariant; 
  95                                            const Mapping: WideString; out CovFMatRect: OleVariant; 
  96                                            out H1: IHHomMat2DX; out H2: IHHomMat2DX): IHImageX;
  97     function MatchFundamentalMatrixDistortionRansac(const Image2: IHImageX; Rows1: OleVariant; 
  98                                                     Cols1: OleVariant; Rows2: OleVariant; 
  99                                                     Cols2: OleVariant; 
 100                                                     const GrayMatchMethod: WideString; 
 101                                                     MaskSize: Integer; RowMove: Integer; 
 102                                                     ColMove: Integer; RowTolerance: Integer; 
 103                                                     ColTolerance: Integer; Rotation: OleVariant; 
 104                                                     MatchThreshold: OleVariant; 
 105                                                     const EstimationMethod: WideString; 
 106                                                     DistanceThreshold: OleVariant; 
 107                                                     RandSeed: Integer; out Kappa: Double; 
 108                                                     out Error: Double; out Points1: OleVariant; 
 109                                                     out Points2: OleVariant): IHHomMat2DX;
 110     function MatchRelPoseRansac(const Image2: IHImageX; Rows1: OleVariant; Cols1: OleVariant; 
 111                                 Rows2: OleVariant; Cols2: OleVariant; CamPar1: OleVariant; 
 112                                 CamPar2: OleVariant; const GrayMatchMethod: WideString; 
 113                                 MaskSize: Integer; RowMove: Integer; ColMove: Integer; 
 114                                 RowTolerance: Integer; ColTolerance: Integer; Rotation: OleVariant; 
 115                                 MatchThreshold: OleVariant; const EstimationMethod: WideString; 
 116                                 DistanceThreshold: OleVariant; RandSeed: Integer; 
 117                                 out CovRelPose: OleVariant; out Error: OleVariant; 
 118                                 out Points1: OleVariant; out Points2: OleVariant): OleVariant;
 119     function MatchEssentialMatrixRansac(const Image2: IHImageX; Rows1: OleVariant; 
 120                                         Cols1: OleVariant; Rows2: OleVariant; Cols2: OleVariant; 
 121                                         const CamMat1: IHHomMat2DX; const CamMat2: IHHomMat2DX; 
 122                                         const GrayMatchMethod: WideString; MaskSize: Integer; 
 123                                         RowMove: Integer; ColMove: Integer; RowTolerance: Integer; 
 124                                         ColTolerance: Integer; Rotation: OleVariant; 
 125                                         MatchThreshold: OleVariant; 
 126                                         const EstimationMethod: WideString; 
 127                                         DistanceThreshold: OleVariant; RandSeed: Integer; 
 128                                         out CovEMat: OleVariant; out Error: OleVariant; 
 129                                         out Points1: OleVariant; out Points2: OleVariant): IHHomMat2DX;
 130     function MatchFundamentalMatrixRansac(const Image2: IHImageX; Rows1: OleVariant; 
 131                                           Cols1: OleVariant; Rows2: OleVariant; Cols2: OleVariant; 
 132                                           const GrayMatchMethod: WideString; MaskSize: Integer; 
 133                                           RowMove: Integer; ColMove: Integer; 
 134                                           RowTolerance: Integer; ColTolerance: Integer; 
 135                                           Rotation: OleVariant; MatchThreshold: OleVariant; 
 136                                           const EstimationMethod: WideString; 
 137                                           DistanceThreshold: OleVariant; RandSeed: Integer; 
 138                                           out CovFMat: OleVariant; out Error: Double; 
 139                                           out Points1: OleVariant; out Points2: OleVariant): IHHomMat2DX;
 140     function BinocularDistance(const Image2: IHImageX; out Score: IHImageX; 
 141                                CamParamRect1: OleVariant; CamParamRect2: OleVariant; 
 142                                RelPoseRect: OleVariant; const Method: WideString; 
 143                                MaskWidth: Integer; MaskHeight: Integer; TextureThresh: OleVariant; 
 144                                MinDisparity: Integer; MaxDisparity: Integer; NumLevels: Integer; 
 145                                ScoreThresh: OleVariant; Filter: OleVariant; SubDistance: OleVariant): IHImageX;
 146     function BinocularDisparity(const Image2: IHImageX; out Score: IHImageX; 
 147                                 const Method: WideString; MaskWidth: Integer; MaskHeight: Integer; 
 148                                 TextureThresh: OleVariant; MinDisparity: Integer; 
 149                                 MaxDisparity: Integer; NumLevels: Integer; ScoreThresh: OleVariant; 
 150                                 Filter: OleVariant; const SubDisparity: WideString): IHImageX;
 151     function GenBinocularRectificationMap(CamParam1: OleVariant; CamParam2: OleVariant; 
 152                                           RelPose: OleVariant; SubSampling: Double; 
 153                                           const Method: WideString; const MapType: WideString; 
 154                                           out CamParamRect1: OleVariant; 
 155                                           out CamParamRect2: OleVariant; 
 156                                           out CamPoseRect1: OleVariant; 
 157                                           out CamPoseRect2: OleVariant; out RelPoseRect: OleVariant): IHImageX;
 158     procedure GetSheetOfLightResult(const SheetOfLightModelID: IHSheetOfLightModelX; 
 159                                     ResultName: OleVariant);
 160     procedure ApplySheetOfLightCalibration(const SheetOfLightModelID: IHSheetOfLightModelX);
 161     procedure SetProfileSheetOfLight(const SheetOfLightModelID: IHSheetOfLightModelX; 
 162                                      MovementPoses: OleVariant);
 163     procedure MeasureProfileSheetOfLight(const SheetOfLightModelID: IHSheetOfLightModelX; 
 164                                          MovementPose: OleVariant);
 165     function ShadeHeightField(Slant: OleVariant; Tilt: OleVariant; Albedo: OleVariant; 
 166                               Ambient: OleVariant; const Shadows: WideString): IHImageX;
 167     function EstimateAlAm(out Ambient: OleVariant): OleVariant;
 168     function EstimateSlAlZc(out Albedo: OleVariant): OleVariant;
 169     function EstimateSlAlLr(out Albedo: OleVariant): OleVariant;
 170     function EstimateTiltZc: OleVariant;
 171     function EstimateTiltLr: OleVariant;
 172     function PhotStereo(Slants: OleVariant; Tilts: OleVariant): IHImageX;
 173     function ReconstructHeightFieldFromGradient(const ReconstructionMethod: WideString; 
 174                                                 GenParamName: OleVariant; GenParamValue: OleVariant): IHImageX;
 175     function PhotometricStereo(out Gradient: IHImageX; out Albedo: IHImageX; Slants: OleVariant; 
 176                                Tilts: OleVariant; ResultType: OleVariant; 
 177                                const ReconstructionMethod: WideString; GenParamName: OleVariant; 
 178                                GenParamValue: OleVariant): IHImageX;
 179     function SfsPentland(Slant: OleVariant; Tilt: OleVariant; Albedo: OleVariant; 
 180                          Ambient: OleVariant): IHImageX;
 181     function SfsOrigLr(Slant: OleVariant; Tilt: OleVariant; Albedo: OleVariant; Ambient: OleVariant): IHImageX;
 182     function SfsModLr(Slant: OleVariant; Tilt: OleVariant; Albedo: OleVariant; Ambient: OleVariant): IHImageX;
 183     function FindText(const TextModel: IHTextModelX): IHTextResultX;
 184     function ClassifyImageClassLut(const ClassLUTHandle: IHClassLUTX): IHRegionX;
 185     function ClassifyImageClassKnn(out DistanceImage: IHImageX; const KNNHandle: IHClassKnnX; 
 186                                    RejectionThreshold: Double): IHRegionX;
 187     procedure AddSamplesImageClassKnn(const ClassRegions: IHRegionX; const KNNHandle: IHClassKnnX);
 188     function ClassifyImageClassGmm(const GMMHandle: IHClassGmmX; RejectionThreshold: Double): IHRegionX;
 189     procedure AddSamplesImageClassGmm(const ClassRegions: IHRegionX; const GMMHandle: IHClassGmmX; 
 190                                       Randomize: Double);
 191     function ClassifyImageClassSvm(const SVMHandle: IHClassSvmX): IHRegionX;
 192     procedure AddSamplesImageClassSvm(const ClassRegions: IHRegionX; const SVMHandle: IHClassSvmX);
 193     function ClassifyImageClassMlp(const MLPHandle: IHClassMlpX; RejectionThreshold: Double): IHRegionX;
 194     procedure AddSamplesImageClassMlp(const ClassRegions: IHRegionX; const MLPHandle: IHClassMlpX);
 195     function LearnNdimNorm(const Foreground: IHRegionX; const Background: IHRegionX; 
 196                            const Metric: WideString; Distance: OleVariant; 
 197                            MinNumberPercent: OleVariant; out Center: OleVariant; out Quality: Double): OleVariant;
 198     procedure LearnNdimBox(const Foreground: IHRegionX; const Background: IHRegionX; 
 199                            const ClassifHandle: IHClassBoxX);
 200     function ClassNdimBox(const ClassifHandle: IHClassBoxX): IHRegionX;
 201     function ClassNdimNorm(const Metric: WideString; const SingleMultiple: WideString; 
 202                            Radius: OleVariant; Center: OleVariant): IHRegionX;
 203     function Class2DimSup(const ImageRow: IHImageX; const FeatureSpace: IHRegionX): IHRegionX;
 204     function Class2DimUnsup(const Image2: IHImageX; Threshold: Integer; NumClasses: Integer): IHRegionX;
 205     function CheckDifference(const Pattern: IHImageX; const Mode: WideString; 
 206                              DiffLowerBound: Integer; DiffUpperBound: Integer; GrayOffset: Integer; 
 207                              AddRow: Integer; AddCol: Integer): IHRegionX;
 208     function CharThreshold(const HistoRegion: IHRegionX; Sigma: Double; Percent: OleVariant; 
 209                            out Threshold: OleVariant): IHRegionX;
 210     function LabelToRegion: IHRegionX;
 211     function NonmaxSuppressionAmp(const Mode: WideString): IHImageX;
 212     function NonmaxSuppressionDir(const ImgDir: IHImageX; const Mode: WideString): IHImageX;
 213     function HysteresisThreshold(Low: OleVariant; High: OleVariant; MaxLength: Integer): IHRegionX;
 214     function VarThreshold(MaskWidth: Integer; MaskHeight: Integer; StdDevScale: OleVariant; 
 215                           AbsThreshold: OleVariant; const LightDark: WideString): IHRegionX;
 216     function DynThreshold(const ThresholdImage: IHImageX; Offset: OleVariant; 
 217                           const LightDark: WideString): IHRegionX;
 218     function Threshold(MinGray: OleVariant; MaxGray: OleVariant): IHRegionX;
 219     function ThresholdSubPix(Threshold: OleVariant): IHXLDContX;
 220     function RegiongrowingN(const Metric: WideString; MinTolerance: OleVariant; 
 221                             MaxTolerance: OleVariant; MinSize: Integer): IHRegionX;
 222     function Regiongrowing(Row: Integer; Column: Integer; Tolerance: OleVariant; MinSize: Integer): IHRegionX;
 223     function RegiongrowingMean(StartRows: OleVariant; StartColumns: OleVariant; Tolerance: Double; 
 224                                MinSize: Integer): IHRegionX;
 225     function Pouring(const Mode: WideString; MinGray: Integer; MaxGray: Integer): IHRegionX;
 226     function WatershedsThreshold(Threshold: OleVariant): IHRegionX;
 227     function Watersheds(out Watersheds: IHRegionX): IHRegionX;
 228     function ZeroCrossing: IHRegionX;
 229     function ZeroCrossingSubPix: IHXLDContX;
 230     function DualThreshold(MinSize: Integer; MinGray: Double; Threshold: Double): IHRegionX;
 231     function ExpandLine(Coordinate: Integer; const ExpandType: WideString; 
 232                         const RowColumn: WideString; Threshold: OleVariant): IHRegionX;
 233     function LocalMin: IHRegionX;
 234     function Lowlands: IHRegionX;
 235     function LowlandsCenter: IHRegionX;
 236     function LocalMax: IHRegionX;
 237     function Plateaus: IHRegionX;
 238     function PlateausCenter: IHRegionX;
 239     function AutoThreshold(Sigma: OleVariant): IHRegionX;
 240     function BinThreshold: IHRegionX;
 241     function FastThreshold(MinGray: OleVariant; MaxGray: OleVariant; MinSize: Integer): IHRegionX;
 242     function ExpandGray(const Regions: IHRegionX; const ForbiddenArea: IHRegionX; 
 243                         Iterations: OleVariant; const Mode: WideString; Threshold: OleVariant): IHRegionX;
 244     function ExpandGrayRef(const Regions: IHRegionX; const ForbiddenArea: IHRegionX; 
 245                            Iterations: OleVariant; const Mode: WideString; RefGray: OleVariant; 
 246                            Threshold: OleVariant): IHRegionX;
 247     function ObjDiff(const ObjectsSub: IHImageX): IHImageX;
 248     procedure SetGrayval(Row: OleVariant; Column: OleVariant; Grayval: OleVariant);
 249     function PaintXld(const XLD: IHXLDX; Grayval: OleVariant): IHImageX;
 250     function PaintRegion(const Region: IHRegionX; Grayval: OleVariant; const Type_: WideString): IHImageX;
 251     procedure OverpaintRegion(const Region: IHRegionX; Grayval: OleVariant; const Type_: WideString);
 252     function GenImageProto(Grayval: OleVariant): IHImageX;
 253     function PaintGray(const ImageDestination: IHImageX): IHImageX;
 254     procedure OverpaintGray(const ImageSource: IHImageX);
 255     procedure IntegerToObj(SurrogateTuple: OleVariant);
 256     function ObjToInteger(Index: Integer; Number: Integer): OleVariant;
 257     function CopyObj(Index: Integer; NumObj: Integer): IHImageX;
 258     function ConcatObj(const Objects2: IHImageX): IHImageX;
 259     function CopyImage: IHImageX;
 260     function SelectObj(Index: OleVariant): IHImageX;
 261     function TestEqualObj(const Objects2: IHImageX): Integer;
 262     function CountObj: Integer;
 263     function GetChannelInfo(const Request: WideString; Channel: OleVariant): OleVariant;
 264     function GetObjClass: OleVariant;
 265     procedure GenImageInterleaved(PixelPointer: Integer; const ColorFormat: WideString; 
 266                                   OriginalWidth: Integer; OriginalHeight: Integer; 
 267                                   Alignment: Integer; const Type_: WideString; ImageWidth: Integer; 
 268                                   ImageHeight: Integer; StartRow: Integer; StartColumn: Integer; 
 269                                   BitsPerChannel: Integer; BitShift: Integer);
 270     procedure GenImage3(const Type_: WideString; Width: Integer; Height: Integer; 
 271                         PixelPointerRed: Integer; PixelPointerGreen: Integer; 
 272                         PixelPointerBlue: Integer);
 273     procedure GenImage1(const Type_: WideString; Width: Integer; Height: Integer; 
 274                         PixelPointer: Integer);
 275     procedure GenImageConst(const Type_: WideString; Width: Integer; Height: Integer);
 276     procedure GenEmptyObj;
 277     procedure GenImageGrayRamp(Alpha: Double; Beta: Double; Mean: Double; Row: Integer; 
 278                                Column: Integer; Width: Integer; Height: Integer);
 279     procedure< 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Delphi实现TreeView结点拖拽的实例(转)发布时间:2022-07-18
下一篇:
delphi的插件机制与自动更新发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap