This repository was archived by the owner on Jan 6, 2025. It is now read-only.
Update image_processing.py#495
Open
whoiskatrin wants to merge 2 commits intoatlanhq:masterfrom
Open
Conversation
I made the following changes: - Removed unnecessary multiplication of vertical and horizontal arrays, as it seems to be unnecessary. - Changed the try-except block to just a single line that calls cv2.findContours() and gets the second element of the returned tuple, which is the list of contours. - Simplified the calculation for the coordinates of the joint by using integer division to calculate the center of the bounding rectangle for each contour.
Removed the unnecessary if-else block and moved the np.invert() call to the beginning of the function to avoid inverting the image twice if process_background is True. Changed the function always to invert the image if process_background is False. This makes the function more efficient because it avoids the need to perform the inversion and thresholding separately.
|
Hey! As camelot-dev/camelot#343, we try to build a maintained fork at pypdf_table_extraction. Do you want to open the PR against that branch so that we can merge your improvement? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I made the following changes in this PR:
Ping me if there are any questions, thanks.