简体   繁体   中英

MATLAB - Find local maximum and minimum of an edge map (row-wise)

I'll start off by saying I'm new to MATLAB, and this is the first time I'm trying an application related to image processing.

I'm building a MATLAB library (which is to be used in a Windows Phone Application), which takes in an edge map of a natural image as input. I need to traverse the map row-wise. If I come across an edge, I need to find the local minimum and local maximum of the edge.

I need help figuring out how to; 1) traverse the edge map - row-wise 2) detect an edge 3) find the local minimum and local maximum of the edge

Appreciate any help. Thanks in advance :)

This is just a summary of my comments. I try to answer your 3) questions given above.

1) There is going to be a nice vectorized way but honestly i ain't sure how that would work. What works is doing it in a loop. For a mxn Matrix it could look like this:

for k=1:m
  for l=1:n
    new_Matrix(k,n-l+1) = old_Matrix(k,l);
  end
end

As is said this isn't the best way to solve it since loops have negative impact on your runtime but they should do the trick.

2) Edge-detection:

BW1 = edge(new_Matrix,'sobel');%//Sobel
BW2 = edge(new_Matrix,'canny');%//Canny-filter

3) min and max-value row-wise

Matrix_transpose = Matrix'; %//transposed matrix
row_wise_min= min(Matrix_transpose);
row_wise_max = max(Matrix_transpose);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM