Skip to content

ml/python: fix digits samples - #16334

Closed
berak wants to merge 1 commit into
opencv:masterfrom
berak:fix_ml_python_digits_samples
Closed

berak wants to merge 1 commit into
opencv:masterfrom
berak:fix_ml_python_digits_samples

Conversation

@berak

@berak berak commented Jan 13, 2020

Copy link
Copy Markdown
Contributor

fix loading serialized SVM / KNearest and findContours() usage

@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.

Thank you for contribution!

bin = cv.adaptiveThreshold(gray, 255, cv.ADAPTIVE_THRESH_MEAN_C, cv.THRESH_BINARY_INV, 31, 10)
bin = cv.medianBlur(bin, 3)
_, contours, heirs = cv.findContours( bin.copy(), cv.RETR_CCOMP, cv.CHAIN_APPROX_SIMPLE)
contours, heirs = cv.findContours( bin.copy(), cv.RETR_CCOMP, cv.CHAIN_APPROX_SIMPLE)

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.

OpenCV 3.4.x still uses 3 outputs (due compatibility reasons).

Please apply this fix on master branch (if applicable).

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.

ah, right, will do.

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.

I mean separate patch. Keep this for 3.4.

BTW, patch for master is not needed (code).

@berak
berak force-pushed the fix_ml_python_digits_samples branch from 19e1f18 to 6cce376 Compare January 13, 2020 11:12
@berak
berak changed the base branch from 3.4 to master January 13, 2020 11:12
@alalek

alalek commented Jan 13, 2020

Copy link
Copy Markdown
Member

+22 -12

Both patches are similar, so patch onto 3.4 is enough (we will merge these changes into "master" by regular "merge 3.4" process).

Closing this.

@berak

berak commented Jan 13, 2020

Copy link
Copy Markdown
Contributor Author

yea, right. thanks !

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.

2 participants