trying to implement the canny edge using opencv on qt creator [closed]

I have made a small changes its perfectly working

void MainWindow::edgeImage()
{
image =cvLoadImage(FileName.toLocal8Bit().data());
Gray = cvCreateImage(cvSize(image->width,image->height),IPL_DEPTH_8U,1 );
cvCvtColor(image, Gray, CV_RGB2GRAY);
canny= cvCreateImage(cvSize(image->width,image->height),IPL_DEPTH_8U,1 );
cvCanny(Gray,canny,50,150,3);
QImage imgCanny = QImage((const unsigned char*)canny->imageData,canny->width,canny->height,QImage::Format_Indexed8);
imgCanny.setPixel(0,0,qRgb(0,0,0));
ui->label_3->setPixmap(QPixmap::fromImage(imgCanny).scaled(ui->label_3->size()));
}

Leave a Comment