graph based segmentation
As the final component of this assignment, we will write code to
perform graph-based segmentation.
We will construct the graph in the following way. For pixels p and q
with coordinates (i, j) and (k, 1) respectively and colors cp and cg
respectively, set Wpq to:
if i== k and j== l
-100|1Cp-Call-
if li – k < 20 and li - I < 20
Then solve the optimization problem:
min, y Ay s.t |lyl|
with A as defined above.
Write code to solve the above optimization problem. Since the
eigenvector with the smallest eigenvalue is problematic, return the
eigenvector with the second-smallest (absolute) eigenvalue
(reshaped into the same size as the image). Your function should
have the following signature:
graph based segmentation
where you can assume that img is a h x w × 3 numpy array with
floating point values.
Name your file seqmentation.py