├── dockwidget.cpp ├── modify_path.py ├── README.MD ├── README.MD~ ├── nms.h ├── dockwidget.h ├── main.cpp ├── detector_warpper.h ├── Image_detection.pro ├── mainwindow.ui ├── mainwindow.h ├── image_detection.h ├── nms.cpp ├── detector_warpper.cpp ├── dockwidget.ui ├── mainwindow.cpp ├── image_detection.cpp ├── Image_detection.pro.user └── Image_detection.pro.user.0e12a15 /dockwidget.cpp: -------------------------------------------------------------------------------- 1 | #include "dockwidget.h" 2 | 3 | DockWidget::DockWidget(QWidget* parent):QDockWidget(parent) 4 | { 5 | ui.setupUi(this); 6 | 7 | this->setFixedWidth(200); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /modify_path.py: -------------------------------------------------------------------------------- 1 | import sys 2 | sys.path.append('/home/wsf/store/caffes/faster/py-faster-rcnn/lib') 3 | sys.path.append('/home/wsf/store/caffes/faster/py-faster-rcnn/caffe-fast-rcnn/python') 4 | print "import finished!" 5 | -------------------------------------------------------------------------------- /README.MD: -------------------------------------------------------------------------------- 1 | **本程序将py-faster-rcnn训练后的模型移植入Qt GUI程序中** 2 | * 需要使用boost中的Python库来使用Python Layer,由于将Python Layer代码路径加入$PYTHONPATH后仍然在不能找到Boost.Python中不能找到对应的module,所以使用modify_path.py手动导入路径。需要将modify_path.py手动放入usr/lib 3 | * 依赖库的路径需要根据本地环境重新进行修改 4 | -------------------------------------------------------------------------------- /README.MD~: -------------------------------------------------------------------------------- 1 | **本程序将py-faster-rcnn训练后的模型移植入Qt GUI程序中** 2 | * 需要使用boost中的Python库来使用Python Layer,由于将Python Layer代码路径加入$PYTHONPATH后仍然在不能找到Boost.Python中不能找到对应的module,所以使用modify_path.py手动导入路径。需要将modify_path.py手动放入usr/lib 3 | * 依赖库的路径需要根据本地环境重新进行修改 4 | -------------------------------------------------------------------------------- /nms.h: -------------------------------------------------------------------------------- 1 | #ifndef NMS_H 2 | #define NMS_H 3 | #include 4 | using namespace std; 5 | class nms 6 | { 7 | public: 8 | nms()=delete; 9 | static vector> NonMaxSpu(vector> corrd_score,float threshold); 10 | 11 | }; 12 | 13 | #endif // NMS_H 14 | -------------------------------------------------------------------------------- /dockwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef DOCKWIDGET_H 2 | #define DOCKWIDGET_H 3 | #include 4 | #include "ui_dockwidget.h" 5 | class DockWidget:public QDockWidget 6 | { 7 | Q_OBJECT 8 | public: 9 | DockWidget(QWidget *parent = nullptr); 10 | public: 11 | Ui::DockWidget ui; 12 | 13 | 14 | signals: 15 | 16 | public slots: 17 | }; 18 | 19 | #endif // DOCKWIDGET_H 20 | -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include "image_detection.h" 11 | #include 12 | #include 13 | using namespace std; 14 | using namespace caffe; 15 | using namespace boost::python; 16 | Q_DECLARE_METATYPE(std::string) 17 | int main(int argc,char** argv) 18 | { 19 | 20 | 21 | qRegisterMetaType("std::string"); 22 | //you need to do above both to enable queued signal-slots 23 | 24 | QApplication a(argc, argv); 25 | MainWindow w; 26 | w.show(); 27 | 28 | 29 | return a.exec(); 30 | } 31 | -------------------------------------------------------------------------------- /detector_warpper.h: -------------------------------------------------------------------------------- 1 | #ifndef DETECTOR_WARPPER_H 2 | #define DETECTOR_WARPPER_H 3 | #include 4 | #include 5 | #include 6 | #include 7 | class image_detection; 8 | class detector_warpper : public QObject 9 | { 10 | Q_OBJECT 11 | public: 12 | explicit detector_warpper(QObject *parent = 0); 13 | std::vector>> return_detec_result(); 14 | private: 15 | std::shared_ptr detector; 16 | std::shared_ptr> cls_inx_name; 17 | std::vector> det_ret; 18 | double nums_threshold; 19 | double score_threshold; 20 | bool has_result; 21 | std::set cls_to_dis; 22 | signals: 23 | void detect_finished(); 24 | public slots: 25 | void change_nums_threshold(double new_threshold); 26 | void change_score_threshold(double new_threshold); 27 | void detect(std::string image_path); 28 | };// 29 | 30 | #endif // DETECTOR_WARPPER_H 31 | -------------------------------------------------------------------------------- /Image_detection.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2016-04-21T10:27:10 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | CONFIG +=c++11 9 | 10 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 11 | 12 | TARGET = Image_detection 13 | TEMPLATE = app 14 | SOURCES += main.cpp\ 15 | mainwindow.cpp \ 16 | image_detection.cpp \ 17 | nms.cpp \ 18 | dockwidget.cpp \ 19 | detector_warpper.cpp 20 | 21 | HEADERS += mainwindow.h \ 22 | image_detection.h \ 23 | nms.h \ 24 | dockwidget.h \ 25 | detector_warpper.h 26 | 27 | FORMS += mainwindow.ui \ 28 | dockwidget.ui 29 | 30 | INCLUDEPATH += /home/vcc/caffe_depen/caffe-fast-rcnn/include \ 31 | /usr/include/opencv /usr/include/opencv2 \ 32 | 33 | 34 | 35 | LIBS += -L/home/vcc/caffe_depen/lib -lcaffe -lcblas -latlas 36 | 37 | LIBS+= -L/usr/local/lib -lglog -lgflags -lprotobuf -lleveldb -lsnappy -llmdb -lboost_system -lhdf5_hl -lhdf5 -lm -lopencv_core -lopencv_highgui -lopencv_imgproc -lboost_thread -lstdc++ -lprotobuf 38 | INCLUDEPATH +=/usr/include/python2.7/ 39 | INCLUDEPATH +=/usr/include/ 40 | LIBS += -lboost_python -lpython2.7 -lboost_system 41 | -------------------------------------------------------------------------------- /mainwindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 1079 10 | 660 11 | 12 | 13 | 14 | 城市部件提取与市容环境要素检测系统 15 | 16 | 17 | 18 | 19 | 20 | 180 21 | -10 22 | 881 23 | 591 24 | 25 | 26 | 27 | QAbstractScrollArea::AdjustToContents 28 | 29 | 30 | 31 | 32 | 33 | 34 | 0 35 | 0 36 | 1079 37 | 25 38 | 39 | 40 | 41 | 42 | 43 | TopToolBarArea 44 | 45 | 46 | false 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "dockwidget.h" 8 | #include 9 | #include 10 | class image_detection; 11 | namespace Ui { 12 | class MainWindow; 13 | 14 | } 15 | class detector_warpper; 16 | 17 | class MainWindow : public QMainWindow 18 | { 19 | Q_OBJECT 20 | 21 | public: 22 | explicit MainWindow(QWidget *parent = 0); 23 | virtual ~MainWindow(); 24 | 25 | private: 26 | Ui::MainWindow *ui; 27 | QPixmap image; 28 | std::shared_ptr imageObject; 29 | std::shared_ptr scene; 30 | DockWidget* dock_object; 31 | std::string imagePath; 32 | std::shared_ptr warpper; 33 | std::vector>> det_ret; 34 | std::set cls_filter; 35 | double scale; 36 | int image_height; 37 | int image_width; 38 | 39 | public slots: 40 | void LoadImgClicked(); 41 | void detect(); 42 | void change_score(double thres); 43 | void change_nms(double thres); 44 | void update_scene(); 45 | void rescale_image(int value); 46 | void update_bus(int state); 47 | void update_bicycle(int state); 48 | void update_car(int state); 49 | void update_motor(int state); 50 | void update_person(int state); 51 | void update_garbage(int state); 52 | void update_biaoyu(int state); 53 | void update_jinggai(int state); 54 | void update_youshang(int state); 55 | 56 | 57 | 58 | signals: 59 | void detection_finshed(); 60 | }; 61 | 62 | #endif // MAINWINDOW_H 63 | -------------------------------------------------------------------------------- /image_detection.h: -------------------------------------------------------------------------------- 1 | #ifndef IMAGE_DETECTION_H 2 | #define IMAGE_DETECTION_H 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | class image_detection : public QObject 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | 19 | 20 | std::vector> detect(const cv::Mat& img,float threshold,float nms_threshlod); 21 | image_detection& operator=(const image_detection& )=delete;//forbid copy construct and operator = assignment copy 22 | image_detection(const image_detection&)=delete; 23 | image_detection(std::string pathToProtoTxt,caffe::Phase phase,std::string pathToPreTrained="") : 24 | _pathToProtoTxt(pathToProtoTxt), 25 | _phase(phase), 26 | _pathToPretrain(pathToPreTrained), 27 | import_path(false), 28 | QObject(NULL), 29 | rescale_baseline(600) 30 | { 31 | init(); 32 | } 33 | void resetNet(std::string pathToProtoTxt,caffe::Phase,std::string pathToPreTrained=""); 34 | void setMean(std::vector mean); 35 | std::shared_ptr> getNet(); 36 | caffe::Phase getPhase(); 37 | void reset_scale_baseline(float new_baseline); 38 | ~image_detection(){} 39 | private: 40 | void init(); 41 | /// @brief adjust channel and resize img according to input size 42 | cv::Mat preprocessImg(const cv::Mat& img); 43 | void loadInputImg(const cv::Mat& img); 44 | void updateShape(int width,int height); 45 | void loadImgInfo(const cv::Mat& img); 46 | cv::Mat subtractMean(const cv::Mat& img,std::vectormean); 47 | std::vector>> get_score_tranfomedBoundingBox(const caffe::Blob* rois,const caffe::Blob* delta,const caffe::Blob* score); 48 | std::vector> filterScore(const std::vector>& score,const std::vector>& corrd,float threshold,float nms_threshold); 49 | private: 50 | std::shared_ptr> _net; 51 | std::string _pathToProtoTxt; 52 | caffe::Phase _phase; 53 | std::string _pathToPretrain; 54 | bool import_path; 55 | int _num_channels;//num of input channel 56 | cv::Size _input_geometry;//size of input image 57 | float scale; 58 | std::vector _mean; 59 | float rescale_baseline; 60 | 61 | 62 | }; 63 | 64 | #endif // IMAGE_DETECTION_H 65 | -------------------------------------------------------------------------------- /nms.cpp: -------------------------------------------------------------------------------- 1 | #include "nms.h" 2 | #include "algorithm" 3 | using namespace std; 4 | template 5 | vector arg_sort(const vector& v){ 6 | vector idx(v.size()); 7 | for(size_t i=0;iv[i2];}); 10 | return idx; 11 | } 12 | 13 | template 14 | T my_max(T a,T b){ 15 | return a>b?a:b; 16 | } 17 | template 18 | T my_min(T a, T b){ 19 | return a> nms::NonMaxSpu(vector> corrd_score, float threshold){ 23 | vector x1,y1,x2,y2,scores,areas,classes; 24 | for(size_t num=0;num order=arg_sort(scores); 34 | vector isSupressed(corrd_score.size(),0); 35 | 36 | size_t i,j,_i,_j; 37 | float ix1,iy1,ix2,iy2,iarea; 38 | float xx1,yy1,xx2,yy2; 39 | float w,h; 40 | float inter,ovr; 41 | vector> ret; 42 | for(_i=0;_i temp; 52 | temp.push_back(ix1); 53 | temp.push_back(iy1); 54 | temp.push_back(ix2); 55 | temp.push_back(iy2); 56 | temp.push_back(scores[i]); 57 | temp.push_back(classes[i]); 58 | ret.push_back(temp); 59 | 60 | for(_j=_i+1;_jthreshold) 73 | isSupressed[j]=1; 74 | } 75 | } 76 | 77 | return ret; 78 | 79 | } 80 | 81 | -------------------------------------------------------------------------------- /detector_warpper.cpp: -------------------------------------------------------------------------------- 1 | #include "detector_warpper.h" 2 | #include "image_detection.h" 3 | #include 4 | #include 5 | #include 6 | #include 7 | detector_warpper::detector_warpper(QObject *parent) : QObject(parent), 8 | nums_threshold(0.5),score_threshold(0.5),has_result(false), 9 | cls_to_dis({2,6,7,14,15,21,22,23,24}) 10 | { 11 | 12 | std::string prototxt="/home/vcc/caffe_depen/faster_rcnn_test_four_class.pt"; 13 | std::string caffemodel="/home/vcc/caffe_depen/ZF_faster_rcnn_final_four_classes.caffemodel"; 14 | this->detector=std::make_shared(prototxt,caffe::TEST,caffemodel); 15 | std::vector classNames{"__background__", 16 | "aeroplane", "自行车", "bird", "boat", 17 | "bottle", "巴士", "小汽车", "cat", "chair", 18 | "cow", "diningtable", "dog", "horse", 19 | "摩托车", "行人", "pottedplant", 20 | "sheep", "sofa", "train", "tvmonitor","垃圾","横幅","井盖","游商"}; 21 | 22 | this->cls_inx_name.reset(new std::vector(classNames)); 23 | } 24 | 25 | 26 | void detector_warpper::change_nums_threshold(double new_threshold){ 27 | this->nums_threshold=new_threshold; 28 | qDebug()<<"new nms threshold"<nums_threshold; 29 | } 30 | void detector_warpper::change_score_threshold(double new_threshold){ 31 | this->score_threshold=new_threshold; 32 | qDebug()<<"new score threshold"<score_threshold; 33 | } 34 | 35 | void detector_warpper::detect(std::string image_path){ 36 | cv::Mat image=cv::imread(image_path); 37 | if(! image.data ) 38 | { 39 | this->has_result=false; 40 | QMessageBox msgBox; 41 | msgBox.setText("图像不存在或无法打开!"); 42 | msgBox.exec(); 43 | } 44 | else{ 45 | this->det_ret=this->detector->detect(image,this->score_threshold,this->nums_threshold); 46 | this->has_result=true; 47 | emit detect_finished(); 48 | } 49 | } 50 | 51 | std::vector>> detector_warpper::return_detec_result(){ 52 | std::vector>> result; 53 | if(has_result){ 54 | for(auto const& ele:this->det_ret){ 55 | if(this->cls_to_dis.find(int(ele[5]))!=this->cls_to_dis.end()){ 56 | std::string name=(*this->cls_inx_name)[ele[5]]; 57 | result.push_back({name,ele}); 58 | } 59 | } 60 | 61 | } 62 | else{ 63 | QMessageBox msgBox; 64 | msgBox.setText("没有检测结果!"); 65 | msgBox.exec(); 66 | } 67 | return result; 68 | } 69 | -------------------------------------------------------------------------------- /dockwidget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DockWidget 4 | 5 | 6 | true 7 | 8 | 9 | 10 | 0 11 | 0 12 | 200 13 | 573 14 | 15 | 16 | 17 | 18 | 138 19 | 573 20 | 21 | 22 | 23 | 参数设置 24 | 25 | 26 | 27 | 28 | 29 | 30 | 打开图片 31 | 32 | 33 | 34 | 35 | 36 | 37 | 概率阈值 38 | 39 | 40 | 41 | 42 | 43 | 44 | 0.000000000000000 45 | 46 | 47 | 1.000000000000000 48 | 49 | 50 | 0.050000000000000 51 | 52 | 53 | 0.500000000000000 54 | 55 | 56 | 57 | 58 | 59 | 60 | 非极大值抑制阈值 61 | 62 | 63 | 64 | 65 | 66 | 67 | 1.000000000000000 68 | 69 | 70 | 0.050000000000000 71 | 72 | 73 | 0.500000000000000 74 | 75 | 76 | 77 | 78 | 79 | 80 | 检测 81 | 82 | 83 | 84 | 85 | 86 | 87 | 图像尺寸 88 | 89 | 90 | 91 | 92 | 93 | 94 | 50 95 | 96 | 97 | 50 98 | 99 | 100 | Qt::Horizontal 101 | 102 | 103 | 104 | 105 | 106 | 107 | true 108 | 109 | 110 | 井盖 111 | 112 | 113 | false 114 | 115 | 116 | 117 | 118 | 119 | 120 | 横幅 121 | 122 | 123 | false 124 | 125 | 126 | 127 | 128 | 129 | 130 | 垃圾 131 | 132 | 133 | false 134 | 135 | 136 | 137 | 138 | 139 | 140 | 游商 141 | 142 | 143 | 144 | 145 | 146 | 147 | 行人 148 | 149 | 150 | 151 | 152 | 153 | 154 | 汽车 155 | 156 | 157 | 158 | 159 | 160 | 161 | 摩托车 162 | 163 | 164 | 165 | 166 | 167 | 168 | 自行车 169 | 170 | 171 | 172 | 173 | 174 | 175 | 巴士 176 | 177 | 178 | 179 | 180 | 181 | 182 | Qt::Vertical 183 | 184 | 185 | 186 | 20 187 | 324 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | -------------------------------------------------------------------------------- /mainwindow.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include "ui_mainwindow.h" 3 | #include "image_detection.h" 4 | #include "iostream" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include "opencv2/core/core.hpp" 11 | #include "opencv2/highgui/highgui.hpp" 12 | #include "QGraphicsTextItem" 13 | #include "detector_warpper.h" 14 | using std::cout; 15 | using std::endl; 16 | MainWindow::MainWindow(QWidget *parent) : 17 | QMainWindow(parent),scale(1),image_height(0),image_width(0), 18 | ui(new Ui::MainWindow) 19 | { 20 | dock_object = new DockWidget(this); 21 | 22 | ui->setupUi(this); 23 | this->addDockWidget(Qt::LeftDockWidgetArea,dock_object); 24 | this->setCentralWidget(ui->graphicsView); 25 | QObject::connect(this->dock_object->ui.pushButton,SIGNAL(clicked()),this,SLOT(LoadImgClicked())); 26 | QObject::connect(this->dock_object->ui.DetectpushButton,SIGNAL(clicked()),this,SLOT(detect())); 27 | QObject::connect(this,SIGNAL(detection_finshed()),this,SLOT(update_scene())); 28 | 29 | QObject::connect(this->dock_object->ui.scaleSlider,SIGNAL(valueChanged(int)),this,SLOT(rescale_image(int))); 30 | //figure out why not work!!!! 31 | QObject::connect(this->dock_object->ui.ScoreSpinBox,SIGNAL(valueChanged(double)),this->warpper.get(),SLOT(change_score_threshold(double))); 32 | QObject::connect(this->dock_object->ui.NMSSpinBox_2,SIGNAL(valueChanged(double)),this->warpper.get(),SLOT(change_nums_threshold(double))); 33 | 34 | QObject::connect(this->dock_object->ui.ScoreSpinBox,SIGNAL(valueChanged(double)),this,SLOT(change_score(double))); 35 | QObject::connect(this->dock_object->ui.NMSSpinBox_2,SIGNAL(valueChanged(double)),this,SLOT(change_nms(double))); 36 | 37 | 38 | //connect check boxes 39 | QObject::connect(dock_object->ui.checkBox_bicycle,SIGNAL(stateChanged(int)),this,SLOT(update_bicycle(int))); 40 | QObject::connect(dock_object->ui.checkBox_bus,SIGNAL(stateChanged(int)),this,SLOT(update_bus(int))); 41 | QObject::connect(dock_object->ui.checkBox_car,SIGNAL(stateChanged(int)),this,SLOT(update_car(int))); 42 | QObject::connect(dock_object->ui.checkBox_garbbage,SIGNAL(stateChanged(int)),this,SLOT(update_garbage(int))); 43 | QObject::connect(dock_object->ui.checkBox_hengfu,SIGNAL(stateChanged(int)),this,SLOT(update_biaoyu(int))); 44 | QObject::connect(dock_object->ui.checkBox_motor,SIGNAL(stateChanged(int)),this,SLOT(update_motor(int))); 45 | QObject::connect(dock_object->ui.checkBox_person,SIGNAL(stateChanged(int)),this,SLOT(update_person(int))); 46 | QObject::connect(dock_object->ui.checkBox_well,SIGNAL(stateChanged(int)),this,SLOT(update_jinggai(int))); 47 | QObject::connect(dock_object->ui.checkBox_youshang,SIGNAL(stateChanged(int)),this,SLOT(update_youshang(int))); 48 | 49 | 50 | 51 | this->warpper=std::make_shared(nullptr); 52 | } 53 | 54 | MainWindow::~MainWindow() 55 | { 56 | delete ui; 57 | } 58 | 59 | void MainWindow::LoadImgClicked(){ 60 | this->det_ret.clear(); 61 | QString filepath=QFileDialog::getOpenFileName(this,tr("Open Img"),"/home/vcc/测试数据",tr("Image Files(*.png *.jpg *.bmp)")); 62 | this->imagePath=filepath.toStdString(); 63 | this->update_scene(); 64 | } 65 | 66 | void MainWindow::detect(){ 67 | this->det_ret.clear(); 68 | this->update_scene(); 69 | if(this->imagePath.empty()){ 70 | QMessageBox msgBox; 71 | msgBox.setText("please open an image first!"); 72 | msgBox.exec(); 73 | } 74 | else{ 75 | this->warpper->detect(this->imagePath); 76 | this->det_ret=this->warpper->return_detec_result(); 77 | if(this->det_ret.size()==0){ 78 | QMessageBox msgBox; 79 | msgBox.setText("No object detected!"); 80 | msgBox.exec(); 81 | } 82 | else{ 83 | emit detection_finshed(); 84 | } 85 | } 86 | } 87 | 88 | void MainWindow::update_scene(){ 89 | qDebug()<<"update result"; 90 | if(this->scene.get()!=nullptr) 91 | this->scene->clear(); 92 | //clear scene and add image 93 | if(!this->imagePath.empty()){ 94 | this->imageObject=std::make_shared(QString::fromStdString(this->imagePath)); 95 | image_height=double(imageObject->height())*this->scale; 96 | image_width=double(imageObject->width())*this->scale; 97 | //will here memeory leak? no,will not 98 | QImage temp=this->imageObject->scaled(image_width,image_height,Qt::IgnoreAspectRatio,Qt::SmoothTransformation); 99 | this->imageObject.reset(new QImage(temp)); 100 | this->image=QPixmap::fromImage(*imageObject); 101 | this->scene=std::make_shared(this); 102 | QGraphicsPixmapItem* ImageItem=this->scene->addPixmap(image); 103 | this->scene->setSceneRect(image.rect()); 104 | this->ui->graphicsView->setScene(this->scene.get()); 105 | } 106 | for(auto const& vec:this->det_ret){ 107 | QPen outlinepen(Qt::red); 108 | QBrush brush(Qt::NoBrush); 109 | if(this->cls_filter.find(vec.first)!=this->cls_filter.end()){ 110 | std::string name_str=vec.first; 111 | std::vector ret_vec=vec.second; 112 | float _w=(ret_vec[2]-ret_vec[0])*scale; 113 | float _h=(ret_vec[3]-ret_vec[1])*scale; 114 | QGraphicsRectItem* rectItem=this->scene->addRect(ret_vec[0]*scale,ret_vec[1]*scale,_w,_h,outlinepen,brush); 115 | std::ostringstream ss; 116 | ss<scene->addText(QString::fromStdString(name_str),QFont(QString::fromStdString(std::string("Times")),_h/6)); 119 | QGraphicsTextItem* text2=this->scene->addText(QString::fromStdString(pro_str),QFont(QString::fromStdString(std::string("Times")),_h/10)); 120 | text->setPos(QPoint(ret_vec[0]*scale,ret_vec[1]*scale-_h/10)); 121 | text->setDefaultTextColor(QColor(255,0,0)); 122 | text2->setPos(QPoint(ret_vec[0]*scale,ret_vec[1]*scale-_h/5)); 123 | text2->setDefaultTextColor(QColor(255,0,0)); 124 | cout<<"draw a rect"<warpper->change_score_threshold(thres); 132 | } 133 | 134 | void MainWindow::change_nms(double thres){ 135 | this->warpper->change_nums_threshold(thres); 136 | } 137 | 138 | void MainWindow::rescale_image(int value){ 139 | if(value<=50) 140 | this->scale=double(value)/50; 141 | else 142 | this->scale=(double(value)-50)/5; 143 | this->update_scene(); 144 | } 145 | 146 | /////functions of change checkbox 147 | void MainWindow::update_biaoyu(int state){ 148 | if(state==0){ 149 | this->cls_filter.erase("横幅"); 150 | qDebug()<<"erase 横幅"; 151 | } 152 | else if(state==2){ 153 | this->cls_filter.insert("横幅"); 154 | qDebug()<<"add 横幅"; 155 | } 156 | else{ 157 | qDebug()<<"unknown state!"; 158 | } 159 | update_scene(); 160 | } 161 | void MainWindow::update_bicycle(int state){ 162 | if(state==0){ 163 | this->cls_filter.erase("自行车"); 164 | qDebug()<<"erase 自行车"; 165 | } 166 | else if(state==2){ 167 | this->cls_filter.insert("自行车"); 168 | qDebug()<<"add 自行车"; 169 | } 170 | else{ 171 | qDebug()<<"unknown state!"; 172 | } 173 | update_scene(); 174 | 175 | } 176 | void MainWindow::update_bus(int state){ 177 | if(state==0){ 178 | this->cls_filter.erase("巴士"); 179 | qDebug()<<"erase 巴士"; 180 | } 181 | else if(state==2){ 182 | this->cls_filter.insert("巴士"); 183 | qDebug()<<"add 巴士"; 184 | } 185 | else{ 186 | qDebug()<<"unknown state!"; 187 | } 188 | update_scene(); 189 | 190 | } 191 | void MainWindow::update_car(int state){ 192 | if(state==0){ 193 | this->cls_filter.erase("小汽车"); 194 | qDebug()<<"erase 小汽车"; 195 | } 196 | else if(state==2){ 197 | this->cls_filter.insert("小汽车"); 198 | qDebug()<<"add 小汽车"; 199 | } 200 | else{ 201 | qDebug()<<"unknown state!"; 202 | } 203 | update_scene(); 204 | 205 | } 206 | void MainWindow::update_motor(int state){ 207 | if(state==0){ 208 | this->cls_filter.erase("摩托车"); 209 | qDebug()<<"erase 摩托车"; 210 | } 211 | else if(state==2){ 212 | this->cls_filter.insert("摩托车"); 213 | qDebug()<<"add 摩托车"; 214 | } 215 | else{ 216 | qDebug()<<"unknown state!"; 217 | } 218 | update_scene(); 219 | 220 | } 221 | void MainWindow::update_person(int state){ 222 | if(state==0){ 223 | this->cls_filter.erase("行人"); 224 | qDebug()<<"erase 行人"; 225 | } 226 | else if(state==2){ 227 | this->cls_filter.insert("行人"); 228 | qDebug()<<"add 行人"; 229 | } 230 | else{ 231 | qDebug()<<"unknown state!"; 232 | } 233 | update_scene(); 234 | 235 | } 236 | void MainWindow::update_garbage(int state){ 237 | if(state==0){ 238 | this->cls_filter.erase("垃圾"); 239 | qDebug()<<"erase 垃圾"; 240 | } 241 | else if(state==2){ 242 | this->cls_filter.insert("垃圾"); 243 | qDebug()<<"add 垃圾"; 244 | } 245 | else{ 246 | qDebug()<<"unknown state!"; 247 | } 248 | update_scene(); 249 | 250 | } 251 | void MainWindow::update_jinggai(int state){ 252 | if(state==0){ 253 | this->cls_filter.erase("井盖"); 254 | qDebug()<<"erase 井盖"; 255 | } 256 | else if(state==2){ 257 | this->cls_filter.insert("井盖"); 258 | qDebug()<<"add 井盖"; 259 | } 260 | else{ 261 | qDebug()<<"unknown state!"; 262 | } 263 | update_scene(); 264 | 265 | } 266 | void MainWindow::update_youshang(int state){ 267 | if(state==0){ 268 | this->cls_filter.erase("游商"); 269 | qDebug()<<"erase 游商"; 270 | } 271 | else if(state==2){ 272 | this->cls_filter.insert("游商"); 273 | qDebug()<<"add 游商"; 274 | } 275 | else{ 276 | qDebug()<<"unknown state!"; 277 | } 278 | update_scene(); 279 | 280 | } 281 | -------------------------------------------------------------------------------- /image_detection.cpp: -------------------------------------------------------------------------------- 1 | #include "image_detection.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "nms.h" 9 | using namespace caffe; 10 | using namespace boost::python; 11 | using namespace std; 12 | //#define VISUALIZE 13 | void visualizeBlob(std::string name,Blob* blob){ 14 | int height=blob->shape()[2]; 15 | int width=blob->shape()[3]; 16 | cv::Mat channel(height,width,CV_32FC1,blob->mutable_cpu_data()); 17 | cv::namedWindow(name,cv::WINDOW_AUTOSIZE); 18 | cv::imshow(name,channel); 19 | cv::waitKey(1000); 20 | 21 | } 22 | void visualizeMat(std::string name,cv::Mat mat){ 23 | cv::namedWindow(name,cv::WINDOW_AUTOSIZE); 24 | cv::imshow(name,mat); 25 | cv::waitKey(1000); 26 | } 27 | vector loadBlob(Blob* blob){ 28 | int dims=blob->shape().size(); 29 | int length=1; 30 | for(int i=0;ishape()[i]; 32 | } 33 | vector ret; 34 | float* ptr_data=blob->mutable_cpu_data(); 35 | for(int j=0;j temp{122.7717,115.9465,102.9801}; 52 | this->_mean=temp; 53 | this->_net=std::make_shared>(_pathToProtoTxt,_phase); 54 | #ifdef VISUALIZE 55 | vector before_load=loadBlob(this->_net->params()[0].get()); 56 | #endif 57 | 58 | this->_net->CopyTrainedLayersFrom(_pathToPretrain); 59 | #ifdef VISUALIZE 60 | vector after_load=loadBlob(this->_net->params()[0].get()); 61 | #endif 62 | caffe::Blob *input_layer=_net->input_blobs()[0]; 63 | this->_num_channels=input_layer->channels(); 64 | this->_input_geometry=cv::Size(input_layer->width(),input_layer->height()); 65 | 66 | } 67 | 68 | void image_detection::resetNet(string pathToProtoTxt, Phase phase, string pathToPreTrained){ 69 | _pathToProtoTxt=pathToProtoTxt; 70 | _pathToPretrain=pathToPreTrained; 71 | _phase=phase; 72 | _net=std::make_shared>(_pathToProtoTxt,_phase); 73 | if(!pathToPreTrained.empty()){ 74 | _net->CopyTrainedLayersFrom(_pathToPretrain); 75 | 76 | } 77 | this->scale=0; 78 | } 79 | 80 | std::shared_ptr> image_detection::getNet(){ 81 | return _net; 82 | } 83 | 84 | caffe::Phase image_detection::getPhase(){ 85 | return _phase; 86 | } 87 | 88 | cv::Mat image_detection::preprocessImg(const cv::Mat& img){ 89 | 90 | if(img.empty()){ 91 | std::cout<<"The input image is empty!"<_num_channels == 1) 96 | cv::cvtColor(img, sample, CV_BGR2GRAY); 97 | else if (img.channels() == 4 && this->_num_channels == 1) 98 | cv::cvtColor(img, sample, CV_BGRA2GRAY); 99 | else if (img.channels() == 4 && this->_num_channels == 3) 100 | cv::cvtColor(img, sample, CV_BGRA2BGR); 101 | else if (img.channels() == 1 && this->_num_channels == 3) 102 | cv::cvtColor(img, sample, CV_GRAY2BGR); 103 | else 104 | sample = img; 105 | //sample=this->subtractMean(sample,this->_mean); 106 | 107 | int height=sample.rows; 108 | int width=sample.cols; 109 | if(widthscale=float(rescale_baseline)/float(width); 111 | height=int(float(height)/float(width)*rescale_baseline); 112 | width=rescale_baseline; 113 | 114 | } 115 | else{ 116 | this->scale=float(rescale_baseline)/float(height); 117 | width=int(float(width)/float(height)*rescale_baseline); 118 | height=rescale_baseline; 119 | 120 | } 121 | cv::Size new_size(width,height); 122 | cv::Mat sample_resized; 123 | if (sample.size() != new_size) 124 | cv::resize(sample, sample_resized, new_size); 125 | else 126 | sample_resized = sample; 127 | 128 | 129 | 130 | return sample_resized; 131 | 132 | } 133 | 134 | void image_detection::loadInputImg(const cv::Mat& img){ 135 | 136 | //warp input blobs 137 | int width=img.cols; 138 | int height=img.rows; 139 | this->updateShape(height,width);//update the shape of networks according to 140 | 141 | 142 | Blob* input_layer=this->_net->input_blobs()[0]; 143 | float* input_data=input_layer->mutable_cpu_data(); 144 | 145 | cv::Mat rbg[3]; 146 | cv::split(img,rbg); 147 | for(int j=0;j(j,k)); 150 | float b=float(rbg[1].at(j,k)); 151 | float g=float(rbg[2].at(j,k)); 152 | input_data[j*width+k]=r; 153 | input_data[(height*width)+j*width+k]=b; 154 | input_data[(height*width)*2+j*width+k]=g; 155 | } 156 | } 157 | 158 | 159 | } 160 | 161 | void image_detection::updateShape(int height, int width){ 162 | 163 | caffe::Blob* input_blob=_net->input_blobs()[0]; 164 | input_blob->Reshape(1,this->_num_channels,height,width); 165 | _net->Reshape(); 166 | } 167 | 168 | void image_detection::loadImgInfo(const cv::Mat &img){ 169 | int width=img.cols; 170 | int heigth=img.rows; 171 | Blob* im_info=this->_net->input_blobs()[1]; 172 | float* ptr_info=im_info->mutable_cpu_data(); 173 | *ptr_info=heigth; 174 | *(++ptr_info)=width; 175 | *(++ptr_info)=this->scale; 176 | 177 | } 178 | 179 | std::vector> image_detection::detect(const cv::Mat &img,float threshold,float nms_threshold){ 180 | cv::Mat intermedia=img; 181 | cv::Mat preProcessed=this->preprocessImg(intermedia); 182 | 183 | this->loadInputImg(preProcessed); 184 | this->loadImgInfo(preProcessed); 185 | this->_net->ForwardPrefilled(); 186 | vector>> ret =this->get_score_tranfomedBoundingBox(this->_net->blob_by_name("rois").get(),this->_net->blob_by_name("bbox_pred").get(),this->_net->blob_by_name("cls_prob").get()); 187 | return this->filterScore(ret[0],ret[1],threshold,nms_threshold); 188 | } 189 | 190 | vector>> image_detection::get_score_tranfomedBoundingBox(const caffe::Blob* rois,const caffe::Blob* delta,const caffe::Blob* score){ 191 | //not mature 192 | if(delta->shape()[0]!=rois->shape()[0]||score->shape()[0]!=rois->shape()[0]) 193 | raise(0); 194 | 195 | int num_of_classe=score->shape()[1]; 196 | int num_of_roi=rois->shape()[0]; 197 | vector> _rois; 198 | vector> _delta_correct; 199 | vector> _score; 200 | for(int i=0;i temp1; 202 | vector temp2; 203 | vector temp3; 204 | 205 | for(int j=1;j<5;++j){ 206 | temp1.push_back(rois->cpu_data()[i*5+j]); 207 | } 208 | _rois.push_back(temp1); 209 | 210 | for(int k=0;k<25;++k){ 211 | temp2.push_back(score->cpu_data()[i*num_of_classe+k]); 212 | } 213 | _score.push_back(temp2); 214 | 215 | for(int l=0;l<100;++l){ 216 | temp3.push_back(delta->cpu_data()[i*num_of_classe*4+l]); 217 | } 218 | _delta_correct.push_back(temp3); 219 | } 220 | //the 1th edition, rescale ROI before allpy 221 | for(auto& vec:_rois){ 222 | for(auto& val:vec) 223 | val/=this->scale; 224 | } 225 | 226 | vector widths,heights; 227 | for(auto const& vec:_rois){ 228 | widths.push_back(vec[2]-vec[0]); 229 | heights.push_back(vec[3]-vec[1]); 230 | } 231 | 232 | vector ctr_x,ctr_y; 233 | for(size_t i=0;i<_rois.size();++i){ 234 | ctr_x.push_back(_rois[i][0]+widths[i]*0.5); 235 | ctr_y.push_back(_rois[i][1]+heights[i]*0.5); 236 | } 237 | 238 | 239 | int cls_num=_score[0].size(); 240 | vector > predicted_corrd=_delta_correct; 241 | for(size_t i=0;i<_rois.size();++i){ 242 | for(int j=0;j>> ret; 253 | ret.push_back(_score); 254 | ret.push_back(predicted_corrd); 255 | return ret; 256 | } 257 | 258 | cv::Mat image_detection::subtractMean(const cv::Mat& img,vectormean){ 259 | visualizeMat("before",img); 260 | cv::Mat subed; 261 | cv::Mat temp(img.rows,img.cols,CV_8UC3,cv::Scalar(mean[0],mean[1],mean[2])); 262 | cv::subtract(img,temp,subed); 263 | visualizeMat("after",subed); 264 | visualizeMat("img",img); 265 | return temp; 266 | } 267 | 268 | void image_detection::setMean(std::vector mean){ 269 | this->_mean=mean; 270 | } 271 | 272 | vector> image_detection::filterScore(const std::vector > &score, const std::vector > &corrd,float threshold,float nms_threshlod){ 273 | vector>> inter_media(score[0].size()); 274 | vector> ret; 275 | for(size_t i=0;ithreshold){ 278 | vector temp; 279 | temp.push_back(corrd[i][j*4]); 280 | temp.push_back(corrd[i][j*4+1]); 281 | temp.push_back(corrd[i][j*4+2]); 282 | temp.push_back(corrd[i][j*4+3]); 283 | temp.push_back(score[i][j]); 284 | temp.push_back(i); 285 | temp.push_back(j); 286 | inter_media[j].push_back(temp); 287 | 288 | } 289 | 290 | } 291 | } 292 | 293 | for(auto ele:inter_media){ 294 | if(ele.size()>1){ 295 | auto temp_ret=nms::NonMaxSpu(ele,nms_threshlod); 296 | ret.insert(ret.end(),temp_ret.begin(),temp_ret.end()); 297 | } 298 | } 299 | return ret; 300 | } 301 | 302 | void image_detection::reset_scale_baseline(float new_baseline){ 303 | this->rescale_baseline=new_baseline; 304 | } 305 | -------------------------------------------------------------------------------- /Image_detection.pro.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | EnvironmentId 7 | {0758088d-167d-4a95-864e-a6541ab407dd} 8 | 9 | 10 | ProjectExplorer.Project.ActiveTarget 11 | 0 12 | 13 | 14 | ProjectExplorer.Project.EditorSettings 15 | 16 | true 17 | false 18 | true 19 | 20 | Cpp 21 | 22 | CppGlobal 23 | 24 | 25 | 26 | QmlJS 27 | 28 | QmlJSGlobal 29 | 30 | 31 | 2 32 | UTF-8 33 | false 34 | 4 35 | false 36 | 80 37 | true 38 | true 39 | 1 40 | true 41 | false 42 | 0 43 | true 44 | 0 45 | 8 46 | true 47 | 1 48 | true 49 | true 50 | true 51 | false 52 | 53 | 54 | 55 | ProjectExplorer.Project.PluginSettings 56 | 57 | 58 | 59 | ProjectExplorer.Project.Target.0 60 | 61 | Desktop Qt 5.6.0 GCC 64bit 62 | Desktop Qt 5.6.0 GCC 64bit 63 | qt.56.gcc_64_kit 64 | 0 65 | 0 66 | 0 67 | 68 | /home/vcc/build-Image_detection-Desktop_Qt_5_6_0_GCC_64bit-Debug 69 | 70 | 71 | true 72 | qmake 73 | 74 | QtProjectManager.QMakeBuildStep 75 | true 76 | 77 | false 78 | false 79 | false 80 | 81 | 82 | true 83 | Make 84 | 85 | Qt4ProjectManager.MakeStep 86 | 87 | -w 88 | -r 89 | 90 | false 91 | 92 | 93 | 94 | 2 95 | Build 96 | 97 | ProjectExplorer.BuildSteps.Build 98 | 99 | 100 | 101 | true 102 | Make 103 | 104 | Qt4ProjectManager.MakeStep 105 | 106 | -w 107 | -r 108 | 109 | true 110 | clean 111 | 112 | 113 | 1 114 | Clean 115 | 116 | ProjectExplorer.BuildSteps.Clean 117 | 118 | 2 119 | false 120 | 121 | Debug 122 | 123 | Qt4ProjectManager.Qt4BuildConfiguration 124 | 2 125 | true 126 | 127 | 128 | /home/vcc/build-Image_detection-Desktop_Qt_5_6_0_GCC_64bit-Release 129 | 130 | 131 | true 132 | qmake 133 | 134 | QtProjectManager.QMakeBuildStep 135 | false 136 | 137 | false 138 | false 139 | false 140 | 141 | 142 | true 143 | Make 144 | 145 | Qt4ProjectManager.MakeStep 146 | 147 | -w 148 | -r 149 | 150 | false 151 | 152 | 153 | 154 | 2 155 | Build 156 | 157 | ProjectExplorer.BuildSteps.Build 158 | 159 | 160 | 161 | true 162 | Make 163 | 164 | Qt4ProjectManager.MakeStep 165 | 166 | -w 167 | -r 168 | 169 | true 170 | clean 171 | 172 | 173 | 1 174 | Clean 175 | 176 | ProjectExplorer.BuildSteps.Clean 177 | 178 | 2 179 | false 180 | 181 | Release 182 | 183 | Qt4ProjectManager.Qt4BuildConfiguration 184 | 0 185 | true 186 | 187 | 188 | /home/vcc/build-Image_detection-Desktop_Qt_5_6_0_GCC_64bit-Profile 189 | 190 | 191 | true 192 | qmake 193 | 194 | QtProjectManager.QMakeBuildStep 195 | true 196 | 197 | false 198 | true 199 | false 200 | 201 | 202 | true 203 | Make 204 | 205 | Qt4ProjectManager.MakeStep 206 | 207 | -w 208 | -r 209 | 210 | false 211 | 212 | 213 | 214 | 2 215 | Build 216 | 217 | ProjectExplorer.BuildSteps.Build 218 | 219 | 220 | 221 | true 222 | Make 223 | 224 | Qt4ProjectManager.MakeStep 225 | 226 | -w 227 | -r 228 | 229 | true 230 | clean 231 | 232 | 233 | 1 234 | Clean 235 | 236 | ProjectExplorer.BuildSteps.Clean 237 | 238 | 2 239 | false 240 | 241 | Profile 242 | 243 | Qt4ProjectManager.Qt4BuildConfiguration 244 | 0 245 | true 246 | 247 | 3 248 | 249 | 250 | 0 251 | Deploy 252 | 253 | ProjectExplorer.BuildSteps.Deploy 254 | 255 | 1 256 | Deploy locally 257 | 258 | ProjectExplorer.DefaultDeployConfiguration 259 | 260 | 1 261 | 262 | 263 | false 264 | 1000 265 | 266 | true 267 | 268 | false 269 | false 270 | false 271 | false 272 | true 273 | 0.01 274 | 10 275 | true 276 | 1 277 | 25 278 | 279 | 1 280 | true 281 | false 282 | true 283 | valgrind 284 | 285 | 0 286 | 1 287 | 2 288 | 3 289 | 4 290 | 5 291 | 6 292 | 7 293 | 8 294 | 9 295 | 10 296 | 11 297 | 12 298 | 13 299 | 14 300 | 301 | 2 302 | 303 | Image_detection 304 | 305 | Qt4ProjectManager.Qt4RunConfiguration:/home/vcc/Image_detection/Image_detection.pro 306 | true 307 | 308 | Image_detection.pro 309 | false 310 | false 311 | 312 | 3768 313 | false 314 | true 315 | false 316 | false 317 | true 318 | 319 | 1 320 | 321 | 322 | 323 | ProjectExplorer.Project.TargetCount 324 | 1 325 | 326 | 327 | ProjectExplorer.Project.Updater.FileVersion 328 | 18 329 | 330 | 331 | Version 332 | 18 333 | 334 | 335 | -------------------------------------------------------------------------------- /Image_detection.pro.user.0e12a15: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | EnvironmentId 7 | {0e12a152-3a2d-49d6-98b4-87b205ad7e72} 8 | 9 | 10 | ProjectExplorer.Project.ActiveTarget 11 | 0 12 | 13 | 14 | ProjectExplorer.Project.EditorSettings 15 | 16 | true 17 | false 18 | true 19 | 20 | Cpp 21 | 22 | CppGlobal 23 | 24 | 25 | 26 | QmlJS 27 | 28 | QmlJSGlobal 29 | 30 | 31 | 2 32 | UTF-8 33 | false 34 | 4 35 | false 36 | 80 37 | true 38 | true 39 | 1 40 | true 41 | false 42 | 0 43 | true 44 | 0 45 | 8 46 | true 47 | 1 48 | true 49 | true 50 | true 51 | false 52 | 53 | 54 | 55 | ProjectExplorer.Project.PluginSettings 56 | 57 | 58 | 59 | ProjectExplorer.Project.Target.0 60 | 61 | Desktop Qt 5.5.1 GCC 64bit 62 | Desktop Qt 5.5.1 GCC 64bit 63 | qt.55.gcc_64_kit 64 | 0 65 | 0 66 | 0 67 | 68 | /home/wsf/projects/build-Image_detection-Desktop_Qt_5_5_1_GCC_64bit-Debug 69 | 70 | 71 | true 72 | qmake 73 | 74 | QtProjectManager.QMakeBuildStep 75 | false 76 | true 77 | 78 | false 79 | false 80 | false 81 | 82 | 83 | true 84 | Make 85 | 86 | Qt4ProjectManager.MakeStep 87 | 88 | -w 89 | -r 90 | 91 | false 92 | 93 | 94 | 95 | 2 96 | Build 97 | 98 | ProjectExplorer.BuildSteps.Build 99 | 100 | 101 | 102 | true 103 | Make 104 | 105 | Qt4ProjectManager.MakeStep 106 | 107 | -w 108 | -r 109 | 110 | true 111 | clean 112 | 113 | 114 | 1 115 | Clean 116 | 117 | ProjectExplorer.BuildSteps.Clean 118 | 119 | 2 120 | false 121 | 122 | Debug 123 | 124 | Qt4ProjectManager.Qt4BuildConfiguration 125 | 2 126 | true 127 | 128 | 129 | /home/wsf/projects/build-Image_detection-Desktop_Qt_5_5_1_GCC_64bit-Release 130 | 131 | 132 | true 133 | qmake 134 | 135 | QtProjectManager.QMakeBuildStep 136 | false 137 | true 138 | 139 | false 140 | false 141 | false 142 | 143 | 144 | true 145 | Make 146 | 147 | Qt4ProjectManager.MakeStep 148 | 149 | -w 150 | -r 151 | 152 | false 153 | 154 | 155 | 156 | 2 157 | Build 158 | 159 | ProjectExplorer.BuildSteps.Build 160 | 161 | 162 | 163 | true 164 | Make 165 | 166 | Qt4ProjectManager.MakeStep 167 | 168 | -w 169 | -r 170 | 171 | true 172 | clean 173 | 174 | 175 | 1 176 | Clean 177 | 178 | ProjectExplorer.BuildSteps.Clean 179 | 180 | 2 181 | false 182 | 183 | Release 184 | 185 | Qt4ProjectManager.Qt4BuildConfiguration 186 | 0 187 | true 188 | 189 | 2 190 | 191 | 192 | 0 193 | Deploy 194 | 195 | ProjectExplorer.BuildSteps.Deploy 196 | 197 | 1 198 | Deploy locally 199 | 200 | ProjectExplorer.DefaultDeployConfiguration 201 | 202 | 1 203 | 204 | 205 | 206 | false 207 | false 208 | false 209 | false 210 | true 211 | 0.01 212 | 10 213 | true 214 | 1 215 | 25 216 | 217 | 1 218 | true 219 | false 220 | true 221 | valgrind 222 | 223 | 0 224 | 1 225 | 2 226 | 3 227 | 4 228 | 5 229 | 6 230 | 7 231 | 8 232 | 9 233 | 10 234 | 11 235 | 12 236 | 13 237 | 14 238 | 239 | 2 240 | 241 | Image_detection 242 | 243 | Qt4ProjectManager.Qt4RunConfiguration:/home/wsf/projects/Image_detection/Image_detection.pro 244 | 245 | Image_detection.pro 246 | false 247 | false 248 | 249 | 3768 250 | false 251 | true 252 | false 253 | false 254 | true 255 | 256 | 1 257 | 258 | 259 | 260 | ProjectExplorer.Project.Target.1 261 | 262 | Desktop 263 | Desktop 264 | {e0075caa-cc5b-4b88-981f-0e3a8e67e875} 265 | 0 266 | 0 267 | 0 268 | 269 | /home/wsf/projects/build-Image_detection-Desktop-Debug 270 | 271 | 272 | true 273 | qmake 274 | 275 | QtProjectManager.QMakeBuildStep 276 | false 277 | true 278 | 279 | false 280 | false 281 | false 282 | 283 | 284 | true 285 | Make 286 | 287 | Qt4ProjectManager.MakeStep 288 | 289 | -w 290 | -r 291 | 292 | false 293 | 294 | 295 | 296 | 2 297 | Build 298 | 299 | ProjectExplorer.BuildSteps.Build 300 | 301 | 302 | 303 | true 304 | Make 305 | 306 | Qt4ProjectManager.MakeStep 307 | 308 | -w 309 | -r 310 | 311 | true 312 | clean 313 | 314 | 315 | 1 316 | Clean 317 | 318 | ProjectExplorer.BuildSteps.Clean 319 | 320 | 2 321 | false 322 | 323 | Debug 324 | 325 | Qt4ProjectManager.Qt4BuildConfiguration 326 | 2 327 | true 328 | 329 | 330 | /home/wsf/projects/build-Image_detection-Desktop-Release 331 | 332 | 333 | true 334 | qmake 335 | 336 | QtProjectManager.QMakeBuildStep 337 | false 338 | true 339 | 340 | false 341 | false 342 | false 343 | 344 | 345 | true 346 | Make 347 | 348 | Qt4ProjectManager.MakeStep 349 | 350 | -w 351 | -r 352 | 353 | false 354 | 355 | 356 | 357 | 2 358 | Build 359 | 360 | ProjectExplorer.BuildSteps.Build 361 | 362 | 363 | 364 | true 365 | Make 366 | 367 | Qt4ProjectManager.MakeStep 368 | 369 | -w 370 | -r 371 | 372 | true 373 | clean 374 | 375 | 376 | 1 377 | Clean 378 | 379 | ProjectExplorer.BuildSteps.Clean 380 | 381 | 2 382 | false 383 | 384 | Release 385 | 386 | Qt4ProjectManager.Qt4BuildConfiguration 387 | 0 388 | true 389 | 390 | 2 391 | 392 | 393 | 0 394 | Deploy 395 | 396 | ProjectExplorer.BuildSteps.Deploy 397 | 398 | 1 399 | Deploy locally 400 | 401 | ProjectExplorer.DefaultDeployConfiguration 402 | 403 | 1 404 | 405 | 406 | 407 | false 408 | false 409 | false 410 | false 411 | true 412 | 0.01 413 | 10 414 | true 415 | 1 416 | 25 417 | 418 | 1 419 | true 420 | false 421 | true 422 | valgrind 423 | 424 | 0 425 | 1 426 | 2 427 | 3 428 | 4 429 | 5 430 | 6 431 | 7 432 | 8 433 | 9 434 | 10 435 | 11 436 | 12 437 | 13 438 | 14 439 | 440 | -1 441 | 442 | 443 | 444 | %{buildDir} 445 | Custom Executable 446 | 447 | ProjectExplorer.CustomExecutableRunConfiguration 448 | 3768 449 | false 450 | true 451 | false 452 | false 453 | true 454 | 455 | 1 456 | 457 | 458 | 459 | ProjectExplorer.Project.TargetCount 460 | 2 461 | 462 | 463 | ProjectExplorer.Project.Updater.FileVersion 464 | 18 465 | 466 | 467 | Version 468 | 18 469 | 470 | 471 | --------------------------------------------------------------------------------