MATLAB Answers

What is the difference between the new and old perimeter calculation in regionprops?

8 views (last 30 days)
Kendra Nyberg
Kendra Nyberg on 30 Jan 2017
Answered: Walter Roberson on 30 Jan 2017
Starting with R2014a, the regionprops function in the Image Processing Toolbox calculates the perimeter with a new method. In their release notes, they state:
"The regionprops function uses a new algorithm to calculate a perimeter, when used with the ‘Perimeter’ option. Because of this change, regionprops returns different results for the perimeter calculations than it did in earlier releases... While the new algorithm used with regionprops returns more accurate perimeter calculation, you can get the same return value as previous releases by specifying the ‘perimeterold’ option."
Unfortunately, that is the only documentation I've found. It doesn't describe the differences between the new and old methods.

  0 Comments

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 30 Jan 2017
In the new calculation, diagonal pixels and corners get different weights.
Look in regionprops.m near line 1370, routine computePerimeterFromBoundary

  0 Comments

Sign in to comment.

Sign in to answer this question.