Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-010
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
2021-010
2021-010
Commits
661b93e8
Commit
661b93e8
authored
Apr 30, 2021
by
giwi97
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
color histogram
parent
637bf351
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
4 deletions
+55
-4
.vscode/settings.json
.vscode/settings.json
+3
-0
ML/.ipynb_checkpoints/fruit_recognition-checkpoint.ipynb
ML/.ipynb_checkpoints/fruit_recognition-checkpoint.ipynb
+26
-2
ML/fruit_recognition.ipynb
ML/fruit_recognition.ipynb
+26
-2
No files found.
.vscode/settings.json
0 → 100644
View file @
661b93e8
{
"git.ignoreLimitWarning"
:
true
}
\ No newline at end of file
ML/.ipynb_checkpoints/fruit_recognition-checkpoint.ipynb
View file @
661b93e8
...
...
@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count":
2
,
"execution_count":
1
,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -22,7 +22,7 @@
},
{
"cell_type": "code",
"execution_count":
null
,
"execution_count":
2
,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -35,6 +35,30 @@
" cells_per_block=(1, 1), visualize=True, multichannel=False)\n",
" return ftr"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"def FtrExtractColorHist(img):\n",
" chans = cv2.split(img)\n",
" colors = (\"h\", \"s\", \"v\")\n",
" features = []\n",
"\n",
" for (chan, color) in zip(chans, colors):\n",
" hist = cv2.calcHist([chan], [0], None, [256], [0, 256])\n",
" features.extend(hist)\n",
" return np.array(features).flatten()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
...
...
ML/fruit_recognition.ipynb
View file @
661b93e8
...
...
@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count":
2
,
"execution_count":
1
,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -22,7 +22,7 @@
},
{
"cell_type": "code",
"execution_count":
null
,
"execution_count":
2
,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -35,6 +35,30 @@
" cells_per_block=(1, 1), visualize=True, multichannel=False)\n",
" return ftr"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"def FtrExtractColorHist(img):\n",
" chans = cv2.split(img)\n",
" colors = (\"h\", \"s\", \"v\")\n",
" features = []\n",
"\n",
" for (chan, color) in zip(chans, colors):\n",
" hist = cv2.calcHist([chan], [0], None, [256], [0, 256])\n",
" features.extend(hist)\n",
" return np.array(features).flatten()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
...
...
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