Skip to content

Retina module interface update#861

Merged
opencv-pushbot merged 2166 commits intoopencv:masterfrom
albenoit:master
May 12, 2013
Merged

Retina module interface update#861
opencv-pushbot merged 2166 commits intoopencv:masterfrom
albenoit:master

Conversation

@albenoit
Copy link
Copy Markdown
Contributor

Following OpenCV classes interfaces design, here are the changes:
_updated Retina class interface : now a cleaner abstract class
_updated doc (refined and completed)

Andrey Kamaev and others added 30 commits April 4, 2013 15:43
Old paths can have problems with cross-compilation
OpenCV Manager verison incremeneted;
Docs and tests updated accordingly;
COnstant for Manager initialization added.
@vpisarev
Copy link
Copy Markdown
Contributor

vpisarev commented May 2, 2013

Hi Alex,

excellent work! thanks a lot, the API looks much cleaner now!
The only issue I see is the use of "Mat&" in some "get*" methods, e.g. "virtual void getParvo(Mat& p) const = 0;"
Such a form is not "mainstream" in the modern OpenCV coding conventions.
If the output matrix is assigned, then the better form is "virtual Mat getParvo() const = 0;"
If the data is copied, the preferable form is "virtual void getParvo(OutputArray p) const = 0;"
Both these forms are automatically wrappable in Python, Java etc.
With "virtual void getParvo(Mat& p) const = 0;" it's not clear whether the matrix is just output parameter or it's both input and output parameter.

Regards,
Vadim

@albenoit
Copy link
Copy Markdown
Contributor Author

albenoit commented May 3, 2013

Hi Vadim,
Thanks for the remarks.
I will do the suggested changes in a few time to comply with the OpenCV
coding convention.
I will push a new version on my current pull request... and also do very
minor updates on the documentation.

Regards.
Alex

2013/5/2 Vadim Pisarevsky notifications@github.com

Hi Alex,

excellent work! thanks a lot, the API looks much cleaner now!
The only issue I see is the use of "Mat&" in some "get*" methods, e.g.
"virtual void getParvo(Mat& p) const = 0;"
Such a form is not "mainstream" in the modern OpenCV coding conventions.
If the output matrix is assigned, then the better form is "virtual Mat
getParvo() const = 0;"
If the data is copied, the preferable form is "virtual void
getParvo(OutputArray p) const = 0;"
Both these forms are automatically wrappable in Python, Java etc.
With "virtual void getParvo(Mat& p) const = 0;" it's not clear whether the
matrix is just output parameter or it's both input and output parameter.

Regards,
Vadim


Reply to this email directly or view it on GitHubhttps://github.com//pull/861#issuecomment-17362584
.

Alexandre BENOIT,
Assistant Professor / Maître de Conférence
Image processing and visual scene classification,
LISTIC Lab / IUT Annecy
benoit.alexandre.vision.googlepages.com

@albenoit
Copy link
Copy Markdown
Contributor Author

albenoit commented May 3, 2013

Hi again Vadim,

well, regarding your suggestions : replace Mat by OutputArray for data copy
accessors ex "virtual void getParvo(OutputArray p) const = 0;"

I also want to replace
void RetinaImpl::run(const Mat inputMatToConvert)
by
void RetinaImpl::run(InputArray inputMatToConvert)

But in both cases, methods that were usable with Mat :
_ Mat accessors such as 'at' in my void
RetinaImpl::convertValarrayBuffer2cvMat method.
_ casts : 'Mat
<Vec<T, 4> >(inputMatToConvert)' in my bool
RetinaImpl::_convertCvMat2ValarrayBuffer method

are no more accessible but where usefull for Mat and valarray data exchange.

Then, is there a nice way to use Mat objects within RetinaImpl class while
showing on the interface InputArray and OutputArray with efficient methods
(no buffer copies).

Thank you and sorry for all the time spent.
Regards
Alex

2013/5/3 alexandre benoit benoit.alexandre.vision@gmail.com

Hi Vadim,
Thanks for the remarks.
I will do the suggested changes in a few time to comply with the OpenCV
coding convention.
I will push a new version on my current pull request... and also do very
minor updates on the documentation.

Regards.
Alex

2013/5/2 Vadim Pisarevsky notifications@github.com

Hi Alex,

excellent work! thanks a lot, the API looks much cleaner now!
The only issue I see is the use of "Mat&" in some "get*" methods, e.g.
"virtual void getParvo(Mat& p) const = 0;"
Such a form is not "mainstream" in the modern OpenCV coding conventions.
If the output matrix is assigned, then the better form is "virtual Mat
getParvo() const = 0;"
If the data is copied, the preferable form is "virtual void
getParvo(OutputArray p) const = 0;"
Both these forms are automatically wrappable in Python, Java etc.
With "virtual void getParvo(Mat& p) const = 0;" it's not clear whether
the matrix is just output parameter or it's both input and output parameter.

Regards,
Vadim


Reply to this email directly or view it on GitHubhttps://github.com//pull/861#issuecomment-17362584
.

Alexandre BENOIT,
Assistant Professor / Maître de Conférence
Image processing and visual scene classification,
LISTIC Lab / IUT Annecy
benoit.alexandre.vision.googlepages.com

Alexandre BENOIT,
Assistant Professor / Maître de Conférence
Image processing and visual scene classification,
LISTIC Lab / IUT Annecy
benoit.alexandre.vision.googlepages.com

@albenoit
Copy link
Copy Markdown
Contributor Author

albenoit commented May 3, 2013

Hi Vadim,
sorry for the previous email with bad questions... i forgot you have
a marvelous Wiki with all the required answers !
then, i did the changes you proposed. It works on my machine, i did a push
to validate on the buildbot.

Stay tuned.
Regards.
Alex

2013/5/3 alexandre benoit benoit.alexandre.vision@gmail.com

Hi again Vadim,

well, regarding your suggestions : replace Mat by OutputArray for data
copy accessors ex "virtual void getParvo(OutputArray p) const = 0;"

I also want to replace
void RetinaImpl::run(const Mat inputMatToConvert)
by
void RetinaImpl::run(InputArray inputMatToConvert)

But in both cases, methods that were usable with Mat :
_ Mat accessors such as 'at' in my void
RetinaImpl::convertValarrayBuffer2cvMat method.
_ casts : 'Mat
<Vec<T, 4> >(inputMatToConvert)' in my bool
RetinaImpl::_convertCvMat2ValarrayBuffer method

are no more accessible but where usefull for Mat and valarray data
exchange.

Then, is there a nice way to use Mat objects within RetinaImpl class while
showing on the interface InputArray and OutputArray with efficient methods
(no buffer copies).

Thank you and sorry for all the time spent.
Regards
Alex

2013/5/3 alexandre benoit benoit.alexandre.vision@gmail.com

Hi Vadim,
Thanks for the remarks.
I will do the suggested changes in a few time to comply with the OpenCV
coding convention.
I will push a new version on my current pull request... and also do very
minor updates on the documentation.

Regards.
Alex

2013/5/2 Vadim Pisarevsky notifications@github.com

Hi Alex,

excellent work! thanks a lot, the API looks much cleaner now!
The only issue I see is the use of "Mat&" in some "get*" methods, e.g.
"virtual void getParvo(Mat& p) const = 0;"
Such a form is not "mainstream" in the modern OpenCV coding conventions.
If the output matrix is assigned, then the better form is "virtual Mat
getParvo() const = 0;"
If the data is copied, the preferable form is "virtual void
getParvo(OutputArray p) const = 0;"
Both these forms are automatically wrappable in Python, Java etc.
With "virtual void getParvo(Mat& p) const = 0;" it's not clear whether
the matrix is just output parameter or it's both input and output parameter.

Regards,
Vadim


Reply to this email directly or view it on GitHubhttps://github.com//pull/861#issuecomment-17362584
.

Alexandre BENOIT,
Assistant Professor / Maître de Conférence
Image processing and visual scene classification,
LISTIC Lab / IUT Annecy
benoit.alexandre.vision.googlepages.com

Alexandre BENOIT,
Assistant Professor / Maître de Conférence
Image processing and visual scene classification,
LISTIC Lab / IUT Annecy
benoit.alexandre.vision.googlepages.com

Alexandre BENOIT,
Assistant Professor / Maître de Conférence
Image processing and visual scene classification,
LISTIC Lab / IUT Annecy
benoit.alexandre.vision.googlepages.com

@albenoit
Copy link
Copy Markdown
Contributor Author

albenoit commented May 3, 2013

Hi again,

everything seems to rock now. Buildbot is green and i corrected as you
recommended.
If everything is ok, why not pushing to 2.4 branch to reduce release delays
since only Retina constructor is changed from a user point of view. But you
better know what to do than me.

For Gsoc, as i told you, not this year but next year, it can be great if
there are some opportunities ! How long mentors should stay there ?
See you soon.
Alex

2013/5/3 alexandre benoit benoit.alexandre.vision@gmail.com

Hi Vadim,
sorry for the previous email with bad questions... i forgot you have
a marvelous Wiki with all the required answers !
then, i did the changes you proposed. It works on my machine, i did a push
to validate on the buildbot.

Stay tuned.
Regards.
Alex

2013/5/3 alexandre benoit benoit.alexandre.vision@gmail.com

Hi again Vadim,

well, regarding your suggestions : replace Mat by OutputArray for data
copy accessors ex "virtual void getParvo(OutputArray p) const = 0;"

I also want to replace
void RetinaImpl::run(const Mat inputMatToConvert)
by
void RetinaImpl::run(InputArray inputMatToConvert)

But in both cases, methods that were usable with Mat :
_ Mat accessors such as 'at' in my void
RetinaImpl::convertValarrayBuffer2cvMat method.
_ casts : 'Mat
<Vec<T, 4> >(inputMatToConvert)' in my bool
RetinaImpl::_convertCvMat2ValarrayBuffer method

are no more accessible but where usefull for Mat and valarray data
exchange.

Then, is there a nice way to use Mat objects within RetinaImpl class
while showing on the interface InputArray and OutputArray with efficient
methods (no buffer copies).

Thank you and sorry for all the time spent.
Regards
Alex

2013/5/3 alexandre benoit benoit.alexandre.vision@gmail.com

Hi Vadim,
Thanks for the remarks.
I will do the suggested changes in a few time to comply with the OpenCV
coding convention.
I will push a new version on my current pull request... and also do very
minor updates on the documentation.

Regards.
Alex

2013/5/2 Vadim Pisarevsky notifications@github.com

Hi Alex,

excellent work! thanks a lot, the API looks much cleaner now!
The only issue I see is the use of "Mat&" in some "get*" methods, e.g.
"virtual void getParvo(Mat& p) const = 0;"
Such a form is not "mainstream" in the modern OpenCV coding conventions.
If the output matrix is assigned, then the better form is "virtual Mat
getParvo() const = 0;"
If the data is copied, the preferable form is "virtual void
getParvo(OutputArray p) const = 0;"
Both these forms are automatically wrappable in Python, Java etc.
With "virtual void getParvo(Mat& p) const = 0;" it's not clear whether
the matrix is just output parameter or it's both input and output parameter.

Regards,
Vadim


Reply to this email directly or view it on GitHubhttps://github.com//pull/861#issuecomment-17362584
.

Alexandre BENOIT,
Assistant Professor / Maître de Conférence
Image processing and visual scene classification,
LISTIC Lab / IUT Annecy
benoit.alexandre.vision.googlepages.com

Alexandre BENOIT,
Assistant Professor / Maître de Conférence
Image processing and visual scene classification,
LISTIC Lab / IUT Annecy
benoit.alexandre.vision.googlepages.com

Alexandre BENOIT,
Assistant Professor / Maître de Conférence
Image processing and visual scene classification,
LISTIC Lab / IUT Annecy
benoit.alexandre.vision.googlepages.com

Alexandre BENOIT,
Assistant Professor / Maître de Conférence
Image processing and visual scene classification,
LISTIC Lab / IUT Annecy
benoit.alexandre.vision.googlepages.com

@ghost ghost assigned vpisarev May 3, 2013
@vpisarev
Copy link
Copy Markdown
Contributor

vpisarev commented May 3, 2013

pushing to 2.4 is impossible, unfortunately, because the changes break binary compatibility (not sure about source-level compatibility). In 2.4 we only accept changes that preserve binary compatibility. And this is one of the goals of the new API design style in 3.0 - to minimize effect on the header when implementation is changed.

That is, if some of the changes in pull requests are bug fixes and other local improvements that do not affect headers in any way, a separate pull request for 2.4 should be created. This pull request should definitely go to 3.0

@albenoit
Copy link
Copy Markdown
Contributor Author

albenoit commented May 4, 2013

Hi Vadim,
Ok, that's fine, let's target API 3.0 as initially planned. In some time i
will do some more push still on the AP1 3.0 for namespace change and
memory footprint reduction.
Thanks for your help.
Alex

2013/5/3 Vadim Pisarevsky notifications@github.com

pushing to 2.4 is impossible, unfortunately, because the changes break
binary compatibility (not sure about source-level compatibility). In 2.4 we
only accept changes that preserve binary compatibility. And this is one of
the goals of the new API design style in 3.0 - to minimize effect on the
header when implementation is changed.

That is, if some of the changes in pull requests are bug fixes and other
local improvements that do not affect headers in any way, a separate pull
request for 2.4 should be created. This pull request should definitely go
to 3.0


Reply to this email directly or view it on GitHubhttps://github.com//pull/861#issuecomment-17415556
.

Alexandre BENOIT,
Assistant Professor / Maître de Conférence
Image processing and visual scene classification,
LISTIC Lab / IUT Annecy
benoit.alexandre.vision.googlepages.com

@vpisarev
Copy link
Copy Markdown
Contributor

vpisarev commented May 7, 2013

👍

vpisarev added a commit that referenced this pull request May 12, 2013
@opencv-pushbot opencv-pushbot merged commit a5acc9e into opencv:master May 12, 2013
savuor pushed a commit to nickyu-zhu/opencv that referenced this pull request Oct 27, 2023
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

Successfully merging this pull request may close these issues.