Skip to content

Reviewed wavefront code - #356

Open
atsju wants to merge 2 commits into
masterfrom
JST/62
Open

Reviewed wavefront code #356
atsju wants to merge 2 commits into
masterfrom
JST/62

Conversation

@atsju

@atsju atsju commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

See issue #62 for details.
I only cleaned the manual destructor and added init for some missing fields of constructor.

I decided to not do a deep copy inside move constructor because it could have performance impact. I'm supposing Dale did it like this on purpose.
Cleaner solution would be to create explicit functions "deepCopy" and "lightCopy" but as it works I prefer not to touch.

code is documented so just be careful

    wavefront( const wavefront &wf); // copy constructor doing deep copy of cv::Mat
    wavefront( wavefront && ) = delete;	// move constructor, deleted because unused
    wavefront& operator=( const wavefront & ) = default; // copy operator not doing deep copy of cv::mat
    wavefront& operator=(wavefront &&) = delete; // move operator, deleted because unused

consider this close #62

@atsju
atsju requested review from githubdoe and gr5 August 4, 2026 16:51
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

🚀 New build available for commit aafad68
Download installer here

Comment thread wavefront.cpp
mean(wf.mean),
dirtyZerns(wf.dirtyZerns)
dirtyZerns(wf.dirtyZerns),
regions(wf.regions),

@gr5 gr5 Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes me nervous (line 49 - the regions copy)

  1. Does it do a deep copy?
  2. Previous behavior you got a regions member that was empty and ready to be filled with fresh regions. Does the existing code expect this everywhere or does it not care? Did you check all the times he adds regions and might we get doubled regions?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the other hand this might fix some bug I didn't really know was easy to fix that I forgot about. Maybe regions can get lost after certain operations and maybe that's bad.

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.

wavefront probably needs code review

2 participants