VS2013和halcon聯合程式設計示例程式之hough_lines
#include"HalconCpp.h"
using namespace std;
using namespace HalconCpp;
int main()
{
HImage image;
image.ReadImage("fabrik");
HImage ImageReduce = image.Rectangle1Domain(230,180,330,280);
HImage EdgesAmp = ImageReduce.SobelAmp("thin_sum_abs", 3);
HRegion Region = EdgesAmp.Threshold(10,255);
HTuple Dist;
HTuple Angle = Region.HoughLines(4,50,5,5, &Dist);
HRegion Regions;
Regions.GenRegionHline(Angle,Dist);
Hlong width, height;
image.GetImageSize(&width,&height);
HWindow w(0, 0, width, height);
image.DispImage(w);
w.Click();
w.ClearWindow();
ImageReduce.DispImage(w);
w.Click();
w.ClearWindow();
EdgesAmp.DispImage(w);
w.Click();
w.ClearWindow();
Region.DispRegion(w);
w.Click();
w.ClearWindow();
Regions.DispRegion(w);
w.Click();
w.CloseWindow();
}