I'm very sorry that I've been busy before.,So I didn't come back to reply.,Then I've found the problem.,Now I'm back to answer the question I hope it can help you.,The main reason is that the default frame rate of my device's camera is the lowest, resulting in the number of frames being too low to cause Caton.,So I increased the number of frames to get it solved.
void ThreadGetCamPic::run()
{
bool ret = stVideoCaptrue.open(0);
//The code in the horizontal line is currently known to be only valid for the RK35xx series cameras, if there is a problem with the camera turned on, it should be here, just comment it out, and it is also the reason to solve the freeze of the camera acquisition screen
/*---------------------------------------------------------------------------------*/
// stVideoCaptrue.set(cv::CAP_PROP_FRAME_WIDTH, 800);
// stVideoCaptrue.set(cv::CAP_PROP_FRAME_HEIGHT, 600);
// stVideoCaptrue.set(cv::CAP_PROP_FPS, 20);
/*---------------------------------------------------------------------------------*/
Mat matTemp;
// QImage img;
m_bStop = false;
while(!m_bStop){
stVideoCaptrue>>matTemp;
if(matTemp.empty()){
msleep(50);
continue;
}
img = QImage(matTemp.data,matTemp.cols,matTemp.rows,matTemp.step,QImage::Format_RGB888).copy();
img = convertRGB888toBGR888UsingOpenCV(img);
emit sigSendCurImg(img);
}
}