Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
22_23-J-84
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
KSH.Mohamed
22_23-J-84
Commits
ea6d45b1
Commit
ea6d45b1
authored
May 26, 2023
by
Bogahawatta L.B.G.D.P.K
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
60d5bb30
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
PossibleChar.py
PossibleChar.py
+33
-0
No files found.
PossibleChar.py
0 → 100644
View file @
ea6d45b1
import
cv2
import
numpy
as
np
import
math
class
PossibleChar
:
def
__init__
(
self
,
_contour
):
self
.
contour
=
_contour
self
.
boundingRect
=
cv2
.
boundingRect
(
self
.
contour
)
[
intX
,
intY
,
intWidth
,
intHeight
]
=
self
.
boundingRect
self
.
intBoundingRectX
=
intX
self
.
intBoundingRectY
=
intY
self
.
intBoundingRectWidth
=
intWidth
self
.
intBoundingRectHeight
=
intHeight
self
.
intBoundingRectArea
=
self
.
intBoundingRectWidth
*
self
.
intBoundingRectHeight
self
.
intCenterX
=
(
self
.
intBoundingRectX
+
self
.
intBoundingRectX
+
self
.
intBoundingRectWidth
)
/
2
self
.
intCenterY
=
(
self
.
intBoundingRectY
+
self
.
intBoundingRectY
+
self
.
intBoundingRectHeight
)
/
2
self
.
fltDiagonalSize
=
math
.
sqrt
((
self
.
intBoundingRectWidth
**
2
)
+
(
self
.
intBoundingRectHeight
**
2
))
self
.
fltAspectRatio
=
float
(
self
.
intBoundingRectWidth
)
/
float
(
self
.
intBoundingRectHeight
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment