Skip to content

Core fix mat matx mult - #13931

Merged
opencv-pushbot merged 1 commit into
opencv:3.4from
berak:core_fix_mat_max_mult
Feb 28, 2019
Merged

opencv-pushbot merged 1 commit into
opencv:3.4from
berak:core_fix_mat_max_mult

Conversation

@berak

@berak berak commented Feb 28, 2019

Copy link
Copy Markdown
Contributor

resolves #13926

replace erroneous + with * in mat.hpp

@berak
berak changed the base branch from master to 3.4 February 28, 2019 10:31
@alalek

alalek commented Feb 28, 2019

Copy link
Copy Markdown
Member

Could you please add test for that (use code from issue and add checks for 1-2 result values)?

@berak
berak force-pushed the core_fix_mat_max_mult branch from 2664dd4 to 6e2caf1 Compare February 28, 2019 11:31
Comment thread modules/core/test/test_mat.cpp Outdated
13, 14, 15, 16);

ASSERT_EQ(0, countNonZero(M1*M2 - M1*M1));
ASSERT_EQ(0, countNonZero(M2*M1 - M2*M2));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It is better to avoid using of countNonZero(), especially in case of floating-point matrixes.

Consider using this:

EXPECT_GE(1e-6, cvtest::norm(M1*M2, M1*M1, NORM_INF)) << Mat(M1*M2) << std::endl << Mat(M1*M1);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oh sure, it's float -- my bad, i did not see it.

@berak
berak force-pushed the core_fix_mat_max_mult branch from 6e2caf1 to 20afae5 Compare February 28, 2019 13:24

@alalek alalek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Well done! Thank you 👍

@opencv-pushbot
opencv-pushbot merged commit 20afae5 into opencv:3.4 Feb 28, 2019
@berak
berak deleted the core_fix_mat_max_mult branch February 28, 2019 15:11
@alalek alalek mentioned this pull request Mar 5, 2019
SavyaSanchi-Sharma pushed a commit to SavyaSanchi-Sharma/opencv that referenced this pull request Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants