Ejemplo n.º 1
0
def plot_kp(img, mode='string'):
    img = ImageObject(img)
    img = image_module.convert_to_pgm(img)
    img = make_keypoints(img)
    
    loc, desc = get_descriptors(img)
    im = get_image_as_array(img)
    sift.plot_features(im,loc)
    image_module.remove_temp_files_img(img)
Ejemplo n.º 2
0
def get_kpm_string(img1,img2,mode='string',less=0, from_index=-1, to_index=-1):
    img1 = ImageObject(img1)
    img2 = ImageObject(img2)
    
    i1,i2,m,q,mp = get_kpm(img1,img2, mode,less, from_index, to_index)
    image_module.remove_temp_files_img(img1)
    image_module.remove_temp_files_img(img2)
    
    return i1,i2,m,q,mp
Ejemplo n.º 3
0
def plot_kpm(img1,img2,mode='string',less=0, from_index=-1, to_index=-1):
    if mode == 'string':
        img1 = ImageObject(img1)
        img2 = ImageObject(img2)
    im1, im2, matchscores,qom,MatchPercent = get_kpm(img1,img2, mode,less, from_index, to_index)
    
    loc1, desc1 = get_descriptors(img1)
    loc2, desc2 = get_descriptors(img2)
    
    sift.plot_matches(im1,im2,loc1,loc2,matchscores)
    image_module.remove_temp_files_img(img1)
    image_module.remove_temp_files_img(img2)
    
Ejemplo n.º 4
0
 def delete_short_scenes(self,fps,program_mode):
     # tul rovid sceneket(clusterek) torlom a clusterek kozul
     MIN_SCENE_LENGTH = None
     if program_mode == 'scenes':             
         MIN_SCENE_LENGTH = settings.MIN_SCENE_LENGTH_MODE_SCENECUT
     elif program_mode == 'joined':             
         MIN_SCENE_LENGTH = settings.MIN_SCENE_LENGTH_MODE_JOINCUT
         
     flags_delete = []        
     for clCounter, cluster in enumerate(self.clusters):
         if len(cluster)>0:
             orderNum1 = cluster[0].get_only_num()
             orderNum2 = cluster[-1].get_only_num()
             time_diff_msec = int(orderNum2 - orderNum1)*(1.0/eval_float(fps))*1000.0
             # print MIN_SCENE_LENGTH*1000.0
             if MIN_SCENE_LENGTH*1000.0 >= time_diff_msec: flags_delete.append(clCounter)
     for del_num in reversed(flags_delete):
         for img in self.clusters[del_num]:
             remove_temp_files_img(img)
             # remove_file_img(img)
         del self.clusters[del_num]