Lecture #2: C Camera Model
Lecture #2: C Camera Model
Lecture #2: C Camera Model
Camera model
1. Weak perspective camera model: the relative distance between two scene
points is much smaller than the average distance (ZAV) between the camera
and those points.
Bayer Pattern
Projection matrix
The projection equation of a 3D world point [ XW , YW , ZW ] expressed in normalized
coordinates:
Global thresholding: Let f(x,y) be the source image and b(x,y) the binary image.
Variable thresholding:
● Variable thresholding allows different threshold levels to be applied to different
regions of an image.
● Let f( x,y ) be the source image and let x,y ) denote the local (region)
threshold value associated with each point in the image, that is d( x,y ) is the
threshold value associated with the region in which point ( x,y ) lies.
● The thresholded image b( x,y ) is defined by:
Multilevel thresholding: for segmentation of pixels into bins
For example, if the image histogram contains three peaks, then it is possible
to segment the image using two thresholds. These thresholds divide the value set
into three non overlapping ranges, each of which can be associated with a unique
value in the resulting image.
The second step is thresholding. Thresholds are located at equal distances between
the maxima. Therefore the algorithm for thresholding is simply to assign to each pixel
the color value of the nearest histogram maximum.
Segmentation
Partitioning of an image into regions (subset of an image) such that each
region satisfies a predicate. This means that all the points in that region have the
same common property.A segmentation should be:
- Exhaustive: the entire image is used
- Exclusive: a pixel may belong to only one category.
Pixels belonging to adjacent regions, when taken jointly, do not satisfy the predicate.
hreshold selection by best approximation with a two level
T
image: Given an image fij the binary image is gij
- Where t is th threshold
- a and b are constants chosen to minimize the distance on the corresponding
intervals (between the original an binarized image)
- The image has P gray levels
Perimeter: P
Thinness ratio (circularity): The function above has the
maximum value equal to 1, and for this value we obtain a circle.
● the start positions and length of runs of 1s for each row are used
● lengths of runs, starting with the length of the 0 run
- The first difference of the vertical projection can be obtained by projecting not the
image data, but the first horizontal differences of the image data:
Lecture #4 c
Sequential Labeling
The queue data structure maintains the list of points that need to be labeled.
Since the queue uses a FIFO policy we obtain a breadth first traversal. We mark
visited nodes by setting the label for their position.Changing the data structure to a
stack would result in a depth first traversal of the image graph.
Border tracing algorithm
1. Search the image from top left until a pixel of a new region is found; this
pixel P0 is the starting pixel of the region border. Define a variable dir which stores
the direction of the previous move along the border from the previous border element
to the current border element.Assign
(a)dir =0 if the border is detected in 4-connectivity
(b)dir = 7 if the border is detected in 8-connectivity
2. Search the 3x3 neighborhood of the current pixel in an
anti-clockwise direction, beginning the neighborhood search at the pixel
positioned in the direction
(a)(dir+ 3) mod 4 (Fig. 6.1c)
(b)(dir+ 7) mod 8 if dir is even (Fig. 6.1d)
(dir+ 6) mod 8 if dir is odd (Fig. 6.1e)
The first pixel found with the same value as the current pixel is a new
boundary element Pn. Update the dir value.
3. If the current boundary element Pn is equal to the second border element
P1and if the previous border element Pn-1 is equal to P0,stop. Otherwise repeat
step (2).
4.The detected border is represented by pixels P0... Pn-2.
Polygonal approximation
Chain codes
OPEN CONTOUR = NU TE INTORCI
Lecture #5 c
Dilation
Erosion
Open: generally smoothes the contour of an object, breaks narrow isthmuses, and
eliminates thin protrusions.
It’s basically an erosion with more filters (where one is applied to the
complementary image). Then combine them.
Daca se ating tangential (label dupa erosion)=> Opening; Closing is more for filling
gaps. If opening is not enough, vertical/horizontal projection.
Lecture #6 c
Mean value
Standard deviation
deviation\:=\:\sqrt{\frac{\sum_{i=1}^{\infty}\:\sum_{j=1}^{\infty}\:\left(f\left(i,j\right)-\:me
an\:\right)^2}{m\cdot n}}
Variance
variance = deviation^2
g_{out}\:=\:g_{out^{min}}\:\cdot \:\left(g_{in}-\:g_{in^{MAX}}\right)\cdot
\:\frac{g_{out^{MAX}}\:-\:g_{out^{min}}}{g_{in^{MAX}}\:-\:g_{in^{min}}}
Gamma correction
g_{out}\:=\:L\:\cdot \:\left(\frac{g_{in}}{L}\right)^{gamma}
Self-information (surprisal)
Lecture #7 c
Dirac Delta function
Can be thought of as a function on the real line which is zero everywhere
except at the origin, and which is also constrained to satisfy the identity:
High-pass filters:
Discrete Fourier transform (DFT):
Median filter
Selects the middle value from the ordered statistic and replaces the destination pixel
with it. In the example above, the selected value would be 104. The median filter
allows the elimination of salt & pepper noise.
Maximum filter
Selects the largest value amongst the ordered values of pixels from the window. In
the above example, the value selected is 114. This filter can be used to eliminate the
pepper noise, but it amplifies the salt noise if applied to a salt & pepper noise image.
Minimum filter
Selects the smallest value amongst the ordered values of pixels from the window. In
the above example, the value selected is 85. This filter can be used to eliminate the
salt noise, but it amplifies the pepper noise if applied to a salt & pepper noise image.
Gaussian
Butterworth filter ( low pass filter : removes high frequencies, blurs image)
Trapezoidal filter
Lecture #11-12 c
First order differential edge detection (Canny) - 332
Use the gradient
“Aplici un Sobel, apoi celălalt, și faci radical din suma patratelor” - MAGNITUDINE
In order to find the edges, the algorithm has to check the points with the
largest variation of intensity. For this, we apply the gradient to find the local
maximum points of the 1st order derivative.
This gradient is a vector perpendicular to the tangent of that point only if the
point is part of a contour. It has two components that can be approximated with
convolution with derivative kernels (Sobel). After getting the two components, the
direction of the vector and the magnitude can also be obtained.
The magnitude is compared to a threshold value to determine whether or not
the point is an edge point.
-> We can obtain noise points that get classified as edge points, we can have gaps
in edges, and finally, thicker edges (for this we may need an edge thinning
algorithm).
1. Aplici filtru
2. “Trebe sa mergi pe fiecare pixel, sa te uiti la vecini si sa vezi unde inmultirea
dintre vecini da 0 ca atunci s-a schimbat semnul”
Inseamna ca in directia aia e o muchie = The edges are detected by
searching for zero crossings.
Canny edge detection (*IPLab11)
Cu MAGNITUDE și direcția poți sa continui sa aplici canny.
O derivata iti arata cat de tare se schimba culoarea si directia. magn cat de tare se
schimba, dir -in ce parte se schimba
● Sobel: the most popular operator used in edge detection, this operator gives
more importance to the pixels that are closer to the center pixel
● blurs the image to retrieve only the main features in the final result
Log
● find the position in the image where the second derivative is zero (edges)
The gradient has a greater value at an edge point (we find this by using the first derivative);
and if we apply a second derivative we notice that the "peak" of the gradient value is now a
zero-value. However, there are more 0s in the second derivative due to the ripples in the
original image.
Conteaza ecuația cu Z. D- disparity (dif unde apare pct); b- distanta intre camere; Z -
depth
Depth approximation
Element
Range resolution