Mylabel(QWidget* parent =Q_NULLPTR);~Mylabel();//设置Halcon图像和Halcon窗口句柄,用户响应鼠标事件后实时更新图像voidsetHalconWnd(HObject img, HTuple hHalconID, QLabel*label);//鼠标滚轮缩放事件voidwheelEvent(QWheelEvent*ev);//鼠标按下事件voidmousePressEvent(QMouseEvent*ev);//鼠标释放事件voidmous...
1、Halcon读取相对路径下的图像//.h Hlong m_winID; //窗口ID HTuple m_windowHandle;//窗口句柄 HObject m_image; //窗体显示图像 HTuple m_imageWidth, m_imageHeight;//初始化:窗口绑定Halcon句柄 m_winID = (Hlong)this->ui.ImageWidget->winId(); SetWindowAttr("background_color", "black")...
读取Halcon类型的图像显示在Qt上的窗体界面: QImage img = ho_Image; if (img.isNull()) { ui->label_pic->setPixmap(QPixmap(":/res/icons/picture.png")); } else { ui->label_pic->setPixmap(QPixmap::fromImage(img).scaled(ui->label_pic->width(), \ ui->label_pic->height(), Qt::K...
第二,为了方便:我们将halcon安装目录下的include,lib文件夹拷贝到 这个halcon工程目录下: 第三,接着就是在.pro文件中添加包含目录和库目录。因为我们直接拷贝过来的所以目录比较简单 然后是cpp中的源码: #include "mainwindow.h" #include "ui_mainwindow.h" #include<QString> #include "halconCpp.h" using n...
}//设置Halcon图像和Halcon窗口句柄,用户响应鼠标事件后实时更新图像voidMylabel::setHalconWnd(HObject img, HTuple hHalconID, QLabel* label) { m_hHalconID = hHalconID; m_currentImg = img; m_label = label; }//鼠标滚轮缩放事件,用于缩放图像voidMylabel::wheelEvent(QWheelEvent* ev) ...
windID= (Hlong)this->label->winId();//获取label句柄OpenWindow(0,0,label->width(),label->height(),windID,"visible","",&hv_WindowHandle);//把label转换成halcon窗口ReadImage(&ho_Image,"D:/bb/tu/ma.jpg"); HTuple hv_Width,hv_Height; ...
(1)OpenWindow():将PictureControl控件的大小传给m_HWindowID,作为开辟的Halcon窗口的大小,这样两个窗口可以叠加在一起了。(2)GetImageSize():获取ho_Image图片的尺寸(3)SetPart()函数:是调整图片在窗口中的位置(设定图片左上角坐标和右下角坐标)四、Qt&Halcon进行图像读取...
Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Cancel Create saved search Sign in Sign up Reseting focus {{ message }} zzy242796 / qt-halcon Public Notifications You must be signed in to change notification settings Fork 0 Star 0 ...
(d,'f',3);ui->labDev->setText(strDev);//记录最大偏差值if(hv_PreDeviation<hv_Deviation){hv_PreDeviation=hv_Deviation;}}catch(HalconCpp::HException&except){qDebug()<<except.ProcName().Text()<<endl;qDebug()<<except.ErrorMessage().Text()<<endl;qDebug()<<except.ErrorCode()<<endl...
在机器视觉的开发中,现在有很多通过电机去做相机的聚焦调节,对比手工调节,自动调节效果更好,而且其也能满足设备自动的需求,尤其在一些高倍成像的环境下...