def doit():
    lane = lu.Lane(cd, pd, vwr=vwr, binary_warper=iu.hls_lab_lane_detect)

    for path in ut.get_fnames("test_images/", "*.jpg"):
        in_img = iu.imRead(path, reader='cv2', vwr=vwr)
        out_img = lane.lane_finder_pipe(in_img, cd, pd, vwr=vwr)
        ut.brk("check test_out")
def my_way(ploty, left_fit_cr, right_fit_cr, leftx, rightx):
    cd = cache_dict
    pd = parm_dict
    path = ut.get_fnames("test_images/", "*.jpg")[0]
    init_img, binary_warped = iu.get_binary_warped_image(path,
                                                         cd,
                                                         pd,
                                                         vwr=None)
    # img is just to painlessly fake out Lane ctor
    lane = lu.Lane(cd, pd, img=init_img, units='pixels', vwr=None)
    ut.oneShotMsg("FIXME: units above must be meters")
    lane.ploty = ploty
    lane.left_bndry = lu.LaneBoundary(
        0,  # hope max ix doesnt matter for this test
        binary_warped,
        'L',
        lane=lane,
        vwr=None)
    lane.right_bndry = lu.LaneBoundary(
        0,  # hope max ix doesnt matter for this test
        binary_warped,
        'R',
        lane=lane,
        vwr=None)
    lane.left_bndry.x = leftx
    lane.right_bndry.x = rightx
    lane.left_bndry.fit_coeff = left_fit_cr
    lane.right_bndry.fit_coeff = right_fit_cr
    lane.left_bndry.radius_of_curvature()
    lane.right_bndry.radius_of_curvature()
    print("FIXME(meters): " +
          str((lane.left_bndry.curve_radius, lane.right_bndry.curve_radius)))
Exemple #3
0
def test_undistort(vwr, max_files):

    for fname in ut.get_fnames("test_images/", "test*.jpg", max_files):
        img = iu.imRead(fname, reader='cv2', vwr=vwr)
        img = iu.undistort(img, cache_dict, vwr)
        iv._push_deprecated(vwr,
                            img,
                            title="undist",
                            type="FIXME:shd come from img via imread")
def doit(path="", cd=None, pd=None, vwr=None):
    for path in ut.get_fnames("test_images/", "*.jpg"):
        lane = lu.Lane(cd, pd, vwr)
        vwr.flush()
        print("FIXME: path = %s" % path)
        init_img, binary_warped = iu.get_binary_warped_image(path, cd, pd, vwr)
        iv._push(vwr, init_img)
        iv._push(vwr, binary_warped)
        lane.find_pixels_all_bndrys(binary_warped)
        lane.fit_polynomials()
        vwr.show()
Exemple #5
0
def doit(path="", cd=None, pd=None, vwr=None):
    vwr.flush()
    for path in ut.get_fnames("test_images/", "problem_binary_warped.jpg"):
        img = iu.imRead(path,
                        flags=cv2.IMREAD_GRAYSCALE,
                        reader='cv2',
                        vwr=None)
        ut.brk("wtf?")
        hist = iu.hist(img)
        ut.brk("plot the histogram")
        ut.brk("call get_LR_hist_max_ix()")
        iv._push(vwr, hist)
    vwr.show()
Exemple #6
0
def cb_corners(parm_dict, cache_dict, max_files=0, verbose=False, vwr=None):
    # derived from same source as init_obj_points()
    # termination criteria
    criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001)
    nx, ny = parm_dict['chessboard_nx'], parm_dict['chessboard_ny']
    objp = init_obj_points(nx, ny)  # object points in 3 space

    obj_points = []
    img_points = []  # point in 2 space

    iv._flush(vwr)
    for fname in ut.get_fnames("camera_cal/", "calibration*.jpg"):
        img_obj = imRead(fname, reader='cv2', vwr=vwr)
        iv._push(vwr, img_obj)
        if verbose:
            print("cb_corners: fname = %s(%d, %d)" %
                  (fname, img_obj.shape()[0], img_obj.shape()[1]))
        gray = cv2CvtColor(img_obj, cv2.COLOR_BGR2GRAY, vwr)

        # Find the chessboard corners
        ret, corners = cv2.findChessboardCorners(gray.img_data, (nx, ny), None)

        # If found, add object points, image points
        if ret == True:
            obj_points.append(objp)
            corners2 = cv2.cornerSubPix(gray.img_data, corners, (11, 11),
                                        (-1, -1), criteria)
            img_points.append(corners2)

            # Draw and display the corners
            cv2.drawChessboardCorners(img_obj.img_data, (nx, ny), corners2,
                                      ret)
            img_obj.title = img_obj.title + "_corners_drawn"
            iv._push(vwr, img_obj)
        else:
            print("findChessboardCorners(%s) failed" % fname)

    iv._show(vwr, clear=True)
    cache_dict['obj_points'] = obj_points
    cache_dict['img_points'] = img_points
Exemple #7
0
def process_all(ifolder, ofolder):
    munch(*get_fnames(ifolder, ofolder, '.xml', '.xml'))
    print('13: ellipsys.py completed')
Exemple #8
0
def main(ifolder, ofolder):
	munch(*get_fnames(ifolder, ofolder, '.xml', '.xml'))
	print('5: conjunctions.py completed')
def main(ifolder, ofolder):
    munch(*get_fnames(ifolder, ofolder, '.xml', '.xml'))
    print('4: prepositions.py completed')
Exemple #10
0
def process_all(ifolder, ofolder):
    main(*get_fnames(ifolder, ofolder, '.xml', '.xml'))
    print('10: cleanup.py completed')
Exemple #11
0
def process_all(ifolder, ofolder):
    munch(*get_fnames(ifolder, ofolder, '.xml', '.xml'))
    print('11: fixRegular.py completed')
Exemple #12
0
def process_all(ifolder, ofolder):
    munch(*get_fnames(ifolder, ofolder, '.xml', '.xml'))
    print('14: fixedDep.py completed')
Exemple #13
0
def doit(path="", cd=None, pd=None, vwr=None):
    vwr.flush()
    for path in ut.get_fnames("test_images/", "*.jpg"):
        img = iu.hls_lab_pipeline(path, cd, pd, vwr)
    vwr.show()
def main(ifolder, ofolder):
	munch(*get_fnames(ifolder, ofolder, '.xml', '.xml'))
	print('2: changeCompounds.py completed')
def process_all(ifolder, ofolder):
    main(*get_fnames(ifolder, ofolder, '.xml', '.xml'))
    print('3: getCleanedCompounds.py completed')
def process_all(ifolder, ofolder):
	munch(*get_fnames(ifolder, ofolder, '.tgt', '.xml'))
	print('1: preparations.py completed')
Exemple #17
0
def process_all(ifolder, ofolder):
    munch(*get_fnames(ifolder, ofolder, '.xml', '.xml'))
    print('15: punct.py completed')
Exemple #18
0
def main(ifolder, ofolder):
    munch(*get_fnames(ifolder, ofolder, '.xml', '.xml'))
    print('6: numerals.py completed')
Exemple #19
0
def process_all(ifolder, ofolder):
    munch(*get_fnames(ifolder, ofolder, '.xml', '.xml'))
    print('12: checkReported.py completed')
def process_all(ifolder, ofolder):
    munch(*get_fnames(ifolder, ofolder, '.xml', '.xml'))
    print('8: morphology.py completed')
def process_all(ifolder, ofolder):
    main(*get_fnames(ifolder, ofolder, '.xml', '.xml'))
    print('9: propernouns.py completed')