You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
765 B
41 lines
765 B
#include "bila.h" |
|
|
|
bila::bila(QObject *parent) |
|
: QObject{parent} |
|
{ |
|
thread = new QThread(); |
|
thread->start(); |
|
this->moveToThread(thread); |
|
ready = false; |
|
} |
|
|
|
void bila::setparas(int r, double sigmac, double sigmar) |
|
{ |
|
this->r = r; |
|
this->sigmac = sigmac; |
|
this->sigmar = sigmar; |
|
ready = true; |
|
} |
|
|
|
void bila::off() |
|
{ |
|
ready = false; |
|
} |
|
|
|
void bila::slotprocimg(cv::Mat img) |
|
{ |
|
if(ready){ |
|
cv::Mat temp; |
|
cv::Mat tempd; |
|
cv::Mat dst; |
|
img.convertTo(temp,CV_32FC1); |
|
cv::bilateralFilter(temp,tempd,2*r+1,sigmac,sigmar); |
|
tempd.convertTo(dst,CV_16UC1); |
|
emit signalsendimg(dst); |
|
} |
|
else{ |
|
cv::Mat temp; |
|
img.copyTo(temp); |
|
emit signalsendimg(temp); |
|
} |
|
}
|
|
|