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

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

?? edge_explorer.cpp

?? this a image processing program
?? CPP
字號:
/*------------------------------------------------------------------------------  File        : edge_explorer.cpp  Description : Real time edge detection while moving a ROI                (rectangle of interest) over the original image.  Copyright   : Orges Leka - oleka (at) students.uni-mainz.de  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// Start main procedure//-----------------------int main(int argc, char** argv) {  // Usage of the program displayed at the command line  cimg_usage("Real time edge detection with CImg. (c) Orges Leka");  // Read command line arguments  // With cimg_option we can get a new name for the image which is to be loaded from the command line.  const char* img_name =  cimg_option("-i", "img/lena.pgm","Input image.");  double    alpha = cimg_option("-a",1.0,"Blurring the gradient image."),    thresL = cimg_option("-tl",13.5,"Lower thresholding used in Hysteresis."),    thresH = cimg_option("-th",13.6,"Higher thresholding used in Hysteresis.");  const unsigned int    mode = cimg_option("-m",1,"Detection mode: 1 = Hysteresis, 2 = Gradient angle."),    factor = cimg_option("-s",80,"Half-size of edge-explorer window.");  cimg_help("\nAdditional notes : user can press following keys on main display window :\n"            "     - Left arrow : Decrease alpha.\n"            "     - Right arrow : Increase alpha.\n");  // Construct a new image called 'edge' of size (2*factor,2*factor)  // and of type 'unsigned char'.  CImg<unsigned char> edge(2*factor,2*factor);  CImgDisplay disp_edge(512,512,"Edge Explorer");  // Load the image with the name 'img_name' into the CImg 'img'.  // and create a display window 'disp' for the image 'img'.  const CImg<unsigned char> img(img_name);  CImgDisplay disp(img,"Original Image");  // Begin main interaction loop.  int x = 0, y = 0;  bool redraw = false;  while (!disp.is_closed && disp.key!=cimg::keyQ && disp.key!=cimg::keyESC) {    disp.wait();    switch (disp.key) {    case cimg::keyARROWLEFT:    case cimg::keyARROWDOWN:  alpha=cimg::max(0.0,alpha-0.05); redraw = true; break;    case cimg::keyARROWUP:    case cimg::keyARROWRIGHT: alpha+=0.05; redraw = true; break;    }    if (disp_edge.is_resized) { disp_edge.resize(); redraw = true; }    if (disp_edge.is_closed) disp_edge.show();    if (disp.is_resized) disp.resize(disp);    if (disp.mouse_x>=0) {      x = disp.mouse_x; // Getting the current position of the mouse.      y = disp.mouse_y; //      redraw = true;    // The image should be redrawn.    }    if (redraw) {      disp_edge.set_title("Edge explorer (alpha=%g)",alpha);      const int        x0 = x-factor, y0 = y-factor,  // These are the coordinates for the red rectangle        x1 = x+factor, y1 = y+factor;  // to be drawn on the original image.      const unsigned char        red[3] = { 255,0,0 },          //        black[3] = { 0,0,0 };          // Defining the colors we need for drawing.        (+img).draw_line(x0,y0,x1,y0,red).draw_line(x1,y0,x1,y1,red).draw_line(x1,y1,x0,y1,red).draw_line(x0,y1,x0,y0,red).display(disp);        //^ We draw the red rectangle on the original window using 'draw_line'. Then we display the result via '.display(disp)' .        //  Observe, that the color 'red' has to be of type 'const unsigned char',        //  since the image 'img' is of type 'const CImg<unsigned char>'.        //'normalize' is used to get a greyscaled image.        CImg<> visu_bw = CImg<>(img).get_crop(x0,y0,x1,y1).get_norm_pointwise().normalize(0,255).resize(-100,-100,1,2,2);        // get_crop(x0,y0,x1,y1) gets the rectangle we are interested in.        edge.fill(255); // Background color in the edge-detection window is white.        // grad[0] is the gradient image of 'visu_bw' in x-direction.        // grad[1] is the gradient image of 'visu_bw' in y-direction.        CImgList<> grad(visu_bw.blur((float)alpha).normalize(0,255).get_gradientXY(3));        // To avoid unnecessary calculations in the image loops:        const double          pi = cimg::PI,          p8 = pi/8.0, p38 = 3.0*p8,          p58 = 5.0*p8, p78 = 7.0*p8;        cimg_forXY(visu_bw,s,t) {          // We take s,t instead of x,y, since x,y are already used.          // s corresponds to the x-ordinate of the pixel while t corresponds to the y-ordinate.          if ( 1 <= s && s <= visu_bw.dimx()-1 && 1 <= t && t <=visu_bw.dimy()-1) { // if - good points            double              Gs = grad[0](s,t),                  //              Gt = grad[1](s,t),			       //  The actual pixel is (s,t)              Gst = std::abs(Gs) + std::abs(Gt),    //              // ^-- For efficient computation we observe that |Gs|+ |Gt| ~=~ sqrt( Gs^2 + Gt^2)              Gr, Gur, Gu, Gul, Gl, Gdl, Gd, Gdr;            // ^-- right, up right, up, up left, left, down left, down, down right.            double theta = std::atan2(Gt,Gs)+pi; // theta is from the interval [0,Pi]            switch(mode) {            case 1: // Hysterese is applied              if (Gst>=thresH) { edge.draw_point(s,t,black); }              else if (thresL <= Gst && Gst < thresH) {                // Neighbourhood of the actual pixel:                Gr = std::abs(grad[0](s+1,t)) + std::abs(grad[1](s+1,t)); // right                Gl = std::abs(grad[0](s-1,t)) + std::abs(grad[1](s-1,t)); // left                Gur = std::abs(grad[0](s+1,t+1)) + std::abs(grad[1](s+1,t+1)); // up right                Gdl = std::abs(grad[0](s-1,t-1)) + std::abs(grad[1](s-1,t-1)); // down left                Gu = std::abs(grad[0](s,t+1)) + std::abs(grad[1](s,t+1)); // up                Gd = std::abs(grad[0](s,t-1)) + std::abs(grad[1](s,t-1)); // down                Gul = std::abs(grad[0](s-1,t+1)) + std::abs(grad[1](s-1,t+1)); // up left                Gdr = std::abs(grad[0](s+1,t-1)) + std::abs(grad[1](s+1,t-1)); // down right                if (Gr>=thresH || Gur>=thresH || Gu>=thresH || Gul>=thresH                    || Gl>=thresH || Gdl >=thresH || Gu >=thresH || Gdr >=thresH) {                  edge.draw_point(s,t,black);                }              };              break;            case 2: // Angle 'theta' of the gradient (Gs,Gt) at the point (s,t).              if(theta >= pi)theta-=pi;              //rounding theta:              if ((p8 < theta && theta <= p38 ) || (p78 < theta && theta <= pi)) {                // See (*) below for explanation of the vocabulary used.                // Direction-pixel is (s+1,t) with corresponding gradient value Gr.                Gr = std::abs(grad[0](s+1,t)) + std::abs(grad[1](s+1,t)); // right                // Contra-direction-pixel is (s-1,t) with corresponding gradient value Gl.                Gl = std::abs(grad[0](s-1,t)) + std::abs(grad[1](s-1,t)); // left                if (Gr < Gst && Gl < Gst) {                  edge.draw_point(s,t,black);                }              }              else if ( p8 < theta && theta <= p38) {                // Direction-pixel is (s+1,t+1) with corresponding gradient value Gur.                Gur = std::abs(grad[0](s+1,t+1)) + std::abs(grad[1](s+1,t+1)); // up right                // Contra-direction-pixel is (s-1,t-1) with corresponding gradient value Gdl.                Gdl = std::abs(grad[0](s-1,t-1)) + std::abs(grad[1](s-1,t-1)); // down left                if (Gur < Gst && Gdl < Gst) {                  edge.draw_point(s,t,black);                      }              }              else if ( p38 < theta && theta <= p58) {                // Direction-pixel is (s,t+1) with corresponding gradient value Gu.                Gu = std::abs(grad[0](s,t+1)) + std::abs(grad[1](s,t+1)); // up                // Contra-direction-pixel is (s,t-1) with corresponding gradient value Gd.                Gd = std::abs(grad[0](s,t-1)) + std::abs(grad[1](s,t-1)); // down                if (Gu < Gst && Gd < Gst) {                  edge.draw_point(s,t,black);                }              }              else if (p58 < theta && theta <= p78) {                // Direction-pixel is (s-1,t+1) with corresponding gradient value Gul.                Gul = std::abs(grad[0](s-1,t+1)) + std::abs(grad[1](s-1,t+1)); // up left                // Contra-direction-pixel is (s+1,t-1) with corresponding gradient value Gdr.                Gdr = std::abs(grad[0](s+1,t-1)) + std::abs(grad[1](s+1,t-1)); // down right                if (Gul < Gst && Gdr < Gst) {                  edge.draw_point(s,t,black);                }              };              break;            } // switch          } // if good-points        }  // cimg_forXY */        edge.display(disp_edge);    }// if redraw  } // while  return 0;}// (*) Comments to the vocabulary used:// If (s,t) is the current pixel, and G=(Gs,Gt) is the gradient at (s,t),// then the _direction_pixel_ of (s,t) shall be the one of the eight neighbour pixels// of (s,t) in whose direction the gradient G shows.// The _contra_direction_pixel is the pixel in the opposite direction in which the gradient G shows.// The _corresponding_gradient_value_ of the pixel (x,y) with gradient G = (Gx,Gy)// shall be |Gx|+|Gy| ~=~ sqrt(Gx^2+Gy^2).

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区四区蜜桃| 色一情一伦一子一伦一区| 欧美三级中文字| 一区二区三区在线视频免费| av在线免费不卡| 一区二区三区成人| 色婷婷亚洲精品| 一二三四区精品视频| 一本在线高清不卡dvd| 一区二区免费看| 在线播放日韩导航| 亚瑟在线精品视频| 91精品国产欧美一区二区成人| 男人的j进女人的j一区| 亚洲精品一区二区三区99| 精品一区二区久久久| 在线播放日韩导航| 成人免费av资源| 日韩女优制服丝袜电影| 国产在线精品一区二区不卡了| 欧美大片一区二区| 成人小视频免费在线观看| 中文字幕欧美日本乱码一线二线| 成人18视频日本| 亚洲精品网站在线观看| 884aa四虎影成人精品一区| 日本在线不卡一区| 久久久精品免费网站| 成人av片在线观看| 亚洲一区二区三区国产| 日韩情涩欧美日韩视频| 国产九色sp调教91| 一区二区三区四区激情| 欧美日韩aaaaa| 国产一区二区在线电影| 中文字幕亚洲一区二区va在线| 欧美色爱综合网| 天天综合网天天综合色 | 日本道色综合久久| 日韩av午夜在线观看| 久久久久99精品一区| 99国产精品国产精品久久| 亚洲高清免费观看| 精品99久久久久久| 色欧美片视频在线观看| 国产欧美一区二区三区沐欲| 欧美精品一卡两卡| 久久国产综合精品| 亚洲自拍偷拍av| 日韩亚洲欧美在线| 99视频热这里只有精品免费| 日本中文字幕一区| 亚洲免费观看高清完整版在线观看 | 国产99久久久国产精品| 亚洲韩国精品一区| 亚洲同性同志一二三专区| 日韩情涩欧美日韩视频| 色婷婷精品大在线视频| 国产乱子伦视频一区二区三区 | wwwwxxxxx欧美| 555www色欧美视频| 91福利在线导航| 国产成人精品免费| 麻豆精品蜜桃视频网站| 国产精品日日摸夜夜摸av| 欧美一级视频精品观看| 91麻豆福利精品推荐| 国产精品一区二区在线观看不卡| 国产精品国模大尺度视频| 欧美精品一区二区三区在线 | 亚洲午夜电影网| 国产精品久久久久久久裸模| 欧美色综合天天久久综合精品| 成人激情动漫在线观看| 久久99精品久久只有精品| 亚洲成av人在线观看| 亚洲伦理在线免费看| 日韩三级.com| 久久久欧美精品sm网站 | 91精品国产日韩91久久久久久| 国产91在线|亚洲| 国产精品白丝jk白祙喷水网站| 久久精品国产77777蜜臀| 亚洲国产成人精品视频| 亚洲精品五月天| 国产精品美女一区二区在线观看| 国产欧美视频在线观看| 久久久综合网站| 久久―日本道色综合久久| 日韩欧美色电影| 欧美videossexotv100| 91精品国产高清一区二区三区 | 亚洲第一成人在线| 中文字幕一区二区三区精华液| 国产嫩草影院久久久久| 色综合久久久久网| 欧美日韩视频在线观看一区二区三区| 欧美优质美女网站| 91精品免费在线观看| 精品国产网站在线观看| 亚洲国产精品国自产拍av| 亚洲人成电影网站色mp4| 午夜久久久久久久久| 国产在线看一区| 色综合久久88色综合天天免费| 欧美系列一区二区| 2021久久国产精品不只是精品| 中文字幕一区av| 玖玖九九国产精品| 成人黄色777网| 欧美电影一区二区| 国产精品麻豆欧美日韩ww| 亚洲国产精品一区二区www在线| 韩国成人福利片在线播放| 99re免费视频精品全部| 在线播放一区二区三区| 国产清纯白嫩初高生在线观看91| 亚洲韩国一区二区三区| 国产成人8x视频一区二区| 欧美调教femdomvk| 久久精品综合网| 日本中文一区二区三区| 波多野结衣亚洲| 精品久久久网站| 亚洲午夜久久久久久久久电影院 | 久久久久久久精| 婷婷成人综合网| 91小视频免费观看| 2欧美一区二区三区在线观看视频| 亚洲伦理在线精品| 理论片日本一区| 欧美自拍丝袜亚洲| 国产精品美女久久久久aⅴ国产馆| 日韩电影一区二区三区四区| 91丨porny丨蝌蚪视频| 久久亚洲一级片| 日韩av不卡一区二区| 91首页免费视频| 国产亚洲成年网址在线观看| 日韩激情在线观看| 欧美色综合久久| 亚洲精品成人悠悠色影视| 成人丝袜18视频在线观看| 欧美videos大乳护士334| 午夜精品久久久久久久蜜桃app| 9i在线看片成人免费| 2021国产精品久久精品| 六月丁香婷婷久久| 3d动漫精品啪啪1区2区免费 | 色狠狠一区二区| 亚洲视频资源在线| av高清不卡在线| 国产精品剧情在线亚洲| 国产精品77777| 久久久蜜臀国产一区二区| 精品一区二区三区日韩| 欧美一级夜夜爽| 经典三级一区二区| 日韩一级大片在线| 麻豆成人91精品二区三区| 欧美一三区三区四区免费在线看 | 国产精品视频免费看| 成人一区二区三区| 国产精品久久夜| 91在线国产观看| 日韩美女久久久| 日本高清不卡一区| 亚洲一区二区三区中文字幕在线| 色哟哟国产精品免费观看| 综合久久国产九一剧情麻豆| 91在线精品秘密一区二区| 亚洲欧美日韩电影| 色系网站成人免费| 亚洲五月六月丁香激情| 69堂国产成人免费视频| 美女视频网站久久| 久久久综合精品| 成人激情免费视频| 亚洲精品中文在线| 欧美人与z0zoxxxx视频| 美女视频第一区二区三区免费观看网站| 91精品久久久久久蜜臀| 久久不见久久见免费视频7| 国产日韩精品一区二区浪潮av| av在线不卡网| 午夜婷婷国产麻豆精品| 精品国产a毛片| bt7086福利一区国产| 亚洲国产va精品久久久不卡综合| 3d动漫精品啪啪1区2区免费| 精品亚洲porn| 亚洲免费观看高清完整版在线观看| 欧美色精品天天在线观看视频| 人人超碰91尤物精品国产| 久久免费电影网| 欧美亚洲国产怡红院影院| 日本一不卡视频| 国产精品福利一区| 欧美久久免费观看| 国产成人综合自拍|