Skip to content

Commit

Permalink
Regular update
Browse files Browse the repository at this point in the history
  • Loading branch information
sheley1998 committed Jul 24, 2015
1 parent 98ef5b8 commit d679834
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
8 changes: 4 additions & 4 deletions track_plus_core/track_plus/hand_resolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ void HandResolver::compute(MonoProcessorNew& mono_processor0, MonoProcessorN
image_visualization1 = reprojector.remap(&image1, 1, true);
}

pt_precise_palm0.x = mono_processor0.pt_palm.x * 2;
pt_precise_palm0.y = mono_processor0.pt_palm.y * 2;
pt_precise_palm1.x = mono_processor1.pt_palm.x * 2;
pt_precise_palm1.y = mono_processor1.pt_palm.y * 2;
pt_precise_palm0.x = mono_processor0.pt_palm.x * 4;
pt_precise_palm0.y = mono_processor0.pt_palm.y * 4;
pt_precise_palm1.x = mono_processor1.pt_palm.x * 4;
pt_precise_palm1.y = mono_processor1.pt_palm.y * 4;

pt_precise_index0 = Point2f(-1, -1);
if (mono_processor0.pt_index.x != -1)
Expand Down
4 changes: 2 additions & 2 deletions track_plus_core/track_plus/mono_processor_new.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,8 @@ bool MonoProcessorNew::compute(HandSplitterNew& hand_splitter, const string name
else
image_hand.ptr<uchar>(pt.y, pt.x)[0] = 254;

GaussianBlur(image_hand, image_hand, Size(3, 3), 0, 0);
threshold(image_hand, image_hand, 170, 254, THRESH_BINARY);
// GaussianBlur(image_hand, image_hand, Size(3, 3), 0, 0);
// threshold(image_hand, image_hand, 170, 254, THRESH_BINARY);

//------------------------------------------------------------------------------------------------------------------------------

Expand Down
12 changes: 12 additions & 0 deletions track_plus_core/track_plus/pointer_mapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ void PointerMapper::compute(HandResolver& hand_resolver, Reprojector& reprojecto
thumb_down = false;

compute_pinch_to_zoom(hand_resolver);

Mat image_visualization_pointer_mapper = Mat::zeros(480, 640, CV_8UC1);

circle(image_visualization_pointer_mapper, hand_resolver.pt_precise_index0, 10, Scalar(127), 4);
circle(image_visualization_pointer_mapper, hand_resolver.pt_precise_palm0, 10, Scalar(127), 4);

// circle(image_visualization_pointer_mapper, Point(pt_palm.x + 320, pt_palm.y + 240), pow(pt_palm.z / 100, 2), Scalar(127), 4);
// circle(image_visualization_pointer_mapper, Point(pt_index.x + 320, pt_index.y + 240), pow(pt_index.z / 100, 2), Scalar(127), 4);
// if (pinch_to_zoom)
// circle(image_visualization_pointer_mapper, Point(pt_thumb.x + 320, pt_thumb.y + 240), pow(pt_thumb.z / 100, 2), Scalar(127), 4);

imshow("image_visualization_pointer_mapper", image_visualization_pointer_mapper);
}

void PointerMapper::add_calibration_point(const uchar index)
Expand Down
9 changes: 6 additions & 3 deletions track_plus_core/track_plus/reprojector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ void Reprojector::load(IPC& ipc, bool flipped)
copy_file(executable_path + "\\opencv_flann249.dll", data_path_current_module + "\\opencv_flann249.dll");
copy_file(executable_path + "\\opencv_features2d249.dll", data_path_current_module + "\\opencv_features2d249.dll");

string param0 = "http://d2i9bzz66ghms6.cloudfront.net/data/" + serial + "/0.jpg";
//http://s3-us-west-2.amazonaws.com/ractiv.com/data/
//http://d2i9bzz66ghms6.cloudfront.net/data/

string param0 = "http://s3-us-west-2.amazonaws.com/ractiv.com/data/" + serial + "/0.jpg";
string param1 = data_path_current_module + "\\0.jpg";

string* serial_ptr = &serial;
Expand All @@ -111,7 +114,7 @@ void Reprojector::load(IPC& ipc, bool flipped)
ipc_ptr->send_message("daemon_plus", "exit", "");
else
{
string param0 = "http://d2i9bzz66ghms6.cloudfront.net/data/" + *serial_ptr + "/1.jpg";
string param0 = "http://s3-us-west-2.amazonaws.com/ractiv.com/data/" + *serial_ptr + "/1.jpg";
string param1 = data_path_current_module + "\\1.jpg";

ipc_ptr->get_response("menu_plus", "download", param0 + "`" + param1, [serial_ptr, ipc_ptr](const string message_body)
Expand All @@ -120,7 +123,7 @@ void Reprojector::load(IPC& ipc, bool flipped)
ipc_ptr->send_message("daemon_plus", "exit", "");
else
{
string param0 = "http://d2i9bzz66ghms6.cloudfront.net/data/" + *serial_ptr + "/stereoCalibData.txt";
string param0 = "http://s3-us-west-2.amazonaws.com/ractiv.com/data/" + *serial_ptr + "/stereoCalibData.txt";
string param1 = data_path_current_module + "\\stereoCalibData.txt";

ipc_ptr->get_response("menu_plus", "download", param0 + "`" + param1, [serial_ptr, ipc_ptr](const string message_body)
Expand Down

0 comments on commit d679834

Please sign in to comment.