Skip to content

Instantly share code, notes, and snippets.

@yin90m
yin90m / ipm.py
Created January 16, 2019 03:40 — forked from walkerning/ipm.py
Inverse perspective transform for lane detection
# -*- coding: utf-8 -*-
import numpy as np
class IPM(object):
"""
Inverse perspective mapping to a bird-eye view. Assume pin-hole camera model.
There are detailed explanation of every step in the comments, and variable names in the code follow these conventions:
`_c` for camera coordinates
`_w` for world coordinates
`uv` for perspective transformed uv 2d coordinates (the input image)
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Flatten
from keras.layers.convolutional import Convolution2D, MaxPooling2D
from keras.layers.normalization import BatchNormalization
#AlexNet with batch normalization in Keras
#input image is 224x224
model = Sequential()
model.add(Convolution2D(64, 3, 11, 11, border_mode='full'))