void BackGround::GetBackground_One_pass( string srcfilename,string outputdir,unsigned int width,unsigned int height, cv::Size win_stride) { Init(width,height); LoadPictures(srcfilename); SetOutputDir(outputdir); string filepath; ifstream fin(m_srcfilename.c_str(),ios_base::in); if(!fin.is_open()) { #ifdef DEBUG_OUTPUT cout<<"Open File Error"<<endl; #endif exit(1); } cv::Mat tmpimg; while(getline(fin,filepath)) { m_input.release(); tmpimg=cv::imread(filepath,0); cv::copyMakeBorder(tmpimg,m_input,40,40,40,40,cv::BORDER_REPLICATE); SetPrefix(GetFileName(filepath.c_str())); OutputBackground_OnePass(win_stride); } fin.close(); }
int main () { CreateMyWindow (); // pictures_t pictures; // LoadPictures (pictures); // array_t <dyn, button_t> buttons (0); // SetButtons (buttons, pictures); // int buttonPressed = NothingPressed; // txBegin (); // while (!Exit ()) { DrawBackground (pictures); // DoOperationsWithButtons (buttons, &buttonPressed); // txSleep (1); } txEnd (); DeletePictures (pictures); _txExit = true; return 0; }
BOOL COFSNcDlg2::LoadWindow(IXMLDOMNode *pXmlRoot, CRect &r, CRect &rMin, CRect &rMax) { ASSERT(pXmlRoot != NULL); CComPtr<IXMLDOMNode> pWindow = NULL; CComBSTR bs, bsBgPath; LoadSkins skin; long nErrorCode = 0; IStreamPtr pStream = NULL; CPaintDC dc(this); WCHAR *szNULL = L"\0x00"; pXmlRoot->selectSingleNode(CComBSTR(L"Window"), &pWindow); if(pWindow) { // Load window size bs.Empty(); SelectChildNode(pWindow, CComBSTR(L"XLen"), NULL, &bs); if(bs.m_str != NULL) r.right = r.left + wcstol(bs.m_str, &szNULL, 10); bs.Empty(); SelectChildNode(pWindow, CComBSTR(L"YLen"), NULL, &bs); if(bs.m_str != NULL) r.bottom = r.top + wcstol(bs.m_str, &szNULL, 10); // Load min size LoadRect(pWindow, _T("MinSize"), rMin); // Load max size LoadRect(pWindow, _T("MaxSize"), rMax); // Load regions for corners DeleteObject(m_rgnTL); DeleteObject(m_rgnTR); DeleteObject(m_rgnBL); DeleteObject(m_rgnBR); m_rgnTL = m_rgnTR = m_rgnBL = m_rgnBR = NULL; LoadRegion(pWindow, _T("TL"), &m_rgnTL); LoadRegion(pWindow, _T("TR"), &m_rgnTR); LoadRegion(pWindow, _T("BL"), &m_rgnBL); LoadRegion(pWindow, _T("BR"), &m_rgnBR); CenterRect(r); AdjustRect(r); // Try Fix Focus behavior [7/23/2002] SetWindowPos(NULL, r.left, r.top, r.Width(), r.Height(), SWP_NOZORDER|SWP_NOACTIVATE); // Load background image m_bBackgroundPicture = (LoadPictures(pWindow) > 0); //pWindow->Release(); } return TRUE; }
void BackGround::InitOutputPerBackground(string srcfilename,string outputdir,unsigned int width,unsigned int height,double scale,double scalefactor,double step) { Init(width,height); LoadPictures(srcfilename); SetOutputDir(outputdir); m_fin.open(m_srcfilename.c_str(),ios_base::in); if(!m_fin.is_open()) { #ifdef DEBUG_OUTPUT cout<<"Open File Error"<<endl; #endif exit(1); } m_currentroi.width=m_bgroi.width; m_currentroi.height=m_bgroi.height; m_scale=scale; m_scalefactor=scalefactor; m_step=step; }
void COFSNcDlg2::LoadSkin() { CComPtr<IXMLDOMDocument> pDoc = NULL; CComPtr<IXMLDOMNode> pRoot = NULL; LoadSkinXML(&pDoc, &pRoot); if(pRoot) { CRect r, rMin, rMax; r.SetRectEmpty(); rMin.SetRectEmpty(); rMax.SetRectEmpty(); LoadWindow(pRoot, r, rMin, rMax); // SetWindowPos(NULL, r.left, r.top, r.Width(), r.Height(), SWP_NOZORDER); LoadColors(pRoot); LoadPictures(pRoot); LoadSkin(pRoot); SetMinTrackSize(rMin.Size()); if(!rMax.IsRectEmpty()) SetMaxTrackSize(rMax.Size()); } }
void BackGround::GetBackground(string srcfilename,string outputdir,unsigned int width,unsigned int height,double scale,double scalefactor,double step) { Init(width,height); LoadPictures(srcfilename); SetOutputDir(outputdir); string filepath; ifstream fin(m_srcfilename.c_str(),ios_base::in); if(!fin.is_open()) { #ifdef DEBUG_OUTPUT cout<<"Open File Error"<<endl; #endif exit(1); } while(getline(fin,filepath)) { m_input.release(); m_input=cv::imread(filepath,0); SetPrefix(GetFileName(filepath.c_str())); OutputBackground(scale,scalefactor,step); } fin.close(); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); //Sloty connect(ui->pushButtonExit, SIGNAL(clicked()), this, SLOT(close()));//About //Wykresy cSpeed = new QwtPlotCurve; cOrientation = new QwtPlotCurve; //********Parametry************ cSpeed->setLegendAttribute(QwtPlotCurve::LegendShowLine, true); cSpeed->setPen(QPen(Qt::red)); cSpeed->attach(ui->speedPlot); //** cOrientation->setLegendAttribute(QwtPlotCurve::LegendShowSymbol, true); cOrientation->setPen(QPen(Qt::blue)); cOrientation->attach(ui->speedPlot); // scene = new QGraphicsScene; LoadPictures(); //Funkcje inicjalizujące połaczenie // ConnectToPlayer(); //Timery odświeżające dane na GUI QTimer *timer = new QTimer(this); QTimer *timer2 = new QTimer(this); //***Metody timerowane connect(timer, SIGNAL(timeout()), this, SLOT(run())); timer->start(100); connect(timer2, SIGNAL(timeout()), this, SLOT(run2())); timer2->start(1000); //Zmienne inicjalizowane w czasie tworzenia okna c=0; //zmienna pomocnicza cSpeedPlot d=0; route = 0; runTime = 0; QTextCodec::setCodecForCStrings(QTextCodec::codecForName("Windows-1250")); //inicjalizacja początkowych wartoci ui->doubleSpinBoxX->setValue(5); ui->doubleSpinBoxY->setValue(5); ui->doubleSpinBoxR->setValue(0); ui->doubleSpinBoxT->setValue(0.01); ui->doubleSpinBoxT->setValue(0.1); ui->lineEditConn->setText(QString :: fromUtf8("Rozłączony")); ui->lineEditHost->setText("localhost"); ui->spinBoxPort->setValue(6665); ui->pushButtonDisconnect->setDisabled(true); ui->pushButtonStop->setDisabled(true); ui->pushButtonStart->setDisabled(true); ui->doubleSpinBoxObsDis->setValue(0.1); ui->spinBoxDywer->setValue(5); ui->doubleSpinBoxDywer->setValue(1.5); }