Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roboto #10

Closed
wants to merge 89 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
e52b9d2
added spi and raspicam... not done yet
smigad Sep 16, 2017
a8ca4bb
fix spi
smigad Sep 18, 2017
5d6e99d
clean up
smigad Sep 18, 2017
b6aadff
minor mod
smigad Sep 18, 2017
0afb984
add gpio sig in spi
smigad Sep 20, 2017
2ee5d55
gpio int for spi
smigad Sep 20, 2017
172b464
add face landmark
smigad Nov 7, 2017
b109914
Merge branch 'master' of https://github.com/Dagiopia/OpenCogER
smigad Nov 7, 2017
36c75de
bla bla
smigad Nov 7, 2017
ad6f2c2
flm detect done
smigad Nov 8, 2017
447b5f8
lil mod
smigad Nov 8, 2017
3bd385d
eyes closed/open detect
smigad Nov 9, 2017
3e7b247
nod
smigad Feb 21, 2018
a9a0639
some
smigad Feb 21, 2018
781a3e6
head
smigad Feb 21, 2018
32383ef
mod
smigad Mar 2, 2018
5840e02
lil mod
smigad Mar 2, 2018
1d5b6ae
refac
smigad Mar 7, 2018
8117c28
rm old
smigad Mar 8, 2018
49e65ab
begin facial expression
smigad Mar 17, 2018
eb774ea
hand det & finger count
smigad Mar 27, 2018
9ab344f
hand haar model
smigad Mar 27, 2018
3331879
mods
smigad Mar 27, 2018
850b056
lil mod
smigad Apr 2, 2018
e61fb0a
saliency wrapper
smigad Apr 2, 2018
77d164a
lil mod
smigad Apr 3, 2018
a61fdb1
some debug info
smigad Apr 3, 2018
f81bbb6
fix on pi
smigad Apr 4, 2018
393aa00
raspi
smigad Apr 19, 2018
4450e0d
raspi src
smigad Apr 19, 2018
4d02890
func times
smigad Apr 19, 2018
271d61b
test
smigad Apr 19, 2018
443e49c
Merge pull request #1 from Dagiopia/master
smigad Apr 19, 2018
add5e8c
mod
smigad Apr 23, 2018
701027e
merg
smigad Apr 23, 2018
d2e3076
all
smigad Apr 23, 2018
9064b39
dbg info
smigad Apr 23, 2018
c75eec1
Merge pull request #2 from Dagiopia/master
smigad Apr 23, 2018
755dba2
update readme
smigad Apr 24, 2018
61ecf3f
readme
smigad Apr 24, 2018
d7c5913
Merge pull request #4 from Dagiopia/master
smigad Apr 24, 2018
decc66a
new model
smigad Apr 24, 2018
d26112f
Merge branch 'master' of https://github.com/opencog/OpenCogER
smigad Apr 24, 2018
4fb39d2
landmark model numbers were wrong
smigad Apr 25, 2018
f2c94d1
begin rpc
smigad May 1, 2018
d287909
lil
smigad May 1, 2018
16d5984
git ignore
smigad May 1, 2018
531d26b
sal on rpc
smigad May 2, 2018
079d649
some mod
smigad May 3, 2018
aac7b6e
mod
smigad May 4, 2018
62336c8
includes
smigad May 4, 2018
04b8940
rpc work
smigad May 4, 2018
e18c96f
rpc example... nothing is tested
smigad May 5, 2018
2d1bab4
rpc
smigad May 7, 2018
b0afebe
rm unwanted
smigad May 7, 2018
83430d5
fix
smigad May 7, 2018
d24dda7
Merge pull request #5 from Dagiopia/master
smigad May 7, 2018
00efce4
Merge branch 'master' of https://github.com/opencog/OpenCogER
smigad May 16, 2018
cc75a54
scm wrapper
smigad May 16, 2018
f313304
fix
smigad May 16, 2018
c14be2c
scm script
smigad May 16, 2018
daf2c8d
fix
smigad May 16, 2018
2bb5077
add ghost integration from https://github.com/Eskender-B/dr-roboto.git
smigad May 20, 2018
58c615f
update readme
smigad May 20, 2018
1de0e34
Merge pull request #6 from Dagiopia/master
smigad May 20, 2018
354a36a
General README cleanup
linas May 20, 2018
c19da85
some wrapping
smigad May 24, 2018
946d6e4
the 26 facial landmark to be used
Geta-meko May 25, 2018
622b623
26 markup flms
Geta-meko May 25, 2018
c1f2cbd
Merge pull request #7 from Geta-meko/master
smigad May 25, 2018
f37f8e0
some mods
smigad May 25, 2018
128d6fa
begin stt
smigad May 28, 2018
df42d0e
Merge branch 'master' of https://github.com/opencog/TinyCog
smigad May 28, 2018
df16ea7
stt
smigad May 28, 2018
a96b793
work on stt and some mods on dr roboto
smigad May 29, 2018
c179feb
fix error
smigad May 29, 2018
121751f
Merge pull request #8 from Dagiopia/master
smigad May 29, 2018
dfc22ac
Fix cmake var ON_RPI_3
Eskender-B May 29, 2018
452d95a
Organize code structure
Eskender-B May 29, 2018
0abe968
minor and readme
smigad May 29, 2018
f198214
facial expression
Geta-meko Jun 1, 2018
a823361
Fix cmake file and stt
Eskender-B Jun 5, 2018
4385b86
Make basic demo; Need to fix
Eskender-B Jun 6, 2018
03a015e
Merge branch 'master' into mine
Geta-meko Jun 7, 2018
be8c43f
Merge pull request #9 from Geta-meko/mine
smigad Jun 7, 2018
728bc97
Make a working demo; still need fixing
Eskender-B Jun 11, 2018
10c5a30
Merge branch 'master' of https://github.com/opencog/TinyCog
Eskender-B Jun 11, 2018
9cb6429
Demo face smile detection and chat
Eskender-B Jun 18, 2018
f0ed444
smile added
Geta-meko Jun 28, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
all
  • Loading branch information
smigad committed Apr 23, 2018
commit d2e3076c21de4fc760ece555901326499a45ede4
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ add_executable(SaliencyTest examples/sense/vision/SaliencyTest.cpp)
target_link_libraries(SaliencyTest sensor_vision ${OpenCV_LIBS} ${EXTRA_LIBS})

add_executable(SaliencyTest2 examples/sense/vision/SaliencyTest2.cpp)
target_link_libraries(SaliencyTest2 sensor_vision ${OpenCV_LIBS} ${EXTRA_LIBS})
target_link_libraries(SaliencyTest2 sensor_vision ${OpenCV_LIBS} ${EXTRA_LIBS})

add_executable(AllTest examples/sense/vision/AllTest.cpp)
target_link_libraries(AllTest sensor_vision ${OpenCV_LIBS} ${EXTRA_LIBS})

if(raspicam_FOUND)
add_executable(RaspiVisionTest examples/sense/vision/RaspiVisionTest.cpp)
Expand Down
105 changes: 105 additions & 0 deletions examples/sense/vision/AllTest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
/*
Project: OpenCogER
File: AllTest.cpp
Author: Dagim Sisay
License: AGPL
Date: April, 2018
*/


#include <iostream>
#include <string>
#include <signal.h>

#include "sense/vision/CamCapture.hpp"
#include "sense/vision/ITColor2Gray.hpp"
#include "sense/vision/ITEqualizeHist.hpp"
#include "sense/vision/ITDetectFace.hpp"
#include "sense/vision/ITDetectSmile.hpp"
#include "sense/vision/FacialLandMark.hpp"
#include "sense/vision/ITDetectHand.hpp"
#include "sense/vision/FingersCount.hpp"
#include "sense/vision/DSaliency.hpp"
#include "sense/vision/BoxTrackerThread.hpp"


#define _NEED_GUI_
#define _NEED_TIME_INFO_

#define NO_FLMS 26
#define SCALE 0.1

using namespace std;
using namespace cv;

void sigint_handler(int sig)
{
cout<<"Caught SIGINT... Exiting!\n";
exit(0);
}


int main(int argc, char **argv)
{
signal(SIGINT, sigint_handler);
CamCapture cc("cam", 320, 240, 0, 20);
if (!cc.isOk()){std::cout<<std::endl<<cc.getState()<<std::endl;return -1;}

Mat frame, img, img2;

ITColor2Gray c2g("c2g1");
ITEqualizeHist eh("eh1");
ITDetectFace fcd("fcd1");
ITDetectSmile smd("smd1");
FacialLandMark flm;
ITDetectHand dh("dh1");
FingersCount fc(true);
DSaliency sal_d(SAL_STATIC, SAL_FINE_GRAINED);

vector <Rect> faces, hands;
vector <facial_lms> f_lms;
facial_lms shape;
Rect2d box2d;
Rect box;
vector<vector<Point> > cntrs;
vector<Vec4i> hier;


BoxTrackerThread *bt;

while (true)
{
frame = cc.getCurrentFrame();
img = eh.Transform(c2g.Transform(frame));
faces = fcd.Transform(img);

f_lms.clear();
flm.get_lm_points(frame, faces, &f_lms);
for (int i = 0; i < f_lms.size(); ++i){
shape = f_lms[i];
for (int j = 0; j < NO_FLMS; ++j)
circle(frame, Size(shape.part(j).x(), shape.part(j).y()), 1,
CV_RGB(0, 255, 0), 1.5);
}
threshold(img, img, 70, 255, CV_THRESH_BINARY_INV | CV_THRESH_OTSU);
hands = dh.Transform(img);
for (int i = 0; i < hands.size(); ++i){
img2 = Mat(img, Rect(hands[i].x - hands[i].x*SCALE,
hands[i].y - hands[i].y*SCALE,
hands[i].width + hands[i].width*SCALE,
hands[i].height + hands[i].height*SCALE));
putText(frame, to_string(fc.num_fingers(img2)), Point(20, 20),
FONT_HERSHEY_COMPLEX_SMALL, 1.5, CV_RGB(255, 0, 0), 2, CV_AA);
cvtColor(img2, img2, COLOR_GRAY2BGR);
for(size_t j = 0; j < fc.f_tips.size(); ++j)
circle(img2, fc.f_tips[j], 2, CV_RGB(255, 0, 0), 2);
imshow("hand", img2);
}
imshow("feed", frame);
if(27 == waitKey(10))
break;
} // while (true)


return 0;
}
4 changes: 2 additions & 2 deletions examples/sense/vision/FaceLandMarkTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ int main(int argc, char** argv)
for (uint8_t idx = 0; idx < f_lms.size(); idx++)
{
facial_lms shape = f_lms[idx];
for(uint8_t i = 0; i < 30; i++)
for(uint8_t i = 0; i < 26; i++)
cv::circle(frame, cv::Size(shape.part(i).x(), shape.part(i).y()),
2, CV_RGB(0, 255, 0), 2);
1.5, CV_RGB(0, 255, 0), 1.5);
}
cv::imshow("face landmark", frame);
if(27 == cv::waitKey(10))
Expand Down
5 changes: 2 additions & 3 deletions examples/sense/vision/FingersCountTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ int main(int argc, char **argv)

cv::Mat frame, img, img2;
std::vector<cv::Rect> hands;
std::vector<std::string> snum({"one", "two", "three", "four", "five", "si", "sev"});

while (true)
{
Expand All @@ -45,8 +44,8 @@ int main(int argc, char **argv)
hands[i].y - hands[i].y*SCALE,
hands[i].width + hands[i].width*SCALE,
hands[i].height + hands[i].height*SCALE));
cv::putText(frame, snum[fc.num_fingers(img)], cv::Point(20, 20),
cv::FONT_HERSHEY_COMPLEX_SMALL, 0.8, CV_RGB(50, 50, 50), 2,
cv::putText(frame, std::to_string(fc.num_fingers(img)), cv::Point(20, 20),
cv::FONT_HERSHEY_COMPLEX_SMALL, 1.5, CV_RGB(50, 50, 50), 2,
CV_AA);
cv::cvtColor(img, img2, COLOR_GRAY2BGR);
for(size_t j = 0 ; j < fc.f_tips.size(); j++)
Expand Down
4 changes: 2 additions & 2 deletions include/sense/vision/FingersCount.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
at current hand based on size or distance
from other points or whatever
*/
#define MIN_DEPTH 5.0
#define MAX_DEPTH 50.0
#define MIN_DEPTH 15.0
#define MAX_DEPTH 70.0

typedef std::vector<cv::Point> VP;
typedef std::vector<VP> VVP;
Expand Down
2 changes: 1 addition & 1 deletion sense/vision/detect/FingersCount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ uint8_t FingersCount::num_fingers(cv::Mat hand)
cv::convexHull(cntr, hull, false);
if(hull.size() > 3)
cv::convexityDefects(cntr, hull, defects);
count = 0;
count = 1;
VV4i::const_iterator d_it = defects.begin();
if(debug) printf("-----------------\n"); //XXX remove
while(d_it != defects.end())
Expand Down