这篇教程C++ CreateImage函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中CreateImage函数的典型用法代码示例。如果您正苦于以下问题:C++ CreateImage函数的具体用法?C++ CreateImage怎么用?C++ CreateImage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了CreateImage函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: memset//骨架化void CImageProcess::Thinning(Image &source, Image &dst){ memset(dst._pData, 0, dst._height * dst._width); IplImage *tmp = CreateImage(source); IplImage *tmp_d = CreateImage(dst); cv::Mat src(tmp, 0); cv::Mat dst_t(tmp_d); dst_t = src.clone(); dst_t /= 255; // convert to binary image cv::Mat prev = cv::Mat::zeros(dst_t.size(), CV_8UC1); cv::Mat diff; do { ThinningIteration(dst_t, 0); ThinningIteration(dst_t, 1); cv::absdiff(dst_t, prev, diff); dst_t.copyTo(prev); } while (cv::countNonZero(diff) > 0); dst_t *= 255; IplImage tmp_(dst_t); IplImge2Image(&tmp_, dst); ReleaseUserImage(&tmp); ReleaseUserImage(&tmp_d);}
开发者ID:shengdewu,项目名称:repository,代码行数:27,
示例2: InitInterface_RRvoid InitInterface_RR(string iniName,ref myCh,ref enemyCh){ refMyCharacter = myCh; refEnemyCharacter = enemyCh; GameInterface.title = "titleRansack"; SendMessage(&GameInterface,"ls",MSG_INTERFACE_INIT,iniName); SetVariable(); ref shipRef = GetShipByType(sti(refMyCharacter.ship.Type)); CreateImage("myShip","SHIPS",shipRef.name,32,39,160,167); CreateImage("myFace","FACE128_"+refMyCharacter.FaceId,"face",164,39,292,167); CreateString(TRUE,"MyShipType",XI_ConvertString(shipRef.Name),FONT_NORMAL,COLOR_NORMAL,96,140,SCRIPT_ALIGN_CENTER,1.0); CreateString(TRUE,"MyShipName",refMyCharacter.ship.Name,FONT_NORMAL,COLOR_NORMAL,177,198,SCRIPT_ALIGN_CENTER,1.0); shipRef = GetShipByType(sti(refEnemyCharacter.ship.Type)); CreateImage("enemyShip","SHIPS",shipRef.name,480,39,608,167); CreateImage("enemyFace","FACE128_"+refEnemyCharacter.FaceId,"face",348,39,476,167); CreateString(TRUE,"EnemyShipType",XI_ConvertString(shipRef.Name),FONT_NORMAL,COLOR_NORMAL,544,140,SCRIPT_ALIGN_CENTER,1.0); CreateString(TRUE,"EnemyShipName",refEnemyCharacter.ship.Name,FONT_NORMAL,COLOR_NORMAL,463,198,SCRIPT_ALIGN_CENTER,1.0); CreateString(TRUE,"String1",XI_ConvertString(str1),FONT_NORMAL,COLOR_NORMAL,320,240,SCRIPT_ALIGN_CENTER,1.0); CreateString(TRUE,"String2",XI_ConvertString(str2),FONT_NORMAL,COLOR_NORMAL,320,268,SCRIPT_ALIGN_CENTER,1.0); CreateString(TRUE,"String3",XI_ConvertString(str3_1)+" "+nSurrenderedMen+" "+XI_ConvertString(str3_2),FONT_NORMAL,COLOR_NORMAL,320,296,SCRIPT_ALIGN_CENTER,1.0); SetEventHandler("InterfaceBreak","ProcessCancelExit",0); SetEventHandler("InterfaceCancel","ProcessCancelExit",0); SetEventHandler("KillPress","KillProcess",0); SetEventHandler("SlavesPress","SlavesProcess",0);}
开发者ID:ekuznets,项目名称:PKM2,代码行数:30,
示例3: RegionsToSIFTDescriptorsvoid RegionsToSIFTDescriptors( PStack regions, PStack descriptors, int pb, int ob, int psize ) { if ( regions == NULL || descriptors == NULL ) return; if ( psize % 2 == 0 ) psize++; Image patch = CreateImage(psize*sqrt(2),psize*sqrt(2)); Image rpatch = CreateImage(psize,psize); FStack orientations = NewFStack(15); int k; for (k=0;k<regions->stacksize;k++) { Region region = regions->items[k]; RegionToPatch(region,region->image,patch,6.0); DeterminePatchOrientations(patch,orientations); while ( !FStackEmpty(orientations) ) { float orientation = PopFStack(orientations); RotateImage(patch,rpatch,orientation); float * newDescriptor = PCADescriptorFromPatch(rpatch); PushPStack(descriptors,NewDescriptor(region,36,3,newDescriptor)); } } FreeFStack(orientations); FreeImage(patch); FreeImage(rpatch);}
开发者ID:kraftp,项目名称:Leginon-Feature-Detection-Modification,代码行数:27,
示例4: FindMaxMin/* Find the local maxima and minima of the DOG images in scale space. Return the keypoints for these locations, added to existing "keys".*/KKeypoint FindMaxMin(Image *dogs, Image *blur, float octSize, KKeypoint keys){ int s, r, c, rows, cols; float val, **pix; Image map, grad, ori; rows = dogs[0]->rows; cols = dogs[0]->cols; /* Create an image map in which locations that have a keypoint are marked with value 1.0, to prevent two keypoints being located at same position. This may seem an inefficient data structure, but does not add significant overhead. */ map = CreateImage(rows, cols, IMAGE_POOL); for (r = 0; r < rows; r++) for (c = 0; c < cols; c++) map->pixels[r][c] = 0.0; /* Search through each scale, leaving 1 scale below and 1 above. There are Scales+2 dog images. */ for (s = 1; s < Scales+1; s++) { /* For each intermediate image, compute gradient and orientation images to be used for keypoint description. */ grad = CreateImage(rows, cols, IMAGE_POOL); ori = CreateImage(rows, cols, IMAGE_POOL); GradOriImages(blur[s], grad, ori); pix = dogs[s]->pixels; /* Pointer to pixels for this scale. */ /* Only find peaks at least BorderDist samples from image border, as peaks centered close to the border will lack stability. */ assert(BorderDist >= 2); for (r = BorderDist; r < rows - BorderDist; r++) for (c = BorderDist; c < cols - BorderDist; c++) { val = pix[r][c]; /* Pixel value at (r,c) position. */ /* DOG magnitude must be above 0.8 * PeakThresh threshold (precise threshold check will be done once peak interpolation is performed). Then check whether this point is a peak in 3x3 region at each level, and is not on an elongated edge. */ if (fabs(val) > 0.8 * PeakThresh && LocalMaxMin(val, dogs[s], r, c) && LocalMaxMin(val, dogs[s-1], r, c) && LocalMaxMin(val, dogs[s+1], r, c) && NotOnEdge(dogs[s], r, c)) keys = InterpKeyPoint(dogs, s, r, c, grad, ori, map, octSize, keys, 5); } } return keys;}
开发者ID:BOTSlab,项目名称:bupimo_src,代码行数:61,
示例5: CreateImageImage *WaterGray(Image *img, Image *marker, AdjRel *A){ Image *cost=NULL,*label=NULL, *pred=NULL; GQueue *Q=NULL; int i,p,q,tmp,n,lambda=1; Pixel u,v; n = img->ncols*img->nrows; cost = CreateImage(img->ncols,img->nrows); label = CreateImage(img->ncols,img->nrows); pred = CreateImage(img->ncols,img->nrows); Q = CreateGQueue(MaximumValue(marker)+2,n,cost->val); // Trivial path initialization for (p=0; p < n; p++) { cost->val[p]=marker->val[p]+1; pred->val[p]=NIL; InsertGQueue(&Q,p); } // Path propagation while(!EmptyGQueue(Q)) { p=RemoveGQueue(Q); if (pred->val[p]==NIL) { // on-the-fly root detection cost->val[p] =img->val[p]; label->val[p]=lambda; lambda++; } u.x = p%img->ncols; u.y = p/img->ncols; for (i=1; i < A->n; i++){ v.x = u.x + A->dx[i]; v.y = u.y + A->dy[i]; if (ValidPixel(img,v.x,v.y)){ q = v.x + img->tbrow[v.y]; if (cost->val[q] > cost->val[p]){ tmp = MAX(cost->val[p],img->val[q]); if (tmp < cost->val[q]){ RemoveGQueueElem(Q,q); pred->val[q] = p; label->val[q] = label->val[p]; cost->val[q] = tmp; InsertGQueue(&Q,q); } } } } } DestroyGQueue(&Q); DestroyImage(&cost); DestroyImage(&pred); return(label);}
开发者ID:afalcao,项目名称:ift-demo,代码行数:55,
示例6: imagevoidPNGTests::testWriter() { static const int width = 256; static const int height = 256; // create an image and fill it with random data auto_ptr<Image> image(CreateImage(width, height, PF_R8G8B8A8)); setRandomBytes((byte*)image->getPixels(), width * height * 4); // generate filename char* filename = tmpnam(0); CPPUNIT_ASSERT_MESSAGE("opening temporary file", filename != 0); // save image CPPUNIT_ASSERT(SaveImage(filename, FF_PNG, image.get()) == true); // load it back auto_ptr<Image> img2(OpenImage(filename, PF_R8G8B8A8)); CPPUNIT_ASSERT_MESSAGE("reloading image file", img2.get() != 0); AssertImagesEqual( "comparing saved with loaded", image.get(), img2.get()); // force pixel format conversion (don't destroy the old image) auto_ptr<Image> img3(OpenImage(filename, PF_R8G8B8)); CPPUNIT_ASSERT(SaveImage(filename, FF_PNG, img3.get()) == true); remove(filename); //== PALETTIZED SAVING TEST == // disabled until loading palettized PNGs with a correct palette format // is implemented.#if 0 char* plt_filename = tmpnam(0); CPPUNIT_ASSERT_MESSAGE("opening temporary file (palette)", plt_filename != 0); auto_ptr<Image> plt(CreateImage(256, 256, PF_I8, 256, PF_R8G8B8)); setRandomBytes((byte*)plt->getPixels(), 256 * 256); setRandomBytes((byte*)plt->getPalette(), 256); CPPUNIT_ASSERT(SaveImage(plt_filename, FF_PNG, plt.get()) == true); auto_ptr<Image> plt2(OpenImage(plt_filename, FF_PNG)); CPPUNIT_ASSERT_MESSAGE("reloading palettized image", plt2.get() != 0); CPPUNIT_ASSERT(plt2->getPaletteSize() == 256); CPPUNIT_ASSERT(plt2->getPaletteFormat() == PF_R8G8B8); CPPUNIT_ASSERT(plt2->getFormat() == PF_I8); AssertImagesEqual("Comparing palettized image", plt.get(), plt2.get()); remove(plt_filename);#endif}
开发者ID:marcclintdion,项目名称:iOS_WIN3,代码行数:54,
示例7: mainint main() { Handle splash = 0; CreateImage(splash, splash_png, sizeof(splash_png)); DrawImage(splash, 0, 0); UpdateScreen(); do { Wait(WAIT_KEY); if(GetKeys() & MAK_FIRE) break; } while(1); DestroyObject(splash); Handle backg = 0; CreateImage(backg, ttsdemo_png, sizeof(ttsdemo_png)); DrawImage(backg, 0, 0); UpdateScreen(); int oldKeys = GetKeys(); while(1) { Wait(WAIT_KEY); int newKeys = GetKeys(); int downedKeys = newKeys & (~oldKeys); oldKeys = newKeys; if(downedKeys) StopSpeaking(); if(downedKeys & MAK_FIRE) { StartSpeaking("Du st C++ CreateIoCompletionPort函数代码示例 C++ CreateIconIndirect函数代码示例
|