简体   繁体   中英

Changing origin in Structuring element in octave/matlab (image processing)

I am trying to apply morphological operations on image in octave/matlab. I need to use structuring elements for using operations like dialate, erode. The origin of structuring elements is set by default using this:

origin = floor((size(nhood)+1)/2)

reference : http://www.mathworks.in/help/images/ref/strel.html

i need to change this origin to some other element of the structuring element. FYI I am using flat structuring element.

I couldn't find any document for this. Any help is welcome.

Thanks

If I got your question right you can shift the structuring element using translate .

Example from the help page:

se = strel(ones(3))

%// Translate it 2 rows up and 2 columns to the left

se2 = translate(se,[-2 -2])

Giving this:

在此输入图像描述

Is this what you had in mind?

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