dual cam verssion
This commit is contained in:
parent
fd7df4545e
commit
18e2f3080d
@ -163,7 +163,7 @@ MIL_INT ProcessingFunction0(MIL_INT HookType, MIL_ID HookId, void *HookDataPtr)
|
||||
//拷贝存图图像
|
||||
MbufCopy(ModifiedBufferId0,MilImage0);
|
||||
//Mil保存路径
|
||||
QString MilImgPath = QString("C:/Users/Pc/Desktop/cotton_double2/Img1/%1.bmp").arg(FuncCount0);
|
||||
QString MilImgPath = QString("C:/Users/Administrator/Desktop/1/%1.bmp").arg(FuncCount0);
|
||||
MIL_STRING MilImagePath = MilImgPath.toStdWString();
|
||||
MbufExport(MilImagePath,M_BMP,MilImage0);
|
||||
qDebug()<<"回调1成功存储照片:"<<FuncCount0<<"张";
|
||||
@ -227,7 +227,7 @@ MIL_INT ProcessingFunction1(MIL_INT HookType, MIL_ID HookId, void *HookDataPtr)
|
||||
//拷贝存图数据
|
||||
MbufCopy(ModifiedBufferId1,MilImage1);
|
||||
//Mil保存路径
|
||||
QString MilImgPath = QString("C:/Users/Pc/Desktop/cotton_double2/Img2/%1.bmp").arg(FuncCount1);
|
||||
QString MilImgPath = QString("C:/Users/Administrator/Desktop/2/%1.bmp").arg(FuncCount1);
|
||||
MIL_STRING MilImagePath = MilImgPath.toStdWString();
|
||||
MbufExport(MilImagePath,M_BMP,MilImage1);
|
||||
qDebug()<<"回调2成功存储照片:"<<FuncCount1<<"张";
|
||||
|
||||
21
config/2.dcf
21
config/2.dcf
@ -17,12 +17,13 @@
|
||||
/
|
||||
/
|
||||
/
|
||||
/
|
||||
[CAMERA_NAME]
|
||||
no name
|
||||
[CONFIG_FILE]
|
||||
50CF
|
||||
ODYSSEY
|
||||
Mon Dec 9 16:10:06 2024
|
||||
Sun Dec 22 20:52:23 2024
|
||||
[INFO_FILE_REV]
|
||||
0010.0019.0000
|
||||
RADIENT/eVCL/DUAL
|
||||
@ -119,8 +120,8 @@ VDT_HSYNC_FREQ
|
||||
VDT_VSYNC 0x0
|
||||
VDT_VBPORCH 0x0
|
||||
VDT_VFPORCH 0x0
|
||||
VDT_VACTIVE 0x400
|
||||
VDT_VTOTAL 0x400
|
||||
VDT_VACTIVE 0x200
|
||||
VDT_VTOTAL 0x200
|
||||
VDT_VSYNC_FREQ 0x0
|
||||
VDT_CL_IMAGE_SIZE_X 0x0
|
||||
VDT_CL_IMAGE_SIZE_Y 0x0
|
||||
@ -1560,8 +1561,8 @@ DEF_ADD_HACTIVE_MULTIPLEX
|
||||
DEF_ADD_VACTIVE_MULTIPLEX 0x0
|
||||
DEF_HTOTAL_ENTRY 0x1000
|
||||
DEF_HACTIVE_ENTRY 0x1000
|
||||
DEF_VTOTAL_ENTRY 0x400
|
||||
DEF_VACTIVE_ENTRY 0x400
|
||||
DEF_VTOTAL_ENTRY 0x200
|
||||
DEF_VACTIVE_ENTRY 0x200
|
||||
DEF_CL_NEW_HCROPPING 0x0
|
||||
DEF_CL_NEW_VCROPPING 0x0
|
||||
DEF_NTSC 0x0
|
||||
@ -1582,7 +1583,7 @@ DEF_ADD_HTOTAL_EQUA_HEVAL
|
||||
DEF_HOR_COUNT_MAX_BITWISE 0xffff
|
||||
DEF_VERT_COUNT_MAX_BITWISE 0xffff
|
||||
DEF_DIG_HTOTAL 0x1002
|
||||
DEF_DIG_VTOTAL 0x3ff
|
||||
DEF_DIG_VTOTAL 0x1ff
|
||||
DEF_TEST_MODE_HFP_MIN 0x0
|
||||
DEF_TEST_MODE_HSY_HBP_MIN_CL 0x0
|
||||
DEF_TEST_MODE_VFP_MIN 0x0
|
||||
@ -1729,7 +1730,7 @@ DEF_DIG1_BYTESORDER
|
||||
INFO_CUSTOM 0x0
|
||||
INFO_REGISTER_REV 0x1
|
||||
INFO_XSIZE 0x1000
|
||||
INFO_YSIZE 0x400
|
||||
INFO_YSIZE 0x200
|
||||
INFO_TYPE 0x1
|
||||
INFO_BAYER 0x0
|
||||
INFO_BURSTSIZE 0x0
|
||||
@ -1933,7 +1934,7 @@ DIG_HSCLM
|
||||
DIG_HECLM 0x0
|
||||
DIG_HCTL 0x1e0
|
||||
DIG_VCNT 0x1
|
||||
DIG_VTOTAL 0x3ff
|
||||
DIG_VTOTAL 0x1ff
|
||||
DIG_VSCNT 0x0
|
||||
DIG_VECNT 0x0
|
||||
DIG_VSSYNC 0x0
|
||||
@ -2348,5 +2349,5 @@ DIG_IOCTL1H
|
||||
DIG_IOCTL0_L not_modified
|
||||
DIG_ENCTL not_modified
|
||||
[EOF]
|
||||
00007FF687B3AAA8 0x400b8
|
||||
00007FF687B3AA90 0x48b1c582
|
||||
00007FF72205AAA8 0x400bb
|
||||
00007FF72205AA90 0x2b19a5ff
|
||||
@ -15,19 +15,22 @@ QPixmap ImageUtils::mat2QPixmap(const cv::Mat& mat)
|
||||
// 灰度图像
|
||||
img = QImage(mat.data, mat.cols, mat.rows, static_cast<int>(mat.step), QImage::Format_Grayscale8).copy();
|
||||
}
|
||||
else if(mat.channels() == 3){
|
||||
else if(mat.channels() == 3)
|
||||
{
|
||||
// 彩色图像 (OpenCV 默认是 BGR,需要转换为 RGB)
|
||||
cv::Mat rgb;
|
||||
cv::cvtColor(mat, rgb, cv::COLOR_BGR2RGB);
|
||||
img = QImage(rgb.data, rgb.cols, rgb.rows, static_cast<int>(rgb.step), QImage::Format_RGB888).copy();
|
||||
}
|
||||
else if(mat.channels() == 4){
|
||||
else if(mat.channels() == 4)
|
||||
{
|
||||
// 如果需要处理带有透明通道的图像 (BGRA 转 RGBA)
|
||||
cv::Mat rgba;
|
||||
cv::cvtColor(mat, rgba, cv::COLOR_BGRA2RGBA);
|
||||
img = QImage(rgba.data, rgba.cols, rgba.rows, static_cast<int>(rgba.step), QImage::Format_RGBA8888).copy();
|
||||
}
|
||||
else{
|
||||
else
|
||||
{
|
||||
// 不支持的图像格式
|
||||
std::cout << "Unsupported Mat format with channels:" << mat.channels();
|
||||
return QPixmap();
|
||||
|
||||
15
ui_widget.h
15
ui_widget.h
@ -37,10 +37,10 @@ public:
|
||||
QLabel *lab_info;
|
||||
QPushButton *pushButton;
|
||||
QPushButton *btn_stop;
|
||||
QLabel *camera_0_img;
|
||||
QLabel *camera_1_img;
|
||||
QLabel *label_2;
|
||||
QLabel *label_3;
|
||||
QLabel *camera_0_img;
|
||||
QWidget *tab_3;
|
||||
QLabel *label_title_3;
|
||||
QGroupBox *groupBox_4;
|
||||
@ -130,11 +130,6 @@ public:
|
||||
btn_stop = new QPushButton(tab_2);
|
||||
btn_stop->setObjectName("btn_stop");
|
||||
btn_stop->setGeometry(QRect(20, 190, 101, 41));
|
||||
camera_0_img = new QLabel(tab_2);
|
||||
camera_0_img->setObjectName("camera_0_img");
|
||||
camera_0_img->setGeometry(QRect(160, 40, 591, 191));
|
||||
camera_0_img->setStyleSheet(QString::fromUtf8("background-color: rgb(129, 129, 129);\n"
|
||||
"border: 4px solid black;"));
|
||||
camera_1_img = new QLabel(tab_2);
|
||||
camera_1_img->setObjectName("camera_1_img");
|
||||
camera_1_img->setGeometry(QRect(160, 290, 591, 191));
|
||||
@ -147,6 +142,12 @@ public:
|
||||
label_3 = new QLabel(tab_2);
|
||||
label_3->setObjectName("label_3");
|
||||
label_3->setGeometry(QRect(160, 20, 141, 16));
|
||||
camera_0_img = new QLabel(tab_2);
|
||||
camera_0_img->setObjectName("camera_0_img");
|
||||
camera_0_img->setGeometry(QRect(160, 50, 591, 191));
|
||||
camera_0_img->setStyleSheet(QString::fromUtf8("background-color: rgb(129, 129, 129);\n"
|
||||
"border: 4px solid black;"));
|
||||
camera_0_img->setLineWidth(1);
|
||||
tabWidget->addTab(tab_2, QString());
|
||||
tab_3 = new QWidget();
|
||||
tab_3->setObjectName("tab_3");
|
||||
@ -238,10 +239,10 @@ public:
|
||||
lab_info->setText(QCoreApplication::translate("Widget", "\345\207\206\345\244\207\344\270\255", nullptr));
|
||||
pushButton->setText(QCoreApplication::translate("Widget", "\345\274\200\345\247\213\345\210\206\351\200\211", nullptr));
|
||||
btn_stop->setText(QCoreApplication::translate("Widget", "\345\201\234\346\255\242\345\210\206\351\200\211", nullptr));
|
||||
camera_0_img->setText(QString());
|
||||
camera_1_img->setText(QString());
|
||||
label_2->setText(QCoreApplication::translate("Widget", "\347\233\270\346\234\2721\357\274\210\351\253\230\344\276\247/\346\260\224\347\275\220\344\276\247\357\274\211", nullptr));
|
||||
label_3->setText(QCoreApplication::translate("Widget", "\347\233\270\346\234\2720\357\274\210\344\275\216\344\276\247/\345\207\272\351\243\216\345\217\243\344\276\247\357\274\211", nullptr));
|
||||
camera_0_img->setText(QString());
|
||||
tabWidget->setTabText(tabWidget->indexOf(tab_2), QCoreApplication::translate("Widget", "Tab 2", nullptr));
|
||||
label_title_3->setText(QCoreApplication::translate("Widget", "\345\217\202\346\225\260\350\256\276\347\275\256\347\225\214\351\235\242", nullptr));
|
||||
groupBox_4->setTitle(QCoreApplication::translate("Widget", "\344\270\213\344\275\215\346\234\272\345\217\202\346\225\260", nullptr));
|
||||
|
||||
@ -27,6 +27,7 @@ Widget::Widget(QWidget *parent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->camera_0_img->setScaledContents(true);
|
||||
ui->camera_1_img->setScaledContents(true);
|
||||
|
||||
|
||||
iniColor();
|
||||
@ -88,7 +89,7 @@ void Widget::refreshSingleImage(int camera_id, bool overlay_result)
|
||||
{
|
||||
QMutexLocker locker(&gDispPicMutex1);
|
||||
current_id = gDispCurrentPicId1;
|
||||
|
||||
}
|
||||
if (current_id == 0)
|
||||
return;
|
||||
cv::Mat img = ImageUtils::mil2Mat(current_id);
|
||||
@ -108,8 +109,6 @@ void Widget::refreshSingleImage(int camera_id, bool overlay_result)
|
||||
if (!pixmap1.isNull())
|
||||
{
|
||||
ui->camera_1_img->setPixmap(pixmap1);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
37
widget.ui
37
widget.ui
@ -300,23 +300,6 @@
|
||||
<string>停止分选</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="camera_0_img">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>160</x>
|
||||
<y>40</y>
|
||||
<width>591</width>
|
||||
<height>191</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(129, 129, 129);
|
||||
border: 4px solid black;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="camera_1_img">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
@ -363,6 +346,26 @@ border: 4px solid black;</string>
|
||||
<string>相机0(低侧/出风口侧)</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="camera_0_img">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>160</x>
|
||||
<y>50</y>
|
||||
<width>591</width>
|
||||
<height>191</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(129, 129, 129);
|
||||
border: 4px solid black;</string>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_3">
|
||||
<attribute name="title">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user