Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static assertion raised in SegmentFactory when using SaturatedSegmentation #1483

Closed
nyorem opened this issue Apr 23, 2020 · 5 comments
Closed

Comments

@nyorem
Copy link
Member

nyorem commented Apr 23, 2020

Hi all,

I tried to use the SaturatedSegmentation class with a StandardDSS4Computer namely the following typedefs (for instance in lines 173-174 the convex-and-concave-parts example):

typedef StandardDSS4Computer<Iterator> RecognitionAlgorithm;
typedef SaturatedSegmentation<RecognitionAlgorithm> Segmentation;

and it raised a static assertion in SegmentFactory:

/path/to/DGtal/src/DGtal/geometry/curves/CSegmentFactory.h:98:56: error: static assertion failed: ( boost::is_same< T, Self >::value )
   98 |       BOOST_STATIC_ASSERT(( boost::is_same< T, Self >::value ));
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ 

Using an ArithmeticalDSSComputer<Iterator,Coordinate,4> for the RecognitionAlgorithm does not raise this error.

As far as I understand SaturatedSegmentation should work with any kind of SegmentComputer such as StandardDSS4Computer or am I wrong?

Thank you in advance.

@rolanddenis
Copy link
Member

Hi Jocelyn and sorry for the delay 😉

From what I understand from these classes, StandardDSS4Computer is just an alias to ArithmeticalDSSComputer with a adjacency 4. It has been implemented as a derived class whose Selftypedef does not match the actual class leading to the concept check error that you have.

While waiting for a fix, I suggest you to use the corresponding alias, that is the same line as in the original example:

typedef ArithmeticalDSSComputer<Iterator,Coordinate,4> RecognitionAlgorithm;

or if you prefer, to get the real type using the Selfor Supertypedef (the ugly solution):

typedef typename StandardDSS4Computer<Iterator>::Self RecognitionAlgorithm;

@nyorem
Copy link
Member Author

nyorem commented May 18, 2020

No worries for the delay!

Thank you for your answer, I already used your first proposition to solve the issue but a real fix would be better 😉

@rolanddenis
Copy link
Member

Ongoing fix : #1491

@rolanddenis
Copy link
Member

Should be fixed, I close the issue!

@nyorem
Copy link
Member Author

nyorem commented May 20, 2020

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants