Ejemplo n.º 1
0
def show_image(window_name, img, wait=False):
    hg.cvStartWindowThread()
    RESIZABLE = 0
    hg.cvNamedWindow(window_name, RESIZABLE)
    hg.cvShowImage(window_name, img)
    if wait:
        print 'show_image: press any key to continue..'
        cv.highgui.cvWaitKey()
Ejemplo n.º 2
0
minRadius (Int32)
    Minimal radius of the circles to search for

maxRadius (Int32)
    Maximal radius of the circles to search for. By default the maximal radius is set to max(image_width, image_height). 
"""

import sys, os
from opencv import cv
from opencv import highgui

print "to use: python houghcircles.py imagefile.jpg minRadius maxRadius"

# first, create the necessary window
highgui.cvStartWindowThread()

highgui.cvNamedWindow('GrayScale', highgui.CV_WINDOW_AUTOSIZE)
highgui.cvNamedWindow('Canny', highgui.CV_WINDOW_AUTOSIZE)
highgui.cvNamedWindow('Image Display Window', highgui.CV_WINDOW_AUTOSIZE)

# move the new window to a better place

highgui.cvMoveWindow ('GrayScale', 100, 10)
highgui.cvMoveWindow ('Canny', 200, 10)
highgui.cvMoveWindow ('Image Display Window', 10, 10)

#load image
image = highgui.cvLoadImage(sys.argv[1]);

#create image arrays
Ejemplo n.º 3
0
    It also is meant to remove the 'floor' as a possible candidate for table surface fits. 
'''
  

pc.truncate_pointcloud_to_voi(np.array([0.55,-0.4,1.0]), 1, 1, 1.3)
print 'finished truncate_pointcloud in top level function'
#map polygons after translating 

''' Visual to quickly check TF
'''
if True:
    print 'overlay_img soon to be obtained'
    overlay_img = pc.draw_mapped_laser_into_image(pc.map, pc.pts3d, pc.img)
    print 'overlay_img obtained'
    import opencv.highgui as hg
    hg.cvStartWindowThread()
    hg.cvNamedWindow('ww',0)
    hg.cvShowImage('ww',overlay_img)
    print 'wait for key - line 264'
    cv.highgui.cvWaitKey()
print 'finsihed showing mapped_laser image'

if True:
    print 'do polygon mapping'
    pc.do_polygon_mapping() #-
    ###pc.display_3d('labels')### This is based on accurate polygons.

    print 'map laser into image again'
    pc.img_mapped = pc.draw_mapped_laser_into_image(pc.map, pc.pts3d, pc.img)  #-  
    #Below: create B & W images corresponding to the artifical 'table edge and center' values we specified. 
    #Below: REMOVED DIAGNOSTIC IMAGES. cvPolyLine and cvFillPoly were acting up in opencv 2.0