Problem with Morph module after import from CP 2.0


We discovered a problem with the Morph module if you import an old pipeline from CP 2.0 into CP 2.1.

In CP 2.0 if you choose ‘Custom’ as the number of times to repeat the operation. Then you can set the repetition number and the scale.
In CP 2.1 you can choose a structuring element and scale but no ‘repetition number’.

If you set the repetition number in CP 2.0 higher then 2 and import this pipeline in CP 2.1 or higher you are not able to change this repetition number anymore. If you look at the morph module you will not notice any difference but the output is different because internally CP 2.1 stil uses a repetition number higher then 2 (the CP 2.0 pipeline setting) whereas if you add a new morph module in CP 2.1 it will always use a repetition number of 2 (I cheched the .cppipe with a text editor)

I had this problem several times and thought the pipeline was corrupted somehow and I rebuilded the pipeline to fix it. But I now think the import was the problem.

Why is it not possible in CP 2.1 to change the repetition number anymore? Maybe it is not relevant and should it always be 2? If so is it possible to change the setting always into 2 after import otherways you get strange behaviour which you can’t change in CP 2.1.

To illustrate the problem I added a testfile and some old and new pipelines:
Test v3 CP 2.0.0.cp (3.64 KB)
Test v3 from cp 2.0.0 imported in CPv2.1.1.cpproj (216 KB)Test v3 CPv2.1.1.cpproj (239 KB)

Hi Peter,

Thanks for this sleuthing. I think you are half right! Some morphological operators are ‘idempotent’, such that applying them more than once produces no change beyond the first application. Open and Close fall under this, so for those operators in between 2.0 and 2.1 we removed the “repeat number of times” setting as it was useless. However it looks like we were a little overzealous and included Erode and Dilate as well.

We will check on this to be sure, and I re-opened an old relevant Github issue:
After any change, you’d have to upgrade to one of our trunk builds, or in 2.1 release just repeat the Morph module many times for Erode or Dilate, sorry.


Hi David,

I tried the new build and see the addition of repetition number for dilate and erode. Thanks!
But There is still a strange behaviour or the open and close operation.
As I told in my previous post: after import of a old CP 2.0 pipeline, CP 2.1.2 keeps the old repetition number.
You told that the close and open command are ‘idempotent’ but in this case it behaves different.
It seems that in CP 2.1.2 if the repetation number is 10 (from import), it performs a 10 times erosion and then 10 times dilation instead of 10 times erode -> dilate ->erode -> dilate etc.

Here some examples:


Thanks - we’re taking a look at this.