亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? image_registration.cpp

?? this a image processing program
?? CPP
字號:
/*-------------------------------------------------------------------  File        : image_registration.cpp  Description : Compute a motion field between two images,                 with a multiscale and variational algorithm  Copyright  : David Tschumperle - http://www.greyc.ensicaen.fr/~dtschump/    This software is governed by the CeCILL  license under French law and  abiding by the rules of distribution of free software.  You can  use,   modify and/ or redistribute the software under the terms of the CeCILL  license as circulated by CEA, CNRS and INRIA at the following URL  "http://www.cecill.info".     As a counterpart to the access to the source code and  rights to copy,  modify and redistribute granted by the license, users are provided only  with a limited warranty  and the software's author,  the holder of the  economic rights,  and the successive licensors  have only  limited  liability.     In this respect, the user's attention is drawn to the risks associated  with loading,  using,  modifying and/or developing or reproducing the  software by the user in light of its specific status of free software,  that may mean  that it is complicated to manipulate,  and  that  also  therefore means  that it is reserved for developers  and  experienced  professionals having in-depth computer knowledge. Users are therefore  encouraged to load and test the software's suitability as regards their  requirements in conditions enabling the security of their systems and/or   data to be ensured and,  more generally, to use and operate it in the   same conditions as regards security.     The fact that you are presently reading this means that you have had  knowledge of the CeCILL license and that you accept its terms.  -----------------------------------------------------------------*/#include "../CImg.h"using namespace cimg_library;// The undef below is necessary when using a non-standard compiler.#ifdef cimg_use_visualcpp6#define std#endif// animate_warp() : Create warping animation from two images and a motion field//----------------void animate_warp(const CImg<unsigned char>& src, const CImg<unsigned char>& dest, const CImg<>& u,                  const bool morph, const bool imode,                  const char *filename,int nb,CImgDisplay *disp) {   CImg<unsigned char> visu = CImgList<unsigned char>(src,dest,src).get_append('x'), warp(src);  float t=0;  for (unsigned int iter=0; !disp || (!disp->is_closed && disp->key!=cimg::keyQ); iter++) {    if (morph) cimg_forXYV(warp,x,y,k) {      const float dx = u(x,y,0), dy = u(x,y,1),         I1 = (float)src.linear_pix2d(x-t*dx, y-t*dy, k),        I2 = (float)dest.linear_pix2d(x+(1-t)*dx,y+(1-t)*dy,k);      warp(x,y,k) = (unsigned char)((1-t)*I1 + t*I2);    } else cimg_forXYV(warp,x,y,k) {      const float dx = u(x,y,0), dy = u(x,y,1), I1 = (float)src.linear_pix2d(x-t*dx, y-t*dy, 0,k);      warp(x,y,k) = (unsigned char)I1;    }    if (disp) visu.draw_image(warp,2*src.dimx(),0).display(disp->resize().wait(30));    if (filename && *filename && (imode || (int)iter<nb)) {      std::fprintf(stderr,"\r  > frame %d           ",iter);      warp.save(filename,iter);     }    t+=1.0f/nb;    if (t<0) { t=0; nb=-nb; }    if (t>1) { t=1; nb=-nb; if (filename && *filename) std::exit(0); }  }}// get_warp() : Return the image src warped by the motion field u.//------------template<typename T> CImg<T> getwarp(const CImg<T>& src, const CImg<>& u) {  CImg<T> warp(src);  cimg_forXY(warp,x,y) warp(x,y) = (T)src.linear_pix2d(x - u(x,y,0), y - u(x,y,1));  return warp;}// optmonoflow() : Register images for one scale ( semi-implicite PDE scheme ) between I2->I1//---------------CImg<> optmonoflow(const CImg<>& I1,const CImg<>& I2,const CImg<>& u0,                    const float smooth, const float precision,CImgDisplay *disp) {  CImg<> u = u0.get_resize(I1.dimx(),I1.dimy(),1,2,3),dI(u);  CImg_3x3(I,float);  float dt=2,E=1e20f;  // compute first derivatives of I2  cimg_for3x3(I2,x,y,0,0,I) {    dI(x,y,0) = 0.5f*(Inc-Ipc);    dI(x,y,1) = 0.5f*(Icn-Icp);  }  // Main PDE iteration  for (unsigned int iter=0; iter<100000; iter++) {    std::fprintf(stderr,"\r- Iteration %d - E = %g",iter,E); std::fflush(stderr);    const float Eold = E;    E = 0;    cimg_for3XY(u,x,y) {      const float         X = x + u(x,y,0),        Y = y + u(x,y,1),        deltaI = (float)(I2.linear_pix2d(X,Y) - I1(x,y));      float tmpf = 0;      cimg_forV(u,k) {        const float          ux  = 0.5f*(u(_nx,y,k)-u(_px,y,k)),          uy  = 0.5f*(u(x,_ny,k)-u(x,_py,k));        u(x,y,k) = (float)( u(x,y,k) +                            dt*(                                -deltaI*dI.linear_pix2d(X,Y,k) +                                smooth* ( u(_nx,y,k) + u(_px,y,k) + u(x,_ny,k) + u(x,_py,k) )                                )                            )/(1+4*smooth*dt);        tmpf += ux*ux + uy*uy;      }      E += deltaI*deltaI + smooth * tmpf;    }    if (cimg::abs(Eold-E)<precision) break;    if (Eold<E) dt*=0.5;    if (disp) disp->resize();    if (disp && disp->is_closed) std::exit(0);    if (disp && !(iter%300)) {      const unsigned char white = 255;      CImg<unsigned char> tmp = getwarp(I1,u).normalize(0,200);      tmp.resize(disp->dimx(),disp->dimy()).draw_quiver(u,&white,15,-14,0,0.7f).display(*disp);    }  }  return u;}// optflow() : multiscale version of the image registration algorithm//-----------CImg<> optflow(const CImg<>& xsrc,const CImg<>& xdest,               const float smooth,const float precision,const unsigned int pnb_scale,CImgDisplay *disp=NULL) {  const CImg<>    src  = xsrc.get_norm_pointwise(1).resize(xdest.dimx(),xdest.dimy(),1,1,3).normalize(0,1),    dest = xdest.get_norm_pointwise(1).resize(xdest.dimx(),xdest.dimy(),1,1,3).normalize(0,1);  CImg<> u = CImg<>(src.dimx(),src.dimy(),1,2).fill(0);  const unsigned int nb_scale = pnb_scale>0?pnb_scale:(unsigned int)(2*std::log((double)(cimg::max(src.dimx(),src.dimy()))));  for (int scale=nb_scale-1; scale>=0; scale--) {    const CImg<> I1 = src.get_resize((int)(src.dimx()/std::pow(1.5,scale)), (int)(src.dimy()/std::pow(1.5,scale)) ,1,1,3);    const CImg<> I2 = dest.get_resize((int)(src.dimx()/std::pow(1.5,scale)), (int)(src.dimy()/std::pow(1.5,scale)) ,1,1,3);    std::fprintf(stderr," * Scale %d\n",scale);    u*=1.5;    u = optmonoflow(I1,I2,u,smooth,(float)(precision/std::pow(2.25,1+scale)),disp);    std::fprintf(stderr,"\n");  }  return u;}/*------------------------  Main function  ------------------------*/int main(int argc,char **argv) {    // Read command line parameters  cimg_usage("Compute an optical flow between two 2D images, and create a warped animation");  const char    *name_i1   = cimg_option("-i","img/sh0r.pgm","Input Image 1 (Destination)"),    *name_i2   = cimg_option("-i2","img/sh1r.pgm","Input Image 2 (Source)"),    *name_o    = cimg_option("-o",(const char*)NULL,"Output 2D flow (inrimage)"),    *name_seq  = cimg_option("-o2",(const char*)NULL,"Output Warping Sequence");  const float    smooth    = cimg_option("-s",0.1f,"Flow Smoothness"),    precision = cimg_option("-p",0.9f,"Convergence precision");  const unsigned int    nb        = cimg_option("-n",40,"Number of warped frames"),    nbscale   = cimg_option("-scale",0,"Number of scales (0=auto)");  const bool    normalize = cimg_option("-equalize",true,"Histogram normalization of the images"),    morph     = cimg_option("-m",true,"Morphing mode"),    imode     = cimg_option("-c",true,"Complete interpolation (or last frame is missing)"),    dispflag = !cimg_option("-novisu",false,"Visualization");    // Init images and display  std::fprintf(stderr," - Init images.\n");  const CImg<>    src(name_i1),    dest(CImg<>(name_i2).resize(src,3)),    src_blur  = normalize?src.get_blur(0.5f).equalize_histogram():src.get_blur(0.5f),    dest_blur = normalize?dest.get_blur(0.5f).equalize_histogram():dest.get_blur(0.5f);    CImgDisplay *disp = NULL;  if (dispflag) {    unsigned int w = src.dimx(), h = src.dimy();    const unsigned int dmin = cimg::min(w,h), minsiz = 512;    if (dmin<minsiz) { w=w*minsiz/dmin; h=h*minsiz/dmin; }    const unsigned int dmax = cimg::max(w,h), maxsiz = 1024;    if (dmax>maxsiz) { w=w*maxsiz/dmax; h=h*maxsiz/dmax; }    disp = new CImgDisplay(w,h,"Estimated Motion",0,3);  }  // Run Motion estimation algorithm  std::fprintf(stderr," - Compute optical flow.\n");  const CImg<> u = optflow(src_blur,dest_blur,smooth,precision,nbscale,disp);  if (name_o) u.save(name_o);  u.print("Computed flow");    // Do morphing animation  std::fprintf(stderr," - Create warped animation.\n");  CImgDisplay *disp2 = NULL;  if (dispflag) {    unsigned int w = src.dimx(), h = src.dimy();    const unsigned int dmin = cimg::min(w,h), minsiz = 100;    if (dmin<minsiz) { w=w*minsiz/dmin; h=h*minsiz/dmin; }    const unsigned int dmax = cimg::max(w,h), maxsiz = 1024/3;    if (dmax>maxsiz) { w=w*maxsiz/dmax; h=h*maxsiz/dmax; }    disp2 = new CImgDisplay(3*w,h,"Source/Destination images and Motion animation",0,19);  }    animate_warp(src.get_normalize(0,255),dest.get_normalize(0,255),u,morph,imode,name_seq,nb,disp2);    if (disp) delete disp;  if (disp2) delete disp2;  std::exit(0);  return 0;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美一区二区三区沐欲| 亚洲色图一区二区| 99久久综合精品| 蜜臀国产一区二区三区在线播放| 国产精品伦理一区二区| 国产天堂亚洲国产碰碰| 久久综合色天天久久综合图片| 欧美色图在线观看| 色综合久久久久综合99| 懂色av一区二区三区免费看| 国产精品自在在线| 国产伦精品一区二区三区免费| 精品一区二区三区免费| 精品一区二区三区免费播放 | 亚洲日本在线a| 精品亚洲成a人在线观看| 色八戒一区二区三区| 色狠狠一区二区三区香蕉| 久久精品亚洲精品国产欧美 | 亚洲一区免费在线观看| 一区二区三区欧美激情| 亚洲国产精品一区二区久久| 日韩中文字幕一区二区三区| 久久精品免费观看| 波多野结衣中文字幕一区二区三区| 暴力调教一区二区三区| 久久日韩精品一区二区五区| 久久女同性恋中文字幕| 国产乱子伦视频一区二区三区 | 人妖欧美一区二区| 丰满亚洲少妇av| 久久久久久**毛片大全| 国产一区 二区 三区一级| 欧美大白屁股肥臀xxxxxx| 欧美视频中文字幕| 亚洲一区二区三区中文字幕在线| 91黄色在线观看| 亚洲国产日韩精品| 91精品国产综合久久香蕉麻豆 | 欧美在线|欧美| 精品入口麻豆88视频| 久久爱另类一区二区小说| 精品免费一区二区三区| 国精品**一区二区三区在线蜜桃| 91丨porny丨户外露出| 日韩亚洲欧美综合| 亚洲视频香蕉人妖| 一本久久a久久免费精品不卡| 亚洲少妇30p| 欧美日韩国产一级| 国产精品乱人伦一区二区| 91视频在线观看| 亚洲国产一区二区三区| 精品国产乱码久久久久久老虎| 亚洲精品伦理在线| 国产精品一区免费视频| 国产精品天美传媒沈樵| 色婷婷精品大视频在线蜜桃视频| 亚洲成av人片一区二区三区| eeuss鲁片一区二区三区| 玉足女爽爽91| 日韩一级片在线播放| 国产精品自拍一区| 一区二区三区在线高清| 日韩午夜电影av| 丁香五精品蜜臀久久久久99网站| 一区二区三区四区不卡视频| 911精品产国品一二三产区| 国模大尺度一区二区三区| 亚洲色图欧美在线| 91精品国产综合久久精品 | 欧美狂野另类xxxxoooo| 久久精品人人做人人爽人人| 在线看国产一区| 精品一区免费av| 一区二区不卡在线播放| 久久先锋资源网| 欧美视频一区二区三区在线观看| 国产一区二区在线免费观看| 亚洲黄色录像片| 中文字幕国产一区| 国产九色精品成人porny| 亚洲精品亚洲人成人网| 久久久久久久免费视频了| 在线免费观看不卡av| 高清beeg欧美| 老司机免费视频一区二区| 亚洲免费在线看| 日本韩国一区二区三区视频| 国产一区啦啦啦在线观看| 午夜激情一区二区三区| 在线不卡欧美精品一区二区三区| 成人一区在线看| 国产精品久久久久9999吃药| 一本久道久久综合中文字幕| 国产精品一二三四| 毛片av中文字幕一区二区| 亚洲成人你懂的| 亚洲天堂福利av| 国产日产精品一区| 精品国产3级a| 日韩美一区二区三区| 欧美久久久久久久久久| 欧美亚洲尤物久久| 日本不卡一二三| 亚洲午夜久久久久久久久电影网| 欧美视频在线一区| 亚洲最新视频在线观看| 日韩一区二区精品葵司在线| 色综合久久中文字幕综合网| 国产精品一级二级三级| 性做久久久久久免费观看欧美| 亚洲精品久久嫩草网站秘色| 亚洲欧洲国产日本综合| 国产精品自拍av| 精品一区在线看| 国产乱子伦视频一区二区三区| 麻豆国产精品视频| 蜜桃一区二区三区在线观看| 日本sm残虐另类| 激情欧美日韩一区二区| 精品亚洲成a人在线观看| 国产最新精品精品你懂的| 国产一区二区免费在线| 国产凹凸在线观看一区二区| 国产98色在线|日韩| www.亚洲激情.com| 91欧美一区二区| 欧美午夜精品久久久久久孕妇| 欧美日韩在线播放三区| 国产大陆a不卡| 亚洲国产日日夜夜| 热久久免费视频| 国产一区二区三区视频在线播放| 国产福利视频一区二区三区| 99精品一区二区| 精品嫩草影院久久| 国产精品日日摸夜夜摸av| 亚洲欧美日韩在线不卡| 亚洲欧美乱综合| 午夜精品福利视频网站| 99久久夜色精品国产网站| 日韩西西人体444www| 欧美电影精品一区二区| 国产精品女主播av| 老色鬼精品视频在线观看播放| 国产激情一区二区三区| 黑人巨大精品欧美一区| 久久精品国产第一区二区三区| 午夜视黄欧洲亚洲| 亚洲综合色自拍一区| 视频一区视频二区中文| 精品一区二区三区久久久| 欧美成人艳星乳罩| 91丝袜美女网| 五月天亚洲婷婷| 色老汉一区二区三区| 中文字幕一区二区三区蜜月| 亚洲综合成人在线视频| 免费的国产精品| 国产九色精品成人porny | 日韩欧美一二三四区| 精品国产成人系列| 亚洲一区二区三区四区五区黄| 国产中文字幕一区| 欧美一级片在线观看| 自拍视频在线观看一区二区| 首页国产丝袜综合| 欧美日韩一级黄| 亚洲欧洲日韩女同| 国产呦萝稀缺另类资源| 91精品国产综合久久蜜臀| 亚洲丝袜美腿综合| 从欧美一区二区三区| 日韩精品一区二区三区在线播放| 亚洲欧洲日韩综合一区二区| 成人综合婷婷国产精品久久免费| 99精品视频在线观看| 欧美变态tickle挠乳网站| 亚洲在线免费播放| 精品少妇一区二区三区免费观看| 亚洲美女在线国产| 欧美在线一区二区三区| 亚洲欧美偷拍三级| 久久亚洲捆绑美女| 高清日韩电视剧大全免费| 亚洲国产精品一区二区www| 国产精品成人免费| 美女一区二区三区| 欧洲在线/亚洲| 午夜一区二区三区视频| 欧美精品色综合| 波多野结衣中文一区| 欧美亚洲免费在线一区| 国产欧美一区二区精品忘忧草 | 亚洲欧美日韩系列| 国产盗摄一区二区| 久久久亚洲精华液精华液精华液| 青青草97国产精品免费观看无弹窗版| 欧美综合在线视频|