Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(15)  |  Call(15)  |  Derive(0)  |  Import(0)

src/m/a/maskattack.study-1.0.0/maskattack/study/antispoof/lbp.py   maskattack.study(Download)
      blockslist = divideframe(lbpimage) # divide the lbp image into 3x3 overlapping blocks
      for bl in blockslist:
        hist = bob.ip.histogram(bl, 0, lbp.max_label-1, lbp.max_label)
        if norm:
          hist = hist / sum(hist) # histogram normalization
        finalhist = numpy.append(finalhist, hist) # concatenate the subblocks' already normalized histograms
    else:
      finalhist =bob.ip.histogram(lbpimage, 0, lbp.max_label-1, lbp.max_label)
    blockslist = divideframe(lbpimage,True) # divide the lbp image into 3x3 overlapping blocks
    for bl in blockslist:
      hist = bob.ip.histogram(bl, 0, lbp1.max_label-1, lbp1.max_label)
      if norm:
        hist = hist / sum(hist) # histogram normalization
      hist1 = numpy.append(hist1, hist) # concatenate the subblocks' already normalized histograms     
    lbp2 = bob.ip.LBP(8,2,2,uniform=True,circular=True)
    lbpimage = numpy.ndarray(lbp2.get_lbp_shape(img), 'uint16') # allocating the image with lbp codes  
    lbp2(img, lbpimage) # calculating the lbp image
    hist2 = bob.ip.histogram(lbpimage, 0, lbp2.max_label-1, lbp2.max_label)   
    lbpimage = numpy.ndarray(lbp3.get_lbp_shape(img), 'uint16') # allocating the image with lbp codes 
    lbp3(img, lbpimage) # calculating the lbp image
    hist3 = bob.ip.histogram(lbpimage, 0, lbp3.max_label-1, lbp3.max_label)
    finalhist = numpy.concatenate((hist1,hist2,hist3))        
  return finalhist.astype(numpy.float)

src/a/n/antispoofing.lbptop-1.0.4/antispoofing/lbptop/spoof/calclbptop.py   antispoofing.lbptop(Download)
    histXY = numpy.zeros(shape=(XY.shape[0],lbp_XY.max_label))
    for i in range(XY.shape[0]):
      histXY[i] = bob.ip.histogram(XY[i], 0, lbp_XY.max_label-1, lbp_XY.max_label)
      #histogram normalization
      histXY[i] = histXY[i] / sum(histXY[i])
 
    #XT
    histXT = numpy.zeros(shape=(XT.shape[0],lbp_XT.max_label))
    for i in range(XT.shape[0]):
      histXT[i] = bob.ip.histogram(XT[i], 0, lbp_XT.max_label-1, lbp_XT.max_label)
    histYT = numpy.zeros(shape=(YT.shape[0],lbp_YT.max_label))
    for i in range(YT.shape[0]):
      histYT[i] = bob.ip.histogram(YT[i], 0, lbp_YT.max_label-1, lbp_YT.max_label)
      #histogram normalization
      histYT[i] = histYT[i] / sum(histYT[i])

src/m/a/maskattack.study-1.0.0/maskattack/study/analyze/lbp.py   maskattack.study(Download)
  blockslist = divideframe(lbpimage) # divide the lbp image into 8x8 blocks
  for bl in blockslist:
    hist = bob.ip.histogram(bl, 0, lbp.max_label-1, lbp.max_label)
    if norm:
      hist = hist / sum(hist) # histogram normalization

src/m/a/maskattack.lbp-1.0.3/maskattack/lbp/spoof/calclbp.py   maskattack.lbp(Download)
  lbpimage = numpy.ndarray(lbp.get_lbp_shape(img), 'uint16') # allocating the image with lbp codes
  lbp(img, lbpimage) # calculating the lbp image
  hist = bob.ip.histogram(lbpimage, 0, lbp.max_label-1, lbp.max_label)
  if norm:
    hist = hist / sum(hist) # histogram normalization

src/a/n/antispoofing.lbp-1.3.0/antispoofing/lbp/spoof/calclbp.py   antispoofing.lbp(Download)
  lbpimage = numpy.ndarray(lbp.get_lbp_shape(img), 'uint16') # allocating the image with lbp codes
  lbp(img, lbpimage) # calculating the lbp image
  hist = bob.ip.histogram(lbpimage, 0, lbp.max_label-1, lbp.max_label)
  hist = hist / sum(hist) # histogram normalization
  return hist, 1 # the last argument is 1 if the frame was valid and 0 otherwise

src/e/s/estimate.gender-0.4/estimate/gender/estimateGender.py   estimate.gender(Download)
  blockslist = divideframe(lbpimage, numblock) # divide the lbp image into non-overlapping blocks
  for bl in blockslist:
    hist = bob.ip.histogram(bl, 0, lbp.max_label-1, lbp.max_label)
    if norm:
      hist = hist / sum(hist) # histogram normalization

src/a/n/antispoofing.optflow-1.0.2/antispoofing/optflow/histocomp.py   antispoofing.optflow(Download)
  th = numpy.where(t < -math.pi, t+(2*math.pi), t)
  if border is None:
    A = bob.ip.histogram(th, -math.pi, math.pi, bins)
  else:
    y_low   = bb.y - border
    if x_right > uv.shape[2]: x_right = uv.shape[2]
 
    A = bob.ip.histogram(th[y_low:y_up, x_left:x_right], -math.pi, math.pi, bins)
  B = bob.ip.histogram(th[bb.y:(bb.y+bb.height), bb.x:(bb.x+bb.width)], -math.pi, math.pi, bins)
  A = A.astype('float64')