Hi
I want to use the thermal camera in my program, this is the code I wrote for a normal camera that connects via USB, but when I connect the thermal camera to the same USB port, the image looks like this:
and this is my code
void MainWindow::on_btn_thermal_start_clicked()
{
thermalCap.open(1);
if(!thermalCap.isOpened()) // Check if we succeeded
{
cout << "camera is not open" << endl;
errordialog("Thermal_camera is not open" );
}
else
{
cout << "camera is open" << endl;
Thermal_CameraTimeout_Func();
}
}
void MainWindow::Thermal_update_PicInWindow()
{
//thermal
thermalCap >> thermalFrame;
flip(thermalFrame, thermalFrame, 1);
cvtColor(thermalFrame, thermalFrame,COLOR_BGR2RGB);
thermalImage = QImage((const unsigned char*) (thermalFrame.data),
thermalFrame.cols, thermalFrame.rows, QImage::Format_RGB888);
ui->lbl_thermal->setPixmap(QPixmap::fromImage(thermalImage));
ui->lbl_thermal->resize(ui->lbl_thermal->pixmap()->size());
}
void MainWindow::Thermal_CameraTimeout_Func()
{
if (!(timerthermalVideo->isActive()))
{
timerthermalVideo->start(50);
ui->btn_thermal_start->setText("STOP_Camera");
Thermal_update_PicInWindow();
}
else if (timerthermalVideo->isActive())
{
timerthermalVideo->stop();
ui->btn_thermal_start->setText("START_Camera");
thermalCap.release();
}
}
i am using lepton flir 2(thermal camera) and qt5 and windows10
I noticed that my thermal camera image on Google (webcam test) is also gray, but in Firefox (webcam test) it is the natural color, the difference between the two sites is in the image mode and in the video standard.
In Google, which displays an image similar to my program:
Image mode = gray scale
Video standard = ???
And in Firefox this information is equal to
Image mode = rgb
Video standard = QQVGA
Can this information be changed in qt or opencv? How?