• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ colsize函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中colsize函数的典型用法代码示例。如果您正苦于以下问题:C++ colsize函数的具体用法?C++ colsize怎么用?C++ colsize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了colsize函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: lreconseros

/* ==================================== */
int32_t lreconseros(
        struct xvimage *g,
        struct xvimage *f,
        int32_t connex) 
/* reconstruction de g sur f */
/* g : image marqueur */
/* f : image masque */
/* connex : 4 ou 8 */
/* resultat dans g */
/* ==================================== */
{
#undef F_NAME
#define F_NAME "lreconseros"
  int32_t ret, i;
  int32_t rs = rowsize(f);      /* taille ligne */
  int32_t cs = colsize(f);      /* taille colonne */
  int32_t ds = depth(f);        /* nb plans */
  int32_t N = rs * cs * ds;
  uint8_t *F = UCHARDATA(f);
  uint8_t *G = UCHARDATA(g);
  if ((rowsize(g) != rs) || (colsize(g) != cs) || (depth(g) != ds))
  {
    fprintf(stderr, "%s: incompatible sizes\n", F_NAME);
    return 0;
  }
  for (i = 0; i < N; i++) F[i] = NDG_MAX - F[i];
  for (i = 0; i < N; i++) G[i] = NDG_MAX - G[i];
  ret = lwshedtopo_lreconsdilat(g, f, connex);
  for (i = 0; i < N; i++) G[i] = NDG_MAX - G[i];

  return(ret);
} /* lreconseros() */
开发者ID:Atcold,项目名称:lua---imgraph,代码行数:33,代码来源:lwshedtopo.c


示例2: ldesfilsclairs3d

/* ==================================== */
int32_t ldesfilsclairs3d(struct xvimage * image, struct xvimage * mask, int32_t connexmin)
/* ==================================== */
#undef F_NAME
#define F_NAME "ldesfilsclairs3d"
{
  int32_t x;
  uint8_t *F = UCHARDATA(image);
  uint8_t *M;
  int32_t rs = rowsize(image);     /* taille ligne */
  int32_t cs = colsize(image);     /* taille colonne */
  int32_t ps = rs * cs;            /* taille plan */
  int32_t ds = depth(image);       /* nombre plans */
  int32_t N = ds * ps;             /* taille image */

  mctopo3d_init_topo3d();

  /* ---------------------------------------------------------- */
  /* calcul du resultat */
  /* ---------------------------------------------------------- */
  
  if (mask)
  {
    if ((rowsize(mask) != rs) || (colsize(mask) != cs) || (depth(mask) != ds))
    {
      fprintf(stderr, "%s: tailles image et mask incompatibles\n", F_NAME);
      return 0;
    }
    M = UCHARDATA(mask);
    if (connexmin == 6)
    {
      for (x = 0; x < N; x++) /* init : empile les points candidats */
        if (M[x] && (mctopo3d_filclair6(F, x, rs, ps, N)))
          F[x] = mctopo3d_alpha26m(F, x, rs, ps, N);
    }
    else
    {
      for (x = 0; x < N; x++) /* init : empile les points candidats */
        if (M[x] && (mctopo3d_filclair26(F, x, rs, ps, N)))
          F[x] = mctopo3d_alpha6m(F, x, rs, ps, N);
    }
  }
  else
  {
    if (connexmin == 6)
    {
      for (x = 0; x < N; x++) /* init : empile les points candidats */
        if (mctopo3d_filclair6(F, x, rs, ps, N))
          F[x] = mctopo3d_alpha26m(F, x, rs, ps, N);
    }
    else
    {
      for (x = 0; x < N; x++) /* init : empile les points candidats */
        if (mctopo3d_filclair26(F, x, rs, ps, N))
          F[x] = mctopo3d_alpha6m(F, x, rs, ps, N);
    }
  }

  mctopo3d_termine_topo3d();
  return 1;
} /* ldesfilsclairs3d() */
开发者ID:Johnson13,项目名称:xLearn,代码行数:61,代码来源:lfiltrestopo.c


示例3: lwshedtopo_lreconsdilat

/* ==================================== */
int32_t lwshedtopo_lreconsdilat(
        struct xvimage *g,
        struct xvimage *f,
        int32_t connex) 
/* reconstruction de g sous f */
/* g : image marqueur */
/* f : image masque */
/* connex : 4 ou 8 */
/* resultat dans g */
/* ==================================== */
{
#undef F_NAME
#define F_NAME "lwshedtopo_lreconsdilat"
  uint8_t *F = UCHARDATA(f);
  int32_t rs = rowsize(f);      /* taille ligne */
  int32_t cs = colsize(f);      /* taille colonne */
  int32_t ds = depth(f);        /* nb plans */
  int32_t N = rs * cs * ds;
  int32_t *CM;     // component mapping
  ctree * CT;  // component tree

  if ((rowsize(g) != rs) || (colsize(g) != cs) || (depth(g) != ds))
  {
    fprintf(stderr, "%s: incompatible sizes\n", F_NAME);
    return 0;
  }

  ComponentTree(F, rs, N, connex, &CT, &CM);
  Reconstruction(g, f, CM, CT);

  ComponentTreeFree(CT);
  free(CM);
  return(1);
} /* lwshedtopo_lreconsdilat() */
开发者ID:Atcold,项目名称:lua---imgraph,代码行数:35,代码来源:lwshedtopo.c


示例4: ldespuits3d

/* ==================================== */
int32_t ldespuits3d(struct xvimage * image, struct xvimage * mask, int32_t connexmin)
/* ==================================== */
#undef F_NAME
#define F_NAME "ldespuits3d"
{
  int32_t i;
  uint8_t *F = UCHARDATA(image);
  uint8_t *M;
  int32_t rs = rowsize(image);     /* taille ligne */
  int32_t cs = colsize(image);     /* taille colonne */
  int32_t ps = rs * cs;            /* taille plan */
  int32_t ds = depth(image);       /* nombre plans */
  int32_t N = ds * ps;             /* taille image */

  mctopo3d_init_topo3d();

  /* ---------------------------------------------------------- */
  /* calcul du resultat */
  /* ---------------------------------------------------------- */
  
  if (mask)
  {
    if ((rowsize(mask) != rs) || (colsize(mask) != cs) || (depth(mask) != ds))
    {
      fprintf(stderr, "%s: tailles image et mask incompatibles\n", F_NAME);
      return 0;
    }
    M = UCHARDATA(mask);
    if (connexmin == 6)
    {
      for (i = 0; i < N; i++)
        if (M[i] && (mctopo3d_well6(F, i, rs, ps, N)))
          F[i] = mctopo3d_alpha6p(F, i, rs, ps, N);
    }
    else
    {
      for (i = 0; i < N; i++)
        if (M[i] && (mctopo3d_well26(F, i, rs, ps, N)))
          F[i] = mctopo3d_alpha26p(F, i, rs, ps, N);
    }
  }
  else
  {
    if (connexmin == 6)
    {
      for (i = 0; i < N; i++)
        if (mctopo3d_well6(F, i, rs, ps, N))
          F[i] = mctopo3d_alpha6p(F, i, rs, ps, N);      
    }
    else
    {
      for (i = 0; i < N; i++)
        if (mctopo3d_well26(F, i, rs, ps, N))
          F[i] = mctopo3d_alpha26p(F, i, rs, ps, N);      
    }
  }

  mctopo3d_termine_topo3d();
  return 1;
} /* ldespics3d() */
开发者ID:Johnson13,项目名称:xLearn,代码行数:61,代码来源:lfiltrestopo.c


示例5: ldilat_ldilat

/* ==================================== */
int32_t ldilat_ldilat( struct xvimage *f, 
            struct xvimage *m, 
            int32_t xc, 
            int32_t yc)
/* m : masque representant l'element structurant */
/* xc, yc : coordonnees du "centre" de l'element structurant */
/* ==================================== */
{
  int32_t x;                       /* index muet de pixel */
  int32_t y;                       /* index muet (generalement un voisin de x) */
  register int32_t i, j;           /* index muet */
  register int32_t k, l;           /* index muet */
  int32_t rs = rowsize(f);         /* taille ligne */
  int32_t cs = colsize(f);         /* taille colonne */
  int32_t N = rs * cs;             /* taille image */
  int32_t rsm = rowsize(m);        /* taille ligne masque */
  int32_t csm = colsize(m);        /* taille colonne masque */
  uint8_t *M = UCHARDATA(m);
  uint8_t *F = UCHARDATA(f);
  uint8_t *H;                     /* image de travail */
  int32_t sup;
  int32_t t;

  if (depth(f) != 1) 
  {
    fprintf(stderr, "ldilat_ldilat: cette version ne traite pas les images volumiques\n");
    return 0;
  }

  H = (uint8_t *)calloc(1,N*sizeof(char));
  if (H == NULL)
  {   fprintf(stderr,"ldilat_ldilat() : malloc failed for H\n");
      return(0);
  }
  for (x = 0; x < N; x++) H[x] = F[x];

  for (y = 0; y < cs; y++)
  for (x = 0; x < rs; x++)
  {
    sup = NDG_MIN;
    for (j = 0; j < csm; j += 1)
    for (i = 0; i < rsm; i += 1)
    {
      t = (int32_t)M[j * rsm + i];
      if (t)
      {
        l = y + j - yc;
        k = x + i - xc;
        if ((l >= 0) && (l < cs) && (k >= 0) && (k < rs) && ((int32_t)H[l * rs + k] + t > sup))
           sup = (int32_t)H[l * rs + k] + t;
      }
    } 
    F[y * rs + x] = (uint8_t)mcmin(sup, NDG_MAX);
  }

  free(H);
  return 1;
}
开发者ID:Johnson13,项目名称:xLearn,代码行数:59,代码来源:ldilat.c


示例6: lordermaxima

/* ==================================== */
int32_t lordermaxima(struct xvimage *image, struct xvimage *order, int32_t connex, int32_t nblabels)
/* ==================================== */
/*! \fn int32_t lordermaxima(struct xvimage *image, struct xvimage *order, int32_t connex, int32_t nblabels)
    \param image (entrée) : une image
    \param order (entrée/sortie) : labels définissant les maxima (de 1 à nbmaxima, 0 pour les non-maxima)
    \param connex (entrée) : 4 ou 8 (2D), 6, 18 ou 26 (3D) 
    \param nblabels (entrée) : nombre de maxima plus 1
    \return code erreur : 0 si échec, 1 sinon
    \brief ordonne les labels sur les maxima par altitude croissante
*/
#undef F_NAME
#define F_NAME "lordermaxima"
{
  int32_t i;
  int32_t rs = rowsize(image);      /* taille ligne */
  int32_t cs = colsize(image);      /* taille colonne */
  int32_t ds = depth(image);        /* nb plans */
  int32_t ps = rs * cs;             /* taille plan */
  int32_t N = ps * ds;              /* taille image */
  uint8_t *F = UCHARDATA(image);      /* l'image de depart */
  int32_t *O = SLONGDATA(order);      /* l'image de labels */
  int32_t *A; // table de correspondance pour le tri
  int32_t *T; // table avec l'altitude de chaque maximum
  
  if ((rowsize(order) != rs) || (colsize(order) != cs) || (depth(order) != ds))
  {
    fprintf(stderr, "%s: incompatible image sizes\n", F_NAME);
    exit(0);
  }

  A = (int32_t *)malloc(nblabels * sizeof(int32_t));
  T = (int32_t *)malloc(nblabels * sizeof(int32_t));
  if ((A == NULL) || (T == NULL))
  {   fprintf(stderr, "%s() : malloc failed\n", F_NAME);
      return(0);
  }
  for (i = 0; i < nblabels; i++) A[i] = i;

  for (i = 0; i < N; i++) 
    if (O[i])
      T[O[i]] = (int32_t)F[i];

  i_TriRapideStochastique (A, T, 1, nblabels-1);

  for (i = 1; i < nblabels; i++)
    T[A[i]] = i;
  for (i = 0; i < N; i++) 
    if (O[i])
      O[i] = T[O[i]];

  free(A);
  free(T);
  return 1;
} // lordermaxima()
开发者ID:clementfarabet,项目名称:xLearn,代码行数:55,代码来源:ldynamique.c


示例7: attributNoeud

// Calcul les attributs surface et profondeur du RAG
void attributNoeud(RAG *rag, struct xvimage *label, struct xvimage *ga, struct xvimage *annexe)
{
  int32_t i;
  int32_t rs = rowsize(label);                   /* taille ligne      */
  int32_t cs = colsize(label);                   /* taille colonne    */
  int32_t N = rs * cs;                           /* taille image      */
  int32_t *LABEL = SLONGDATA(label);           /* les labels        */
  uint8_t *F;
  int32_t alt;
  int32_t l;

  if (annexe!=NULL)   F = UCHARDATA(annexe);

  for(i = 0; i < rag->g->nsom; i++) {
    /* tout ca peut se calculer au vol lors de la construction de la LPE */
    rag->surface[i] = 0;
    rag->profondeur[i] = 255;
    rag->altitude[i] = 0;
  }
  
  for(i = 0; i < N; i++) {
    alt = altitudePoint(ga, i);
    l = LABEL[i];
    rag->profondeur[l] = mcmin(alt,rag->profondeur[l]);
    rag->surface[l] ++;
    if (annexe!=NULL)
      rag->altitude[l] = F[i];
  }
}
开发者ID:Atcold,项目名称:lua---imgraph,代码行数:30,代码来源:lhierarchie.c


示例8: SLONGDATA

/* Returns (in the form of a 4-connected GA) the edges that link two
   points with different labels */
struct xvimage *SeparatingEdge(struct xvimage *labels)
#undef F_NAME
#define F_NAME "mSeparatingEdge"
{
  struct xvimage *ga;
  int32_t *lab = SLONGDATA(labels);
  int32_t rs = rowsize(labels);     /* taille ligne */
  int32_t cs = colsize(labels);     /* taille colonne */
  int32_t N = rs * cs;              /* taille image */
  int32_t i,j,u,x,y;

  if( (ga = allocGAimage(NULL, rs, cs, 1, VFF_TYP_GABYTE)) == NULL) {
    fprintf(stderr,"%s: ne peut allouer de GA \n", F_NAME);
      exit(1);
  }
  uint8_t *F = UCHARDATA(ga);      /* le resultat */
  memset(F,0,2*N);
  /* les aretes horizontales */ 
  for(j = 0; j < cs; j++)
    for(i = 0; i < rs -1; i++){
      u = j * rs + i; x = Sommetx(u,N,rs); y = Sommety(u,N,rs);
      if(lab[x] != lab[y])
	F[u] = 255;
    }
  /* puis les aretes verticales */
  for(j = 0; j < cs -1; j++)
    for(i = 0; i < rs; i++){
      u = N + j * rs + i; x = Sommetx(u,N,rs); y = Sommety(u,N,rs);
      if(lab[x] != lab[y])
	F[u] = 255;
    }
  return ga;
}
开发者ID:Atcold,项目名称:lua---imgraph,代码行数:35,代码来源:llpeGA.c


示例9: colsize

void GridTestCase::Size()
{
    // TODO on OSX resizing interactively works, but not automated
#if wxUSE_UIACTIONSIMULATOR && !defined(__WXGTK__) && !defined(__WXOSX__)
    EventCounter colsize(m_grid, wxEVT_GRID_COL_SIZE);
    EventCounter rowsize(m_grid, wxEVT_GRID_ROW_SIZE);

    wxUIActionSimulator sim;

    wxPoint pt = m_grid->ClientToScreen(wxPoint(m_grid->GetRowLabelSize() +
                                        m_grid->GetColSize(0), 5));

    sim.MouseMove(pt);
    wxYield();

    sim.MouseDown();
    wxYield();

    sim.MouseMove(pt.x + 50, pt.y);
    wxYield();

    sim.MouseUp();
    wxYield();

    CPPUNIT_ASSERT_EQUAL(1, colsize.GetCount());

    pt = m_grid->ClientToScreen(wxPoint(5, m_grid->GetColLabelSize() +
                                        m_grid->GetRowSize(0)));

    sim.MouseDragDrop(pt.x, pt.y, pt.x, pt.y + 50);
    wxYield();

    CPPUNIT_ASSERT_EQUAL(1, rowsize.GetCount());
#endif
}
开发者ID:ExperimentationBox,项目名称:Edenite,代码行数:35,代码来源:gridtest.cpp


示例10: ldespics

/* ==================================== */
int32_t ldespics(struct xvimage * image, struct xvimage * mask, int32_t connexmin)
/* ==================================== */
#undef F_NAME
#define F_NAME "ldespics"
{
  int32_t i;
  uint8_t *F = UCHARDATA(image);
  uint8_t *M;
  int32_t rs = image->row_size;
  int32_t cs = image->col_size;
  int32_t N = rs * cs;

  if (depth(image) != 1) 
  {
    fprintf(stderr, "%s: cette version ne traite pas les images volumiques\n", F_NAME);
    exit(0);
  }

  /* ---------------------------------------------------------- */
  /* calcul du resultat */
  /* ---------------------------------------------------------- */
  
  if (mask)
  {
    if ((rowsize(mask) != rs) || (colsize(mask) != cs) || (depth(mask) != 1))
    {
      fprintf(stderr, "%s: tailles image et mask incompatibles\n", F_NAME);
      exit(0);
    }
    M = UCHARDATA(mask);
    if (connexmin == 8)
    {
      for (i = 0; i < N; i++)
        if (M[i] && (typetopo8(F, i, rs, N) == PEAK))
          F[i] = alpha4m(F, i, rs, N);
    }
    else
    {
      for (i = 0; i < N; i++)
        if (M[i] && (typetopo(F, i, rs, N) == PEAK))
          F[i] = alpha8m(F, i, rs, N);
    }
  }
  else
  {
    if (connexmin == 8)
    {
      for (i = 0; i < N; i++)
        if (typetopo8(F, i, rs, N) == PEAK)
          F[i] = alpha4m(F, i, rs, N);
    }
    else
    {
      for (i = 0; i < N; i++)
        if (typetopo(F, i, rs, N) == PEAK)
          F[i] = alpha8m(F, i, rs, N);
    }
  }
  return 1;
} /* ldespics() */
开发者ID:Johnson13,项目名称:xLearn,代码行数:61,代码来源:lfiltrestopo.c


示例11: rowsize

// Construit un RAG a partir d'une partition (label) et d'un ga
RAG *construitRAG(struct xvimage *ga, struct xvimage *label, struct xvimage *annexe)
#undef F_NAME
#define F_NAME "construitRAGOpening"
{
  RAG *rag;
  int32_t i,x,y,u;
  int32_t rs = rowsize(label);     /* taille ligne */
  int32_t cs = colsize(label);     /* taille colonne */
  int32_t N = rs * cs;             /* taille image */
  int32_t N_t = 2*N;
  int32_t *LABEL = SLONGDATA(label);              /* l'image de depart */
  int32_t nblabels;

  nblabels = 0;
  for(i = 0; i < N; i++)
    if(LABEL[i] > nblabels) nblabels = LABEL[i];
  nblabels++;
  rag = initRAG(nblabels, 4*N);
  /* Parcourt de toutes les aretes du graphe d'arete F */
  for(u = 0; u < N_t; u ++){
    // si l'arete est bien ds le GA
    if( ( (u < N) && (u%rs < rs-1)) || ((u >= N) && (u < N_t - rs))){
      x = Sommetx(u, N, rs);
      y = Sommety(u, N, rs);
      if(LABEL[x] != LABEL[y]) updateRAGArc(rag, LABEL[x], LABEL[y], UCHARDATA(ga)[u]);
    }
  }
  // Puis calcul les attributs de noeuds du rag
  attributNoeud(rag,label,ga,annexe);  
  return rag;
}
开发者ID:Atcold,项目名称:lua---imgraph,代码行数:32,代码来源:lhierarchie.c


示例12: StreamGArecursif

int32_t StreamGArecursif(struct xvimage *ga, int32_t x, Lifo *FIFO, int32_t *Label, int32_t *alt, uint8_t *G)
#undef F_NAME
#define F_NAME "LPEGrapheAreteValuee" 
{
  int32_t rs = rowsize(ga);               /* taille ligne */
  int32_t cs = colsize(ga);               /* taille colonne */
  int32_t N = rs * cs;                    /* taille image */
  uint8_t *F = UCHARDATA(ga);
  int32_t labStream,k,u,y;
  Label[x] = IN_PROCESS;
  LifoPush(FIFO, x);
  for(k = 0; k < 4; k++)
    if((u = incidente(x, k, rs, N)) != -1) 
      if(F[u] == G[x]){
	switch(k){
	case 0: y = x+1; break;      /* EST   */ 
	case 1: y = x-rs; break;     /* NORD  */
	case 2: y = x-1; break;      /* OUEST */
	case 3: y = x+rs; break;     /* SUD   */ 
	}
	if(Label[y] == NO_LABEL) {
	  labStream = StreamGArecursif(ga, y, FIFO, Label, alt,G);
	  if( (labStream >= 0) || ( (*alt) < (int32_t)G[x]) )
	    return labStream;
	}
	else if (Label[y] >= 0){
	  //(*alt) = G[y];
	  return Label[y];
	}	  
      }
  (*alt) = (int32_t)G[x];
  return NO_LABEL;
}
开发者ID:Atcold,项目名称:lua---imgraph,代码行数:33,代码来源:llpeGA.c


示例13: TMVAssert

 void HermBandSVDiv<T>::doRDiv(
     const GenMatrix<T1>& m, MatrixView<T2> x) const
 {
     TMVAssert(m.colsize() == x.colsize());
     TMVAssert(m.rowsize() == rowsize());
     TMVAssert(x.rowsize() == colsize());
     CallSV_RDiv(T(),pimpl->U,pimpl->S,pimpl->U.adjoint(),pimpl->kmax,m,x);
 }
开发者ID:rmjarvis,项目名称:tmv,代码行数:8,代码来源:TMV_SymBandSVD.cpp


示例14: lattribheight_inverse

/* ==================================== */
void lattribheight_inverse(struct xvimage * image)
/* ==================================== */
{
  int32_t i, N = rowsize(image) * colsize(image) * depth(image);
  uint8_t *pt;
  for (pt = UCHARDATA(image), i = 0; i < N; i++, pt++)
    *pt = NDG_MAX - *pt;
} // inverse
开发者ID:Atcold,项目名称:lua---imgraph,代码行数:9,代码来源:lattribheight.c


示例15: StreamGAFloat

/* Calcul de Stream par un algo mixant exploration en profondeur et
   largeur d'abord des chemins de plus grande pente */
int32_t StreamGAFloat(struct xvimage *ga, int32_t x, Lifo *L, Lifo *B,int32_t *psi, float *G)
#undef F_NAME
#define F_NAME "LPEGrapheAreteValuee" 
{
  //  Lifo *B;                                /* Les bottoms non encore exploré de L */ 
  int32_t rs = rowsize(ga);               /* taille ligne */
  int32_t cs = colsize(ga);               /* taille colonne */
  int32_t N = rs * cs;                    /* taille image */
  float *F = FLOATDATA(ga);
  int32_t y, k, u, z;
  uint8_t breadth_first;
  
  LifoPush(L,x);
  psi[x] = IN_PROCESS;
  LifoPush(B,x);

  while(!LifoVide(B)){
    y = LifoPop(B);
    breadth_first = TRUE;
    for(k = 0; (k < 4) && (breadth_first == TRUE); k++)
      if((u = incidente(y, k, rs, N)) != -1) 
	if(F[u] == G[y]){
	  switch(k){
	  case 0: z = y+1; break;      /* EST   */ 
	  case 1: z = y-rs; break;     /* NORD  */
	  case 2: z = y-1; break;      /* OUEST */
	  case 3: z = y+rs; break;     /* SUD   */
	  }
	  if(psi[z] != IN_PROCESS)
	  {
	    if(psi[z] != NO_LABEL){
	      /* There is an inf-stream under L */
	      LifoFlush(B);  
	      return psi[z];
	    }
	    else
	    {
	      if(G[z] < G[y]){
		LifoPush(L,z);  
		psi[z] = IN_PROCESS;
		/* z is now the only bottom of L */
		LifoFlush(B);
		LifoPush(B,z); /* hence, switch to depth first */
		breadth_first = FALSE;
	      }
	      else{
		psi[z] = IN_PROCESS;
		LifoPush(L,z); /* G[z] == G[y], then z is also a bottom of L */
		LifoPush(B,z);
	      }
	    }
	  }
	}
  }
  LifoFlush(B);
  return NO_LABEL;
}
开发者ID:Atcold,项目名称:lua---imgraph,代码行数:59,代码来源:llpeGA.c


示例16: l3dboundary

/* =============================================================== */
int32_t l3dboundary(struct xvimage * f)
/* =============================================================== */
/* 
   extrait la frontière interne
   def: {x in F | theta(x) inter Fbar neq emptyset}
*/
{
#undef F_NAME
#define F_NAME "l3dboundary"
  struct xvimage * g;
  index_t rs, cs, ds, ps, N;
  index_t x, y, z;
  uint8_t *F;
  uint8_t *G;
  index_t tab[26];
  int32_t n, u;

  rs = rowsize(f);
  cs = colsize(f);
  ds = depth(f);
  F = UCHARDATA(f);
  ps = rs * cs;
  N = ps * ds;

  g = copyimage(f);
  if (g == NULL)
  {   fprintf(stderr,"%s: copyimage failed\n", F_NAME);
      return 0;
  }  
  G = UCHARDATA(g);
  memset(F, 0, N);

  for (z = 0; z < ds; z++)
    for (y = 0; y < cs; y++)
      for (x = 0; x < rs; x++)
	if (G[z*ps + y*rs + x])
        {
	  Thetacarre3d(rs, cs, ds, x, y, z, tab, &n);
	  for (u = 0; u < n; u++)
	    if (G[tab[u]] == 0) 
	    {
	      F[z*ps + y*rs + x] = NDG_MAX;
	      goto next;
	    }
	next:;
	} 
  
  freeimage(g);
  return 1;
} /* l3dboundary() */
开发者ID:Johnson13,项目名称:xLearn,代码行数:51,代码来源:l3dkhalimsky.c


示例17: altitudePointFloat

float altitudePointFloat(struct xvimage *ga, int32_t i)
{
  int32_t rs = rowsize(ga);                 /* taille ligne */
  int32_t cs = colsize(ga);                 /* taille colonne */
  int32_t N = rs * cs;                      /* taille image */
  float *F = FLOATDATA(ga);     /* l'image de depart */
  int32_t k, u;
  float min = 255; // En theorie ca peut aller bien plus haut attention !!! MAX_FLOAT
  for(k = 0; k < 4; k++)
    if( (u = incidente(i, k, rs, N)) != -1) { 
      if((float)F[u] < min) min = (float)F[u];
    }
  return min;
}
开发者ID:Atcold,项目名称:lua---imgraph,代码行数:14,代码来源:llpeGA.c


示例18: altitudePoint

int32_t altitudePoint(struct xvimage *ga, int32_t i)
{
  int32_t rs = rowsize(ga);                 /* taille ligne */
  int32_t cs = colsize(ga);                 /* taille colonne */
  int32_t N = rs * cs;                      /* taille image */
  uint8_t *F = UCHARDATA(ga);     /* l'image de depart */
  int32_t k, min, u;
  min = 255;
  for(k = 0; k < 4; k++)
    if( (u = incidente(i, k, rs, N)) != -1) { 
      if((int32_t)F[u] < min) min = (int32_t)F[u];
    }
  return min;
} 
开发者ID:Atcold,项目名称:lua---imgraph,代码行数:14,代码来源:llpeGA.c


示例19: ltuf

/* =============================================================== */
int32_t ltuf(struct xvimage * image, int32_t connexmin, int32_t rayon)
/* =============================================================== */
#undef F_NAME
#define F_NAME "ltuf"
{
  struct xvimage * copy;
  int32_t rs, cs, ds, ps, N;
  int32_t ndes;

  rs = rowsize(image);     /* taille ligne */
  cs = colsize(image);     /* taille colonne */
  ps = rs * cs;            /* taille plan */
  ds = depth(image);       /* nombre plans */
  N = ds * ps;             /* taille image */

  if (ds == 1) /* ======================= 2D ========================*/
  {
    copy = copyimage(image);
    if (copy == NULL)
    {
      fprintf(stderr, "%s: copyimage failed\n", F_NAME);
      return 0;
    }

    do
    {
      if (! lhthindelta(image, NULL, rayon, connexmin))
      {
        fprintf(stderr, "%s: lhthindelta failed\n", F_NAME);
        return 0;
      }
      ndes = p_despics(image, connexmin);
      if (! lhtkernu(image, copy, connexmin))
      {
        fprintf(stderr, "%s: lhtkernu failed\n", F_NAME);
        return 0;
      }
      if (ndes) memcpy(UCHARDATA(copy), UCHARDATA(image), N);
    } while (ndes);
  }
  else /* ============================== 3D ================================*/
  {
    fprintf(stderr, "%s: 3D Not Yet Implemented\n", F_NAME);
    return 0;
  }

  freeimage(copy);
  return 1;
} /* ltuf() */
开发者ID:Johnson13,项目名称:xLearn,代码行数:50,代码来源:lfiltrestopo.c


示例20: altitudePointDouble

double altitudePointDouble(struct xvimage *ga, int32_t i)
{
  int32_t rs = rowsize(ga);                 /* taille ligne */
  int32_t cs = colsize(ga);                 /* taille colonne */
  int32_t N = rs * cs;                      /* taille image */
  double *F = DOUBLEDATA(ga);     /* l'image de depart */
  int32_t k, u;
  //double min = 956036423.000000;
  double min = 1000000000000000000000000000000.0; // En theorie ca peut aller bien plus haut attention !!! MAX_FLOAT
  for(k = 0; k < 4; k++)
    if( (u = incidente(i, k, rs, N)) != -1) { 
      if(F[u] < min) min = F[u];
    }
  return min;
}
开发者ID:Atcold,项目名称:lua---imgraph,代码行数:15,代码来源:llpeGA.c



注:本文中的colsize函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ column函数代码示例发布时间:2022-05-30
下一篇:
C++ cols函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap