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

frontcam and bootomcam added #16

Open
wants to merge 1 commit into
base: testing-perception
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 7 additions & 4 deletions vision_reboot_stack/GMM/src/gmm_r.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ void processVideo(Mat img) {
vector<Point2f>center( contours.size() );
vector<float>radius( contours.size() );
vector<vector<Point> > contours_poly( contours.size() );
Rect boundRect;
Point2f vertex;
Point2f vertex_opp;

Expand All @@ -92,6 +93,7 @@ void processVideo(Mat img) {

approxPolyDP( Mat(contours[idx]), contours_poly[idx], 3, true );
minEnclosingCircle( (Mat)contours_poly[idx], center[idx], radius[idx] );
boundRect = boundingRect( Mat(contours_poly[idx]) );
}

Scalar color( 0, 0, 255 );
Expand All @@ -101,13 +103,14 @@ void processVideo(Mat img) {
vertex_opp.y = center[largestComp].y + radius[largestComp];
vertex_opp.x = center[largestComp].x + radius[largestComp];
drawContours( dst, contours, largestComp, color, FILLED, LINE_8, hierarchy );
rectangle( drawing, vertex, vertex_opp , color, 2, 8, 0 );
// rectangle( drawing, vertex, vertex_opp , color, 2, 8, 0 );
rectangle( drawing, boundRect.tl(), boundRect.br(), color, 2, 8, 0 );
circle( drawing, center[largestComp], (int)radius[largestComp], color, 2, 8, 0 );
imshow("contours",drawing);

s.data.push_back(center[largestComp].y);
s.data.push_back(center[largestComp].x);
s.data.push_back(radius[largestComp]);
s.data.push_back(vertex.y);
s.data.push_back(vertex.x);
s.data.push_back(2*radius[largestComp]);

ROS_INFO("Values sent to topic-print\n");
pub_n.publish(s);
Expand Down
2 changes: 1 addition & 1 deletion vision_reboot_stack/GMM/src/kalman_r.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void kfilter(const std_msgs::Int64MultiArray::ConstPtr& num) {
Point statePt(estimated.at<float>(0),estimated.at<float>(1));
cout<<"ESTIMATED : "<<statePt<<endl;

if(abs((statePt.x-measPt.x)*(statePt.y-measPt.y)) < 100){
if(abs((statePt.x-measPt.x)*(statePt.y-measPt.y)) < 70){
flag++;
cout << flag << endl ;
}
Expand Down
19 changes: 0 additions & 19 deletions vision_reboot_stack/cam_open/README.md

This file was deleted.

This file was deleted.

This file was deleted.

Empty file.
Loading