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

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

?? dmtxregion.c

?? data matrix 生成、解析、攝像頭自動識別源碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*libdmtx - Data Matrix Encoding/Decoding LibraryCopyright (C) 2006 Mike LaughtonThis library is free software; you can redistribute it and/ormodify it under the terms of the GNU Lesser General PublicLicense as published by the Free Software Foundation; eitherversion 2.1 of the License, or (at your option) any later version.This library is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNULesser General Public License for more details.You should have received a copy of the GNU Lesser General PublicLicense along with this library; if not, write to the Free SoftwareFoundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USAContact: mike@dragonflylogic.com*//* $Id: dmtxregion.c,v 1.14 2006/10/06 19:17:39 mblaughton Exp $ *//** * Scans through a line (vertical or horizontal) of the source image to * find and decode valid Data Matrix barcode regions. * * @param decode   pointer to DmtxDecode information struct * @param dir      scan direction (DmtxUp|DmtxRight) * @param lineNbr  number of image row or column to be scanned * @return         number of barcodes scanned */extern intdmtxScanLine(DmtxDecode *decode, DmtxDirection dir, int lineNbr){   int              success;   DmtxJumpScan     jumpScan;   DmtxEdgeScan     edgeScan;   DmtxEdgeFollower followLeft, followRight;   DmtxMatrixRegion matrixRegion;   assert(decode->image.width > 0 && decode->image.height > 0);   assert(dir == DmtxDirUp || dir == DmtxDirRight);   // The outer loop steps through a full row or column of the source   // image looking for regions that alternate between 2 colors.  This   // alternating pattern is what you would expect if you took a pixel-wide   // slice of a Data Matrix barcode image.  libdmtx refers to these   // regions as "jump regions" since the color value is seen as jumping   // back and forth across an imaginary middle color (or "edge").   // Initialize jump scan to cover entire line   JumpScanInit(&jumpScan, dir, lineNbr, 0, (dir & DmtxDirHorizontal) ?         decode->image.width : decode->image.height);   // Loop once for each jump region candidate found on this line   while(JumpScanNextRegion(&jumpScan, decode) != DMTX_END_OF_RANGE) {      // Does this jump region meet necessary requirements?      if(!JumpRegionValid(&jumpScan.region))         continue;      // We now have a sufficiently-long region of 2 alternating colors.      // Next inspect each color boundary (or "edge") in this region to      // uncover finder bar candidates.      // Initialize edge scan to search within current jump region      EdgeScanInit(&edgeScan, &jumpScan);      // Loop once for each color edge found in this jump region      while(EdgeScanNextEdge(&edgeScan, decode, &(jumpScan.region.gradient)) != DMTX_END_OF_RANGE) {         // Finder bars are detected by tracing (or "following") an edge to         // the left and to the right of the current scan direction.  If         // the followers find edges that are sufficiently straight and         // long then they are pursued as valid finder bar candidates.         EdgeFollowerInit(&followLeft, &edgeScan, &(jumpScan.region.gradient), TurnCorner(dir, DMTX_TURN_CCW));         EdgeFollowerInit(&followRight, &edgeScan, &(jumpScan.region.gradient), TurnCorner(dir, DMTX_TURN_CW));         EdgeFollowerFollow(&followLeft, decode);         EdgeFollowerFollow(&followRight, decode);         // We now hold a rough trace of the finder bars that border 2         // adjacent sides of a Data Matrix region.  The following steps         // will refine that region by building a transformation matrix         // that maps input pixel coordinates to a rectangular (usually         // square) 2D space of predetermined dimensions.  This is done         // by capturing and tweaking a "chain" of input values that are         // inputs to the transformation matrix and its inverse.         MatrixRegionInit(&matrixRegion, &(jumpScan.region.gradient));         success = MatrixRegionAlignFinderBars(&matrixRegion, decode, &followLeft, &followRight);         if(!success)            continue;         success = MatrixRegionAlignTop(&matrixRegion, decode);         if(!success)            continue;         success = MatrixRegionAlignSide(&matrixRegion, decode);         if(!success)            continue;         // XXX When adding clipping functionality against previously         // scanned barcodes, this is a good place to add a test for         // collisions.  Although we tested for this early on in the jump         // region scan, the subsequent follower and alignment steps may         // have moved us into a collision with another matrix region.  A         // collision at this point is grounds for immediate failure.         success = MatrixRegionFindSize(&matrixRegion, decode);         if(!success)            continue;         success = PopulateArrayFromImage(&matrixRegion, decode);         if(!success)            continue;         success = DecodeRegion(&matrixRegion);         if(!success)            continue;         // We are now holding a valid, fully decoded Data Matrix barcode.         // Add this to the list of valid barcodes and continue searching         // for more.         if(decode && decode->finalCallback)            (*(decode->finalCallback))(&matrixRegion);         decode->matrix[decode->matrixCount++] = matrixRegion;         if((decode->option & DmtxSingleScanOnly) && decode->matrixCount > 0)            break;      }   }   return decode->matrixCount;}/** * Sets the location and boundaries of a region to be scanned. * * @param range    Pointer to target DmtxScanRange * @param dir      Line direction (DmtxDirUp|DmtxDirLeft|DmtxDirDown|DmtxDirRight) * @param lineNbr  Number of row or column in image * @param firstPos Offset of first pixel in scan range * @param lastPos  Offset of last pixel in scan range * @return void */static voidScanRangeSet(DmtxScanRange *range, DmtxDirection dir, int lineNbr, int firstPos, int lastPos){   memset(range, 0x00, sizeof(DmtxScanRange));   range->dir = dir;   range->lineNbr = lineNbr;   range->firstPos = firstPos;   range->lastPos = lastPos;}/** * XXX * @param dir XXX * @param turn XXX * @return XXX */static DmtxDirectionTurnCorner(DmtxDirection dir, int turn){   DmtxDirection newDir;   newDir = (turn == DMTX_TURN_CW) ? 0x0f & (dir >> 1) : 0x0f & (dir << 1);   return (newDir) ? newDir : (dir ^ 0x0f) & 0x09;}/** * Initializes jump scan variable boundaries and starting point.  Should * be called once per input line (row or column) prior to searching for * jump regions. * * @param jumpScan XXX * @param dir      XXX * @param lineNbr  XXX * @param start    XXX * @param length   XXX * @return void */static voidJumpScanInit(DmtxJumpScan *jumpScan, DmtxDirection dir, int lineNbr, int start, int length){   memset(jumpScan, 0x00, sizeof(DmtxJumpScan));   ScanRangeSet(&(jumpScan->range), dir, lineNbr, start, start + length - 1);   // Initialize "current" region to end at start of range   jumpScan->region.anchor2 = start;}/** * Zeros out *jumpRegion and repoints location to start the next region. * JumpScanInit() must be called before first call to JumpRegionIncrement(); * * @param jumpRegion XXX * @param range Pass range if initializing, NULL if incrementing * @return void */static voidJumpRegionIncrement(DmtxJumpRegion *jumpRegion){   int anchorTmp;   // NOTE: First time here will show jump->region.gradient.isDefined ==   // DMTX_FALSE due to initialization in JumpScanInit()   // Reuse the trailing same-colored pixels from the previous region as   // the leading part of this region if a gradient was established   anchorTmp = (jumpRegion->gradient.isDefined) ? jumpRegion->lastJump : jumpRegion->anchor2;   memset(jumpRegion, 0x00, sizeof(DmtxJumpRegion));   jumpRegion->anchor1 = anchorTmp;}/** * XXX * * @param jumpScan XXX * @param decode   XXX * @return offset | DMTX_END_OF_RANGE */// XXX THIS FUNCTION HAS NOT BEEN REWRITTEN YETstatic intJumpScanNextRegion(DmtxJumpScan *jumpScan, DmtxDecode *decode){   DmtxJumpRegion  *region;   DmtxScanRange   *range;   int             anchor1Offset, anchor2Offset;   float           colorDist;   float           offGradient, alongGradient;   DmtxColor3      cDist;   int             minMaxFlag;   float           aThird;   // XXX When adding clipping against previously scanned barcodes you will do a check:   // if first point is in an existing region then fast forward to after the existing region   // if non-first point hits a region then this defines the end of your jump region   region = &(jumpScan->region);   range = &(jumpScan->range);   if(region->anchor2 == range->lastPos)      return DMTX_END_OF_RANGE;   JumpRegionIncrement(region);   anchor1Offset = dmtxImageGetOffset(&(decode->image), jumpScan->range.dir, range->lineNbr, region->anchor1);   dmtxColor3FromPixel(&(region->gradient.color), &(decode->image.pxl[anchor1Offset]));   // For each pixel in the range   for(region->anchor2 = region->anchor1 + 1; region->anchor2 != range->lastPos; region->anchor2++) {      anchor2Offset = dmtxImageGetOffset(&(decode->image), jumpScan->range.dir, range->lineNbr, region->anchor2);      // Capture previous and current pixel color      region->gradient.colorPrev = region->gradient.color;      dmtxColor3FromPixel(&(region->gradient.color), &(decode->image.pxl[anchor2Offset]));      // Measure color distance from previous pixel color      dmtxColor3Sub(&cDist, &(region->gradient.color), &(region->gradient.colorPrev));      colorDist = dmtxColor3Mag(&cDist);      // If color distance is larger than image noise      if(colorDist > DMTX_MIN_JUMP_DISTANCE) {         // If gradient line does not exist then         if(!region->gradient.isDefined) {            // Create gradient line            region->gradient.ray.p = region->gradient.colorPrev;            region->gradient.ray.c = cDist;            dmtxColor3Norm(&(region->gradient.ray.c));            // Update tMax, tMin, and derived values            region->gradient.isDefined = 1;            region->gradient.tMin = 0; // XXX technically this is not necessary (already initialized)            region->gradient.tMax = dmtxDistanceAlongRay3(&(region->gradient.ray), &(region->gradient.color));            region->gradient.tMid = (region->gradient.tMin + region->gradient.tMax)/2.0;            minMaxFlag = 1; // Latest hit was on the high side            region->lastJump = region->anchor2; // XXX see, this is why the logic shouldn't be in two places         }         else { // Gradient line does exist            // Measure distance from current gradient line            offGradient = dmtxDistanceFromRay3(&(region->gradient.ray), &(region->gradient.color));            // If distance from gradient line is large            if(offGradient > DMTX_MAX_COLOR_DEVN) {               if(decode && decode->stepScanCallback)                  (*(decode->stepScanCallback))(decode, range, jumpScan);               return DMTX_SUCCESS;            }            else { // Distance from gradient line is small               // Update tMax, tMin (distance along gradient lines), and derived values if necessary               alongGradient = dmtxDistanceAlongRay3(&(region->gradient.ray), &(region->gradient.color));               if(alongGradient < region->gradient.tMin)                  region->gradient.tMin = alongGradient;               else if(alongGradient > region->gradient.tMax)                  region->gradient.tMax = alongGradient;               region->gradient.tMid = (region->gradient.tMin + region->gradient.tMax)/2.0;               // Record that another big jump occurred               // XXX this should probably record gradient direction shifts rather than big jumps               aThird = (region->gradient.tMax - region->gradient.tMin)/2.0;               if(((minMaxFlag == 1 && alongGradient < region->gradient.tMin + aThird) ||                     (minMaxFlag == -1 && alongGradient > region->gradient.tMax - aThird)) &&                     aThird > 5.0) {                  region->jumpCount++;                  region->lastJump = region->anchor2;                  minMaxFlag *= -1;               }            }         }      }   }   if(decode && decode->stepScanCallback)      (*(decode->stepScanCallback))(decode, range, jumpScan);   return DMTX_SUCCESS;}/** * Returns true if a jump region is determined to be valid, else false. * * @param jumpRegion XXX * @return jump region validity (true|false) */static intJumpRegionValid(DmtxJumpRegion *jumpRegion){   return (jumpRegion->jumpCount > DMTX_MIN_JUMP_COUNT &&           abs(jumpRegion->anchor2 - jumpRegion->anchor1) > DMTX_MIN_STEP_RANGE);}/** * XXX * * @param * @return void */static voidEdgeScanInit(DmtxEdgeScan *edgeScan, DmtxJumpScan *jumpScan){   memset(edgeScan, 0x00, sizeof(DmtxEdgeScan));   // Set edge scan range by starting with a copy of the jump scan's range   edgeScan->range = jumpScan->range;   edgeScan->range.firstPos = jumpScan->region.anchor1;   edgeScan->range.lastPos = jumpScan->region.anchor2 - 1;   // Initialize "current" edge to end at start of full jump scan range   edgeScan->edge.offset = edgeScan->edgeNext.offset = edgeScan->range.firstPos;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91网站在线播放| 亚洲激情中文1区| 美日韩一级片在线观看| 欧美精品 国产精品| 欧美a一区二区| 欧美精品一区二区三| 国产69精品久久久久777| 国产精品久久福利| 色综合天天天天做夜夜夜夜做| 一区二区三区中文字幕精品精品| 欧美日韩精品一区二区三区蜜桃 | 欧美变态tickling挠脚心| 韩国一区二区视频| 国产精品入口麻豆原神| 色哟哟日韩精品| 蜜臀久久99精品久久久久久9| 久久综合九色综合97婷婷| av一区二区久久| 日韩电影在线看| 国产目拍亚洲精品99久久精品| 在线免费不卡视频| 久久91精品国产91久久小草 | 日韩欧美国产一区二区三区| 国产精品亚洲第一区在线暖暖韩国| 欧美韩国日本综合| 欧美亚洲图片小说| 国产一区二区三区在线观看免费视频| 国产精品久久久久久久久免费樱桃 | 中文在线一区二区| 欧美日免费三级在线| 国产精品综合在线视频| 亚洲一区二区三区小说| 久久久久久久久久美女| 91在线视频播放| 极品少妇xxxx精品少妇偷拍| 亚洲激情图片一区| 久久久久99精品一区| 欧美乱熟臀69xxxxxx| 国产91清纯白嫩初高中在线观看| 亚洲在线观看免费| 国产欧美久久久精品影院| 欧美一区二区三区在线看| av不卡在线播放| 国产一区视频网站| 午夜成人免费视频| 亚洲国产日韩av| 久久久久97国产精华液好用吗| 欧美网站一区二区| jizz一区二区| 国产九九视频一区二区三区| 天天综合网天天综合色| 一区二区日韩av| 中文字幕日韩av资源站| 久久久午夜精品| 欧美成人一级视频| 欧美一区二区三区四区久久| 日本丶国产丶欧美色综合| 成人教育av在线| 精品一区二区精品| 日韩电影免费在线看| 亚洲一级片在线观看| 亚洲卡通动漫在线| 亚洲视频一二区| 中文字幕在线不卡一区二区三区| 国产视频一区在线观看| 2020日本不卡一区二区视频| 欧美一卡在线观看| 91精品免费在线| 欧美另类一区二区三区| 欧美日韩一二三| 精品视频1区2区| 欧美日韩久久一区二区| 欧美视频一区二区三区在线观看| 91福利小视频| 欧美在线一二三| 欧美日韩精品三区| 欧美手机在线视频| 欧美日本一区二区| 欧美日韩国产综合视频在线观看| 欧美性一区二区| 欧美狂野另类xxxxoooo| 8x8x8国产精品| 日韩手机在线导航| 精品va天堂亚洲国产| 国产亚洲欧美一区在线观看| 国产欧美精品在线观看| 国产精品久久久久久久蜜臀| 亚洲日本一区二区| 亚洲va欧美va国产va天堂影院| 亚洲v中文字幕| 看片网站欧美日韩| 国产一区激情在线| 波多野洁衣一区| 在线亚洲一区二区| 制服丝袜av成人在线看| 欧美电视剧免费观看| 久久精品人人爽人人爽| 国产精品国产自产拍高清av王其| 亚洲综合区在线| 蜜臀久久久99精品久久久久久| 国产精品亚洲成人| 色综合久久久久| 欧美一级高清片| 国产女同性恋一区二区| 伊人性伊人情综合网| 日韩高清欧美激情| 国产精品一二三区| 91黄色小视频| 精品国产乱码久久久久久老虎| 国产精品视频第一区| 亚洲国产精品久久久久婷婷884| 麻豆精品视频在线观看视频| 成人久久视频在线观看| 精品视频色一区| 欧美国产一区在线| 亚洲观看高清完整版在线观看| 久久99这里只有精品| 99久久99久久久精品齐齐| 欧美美女视频在线观看| 国产亚洲欧美色| 亚洲成年人网站在线观看| 国产精品影音先锋| 欧美日韩精品一区二区天天拍小说| 久久色在线观看| 亚洲123区在线观看| 国产v综合v亚洲欧| 日韩欧美国产一区在线观看| 亚洲人成7777| 韩国一区二区三区| 欧美色综合网站| 国产精品欧美久久久久一区二区| 五月天婷婷综合| 91麻豆精东视频| 久久日韩粉嫩一区二区三区| 亚洲一区二区成人在线观看| 粉嫩绯色av一区二区在线观看| 欧美裸体一区二区三区| 日韩毛片一二三区| 国产风韵犹存在线视精品| 欧美日韩欧美一区二区| 亚洲丝袜精品丝袜在线| 国产一区二区福利| 日韩午夜电影av| 五月婷婷综合激情| 欧美视频一区二| 亚洲人被黑人高潮完整版| 高清在线观看日韩| 中文字幕二三区不卡| 久久av资源网| 91麻豆精品国产综合久久久久久| 亚洲精品国产a久久久久久| 成人美女视频在线观看| 国产色产综合色产在线视频| 捆绑调教一区二区三区| 欧美一区二区三区婷婷月色| 亚洲风情在线资源站| 欧美亚洲动漫精品| 亚洲一区二区欧美| 91久久精品一区二区| 亚洲精品久久嫩草网站秘色| eeuss鲁片一区二区三区 | 中文字幕高清不卡| 国产精品一区免费在线观看| 欧美精品一区二区久久婷婷| 美女一区二区三区| 欧美成人精品高清在线播放| 美女视频黄 久久| 日韩女优av电影| 精品一区二区影视| 2022国产精品视频| 国产成人av电影在线观看| 国产色综合久久| av激情成人网| 亚洲日本电影在线| 在线视频观看一区| 日韩影视精彩在线| 欧美三级韩国三级日本三斤| 婷婷开心激情综合| 5858s免费视频成人| 乱中年女人伦av一区二区| 精品久久久久一区二区国产| 国内精品自线一区二区三区视频| 久久久噜噜噜久噜久久综合| 成人午夜视频网站| 亚洲男人的天堂网| 在线播放欧美女士性生活| 美女在线一区二区| 欧美韩日一区二区三区| 91香蕉视频污在线| 丝袜国产日韩另类美女| 欧美成人猛片aaaaaaa| 成人久久久精品乱码一区二区三区| 综合分类小说区另类春色亚洲小说欧美| 色噜噜狠狠色综合欧洲selulu| 午夜影院久久久| 国产亚洲美州欧州综合国| 91丝袜美女网| 日本亚洲欧美天堂免费| 国产视频一区在线播放| 欧美性猛片aaaaaaa做受|