Ask Your Question

da ghara's profile - activity

2014-11-24 03:28:28 -0600 asked a question how can i run opencv-qt creator -ubuntu

plz help me how can i Setting up OpenCV with Qt Creator in Ubuntu

2014-11-01 08:26:36 -0600 commented question motion tracking problem

maybe it Require adjustment anybody know !!!! output: 1>------ Rebuild All started: Project: cvtest, Configuration: Debug x64 ------ 1> main.cpp 1> cvtest.vcxproj -> C:\Users\Dara\documents\visual studio 2013\Projects\cvtest\x64\Debug\cvtest.exe ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

2014-11-01 06:56:10 -0600 commented question motion tracking problem

thresholdImage,differenceImage,frame 1 shown several times berak what is your mean??!!

2014-10-31 17:10:24 -0600 commented question motion tracking problem

thresholdImage,differenceImage,frame 1

2014-10-31 16:34:40 -0600 commented question motion tracking problem

how can i solve it dude?!

2014-10-31 16:28:40 -0600 commented question motion tracking problem

it's unclear i don't know why

2014-10-31 16:27:00 -0600 commented question motion tracking problem

after that when i use 'T' for tracking it have troubleshoot occur any body know what is the problem??!!!! i debug it and it worked very well for my laptop's friend

2014-10-31 16:23:20 -0600 asked a question motion tracking problem

when i debug the code it show many camera image laptop any body know what is the problem!!!??

many camera image laptop open

here is the code:

#include <opencv\cv.h>
#include <opencv\highgui.h>

using namespace std;
using namespace cv;

//our sensitivity value to be used in the threshold() function
const static int SENSITIVITY_VALUE = 20;
//size of blur used to smooth the image to remove possible noise and
//increase the size of the object we are trying to track. (Much like dilate and erode)
const static int BLUR_SIZE = 10;
//we'll have just one object to search for
//and keep track of its position.
int theObject[2] = {0,0};
//bounding rectangle of the object, we will use the center of this as its position.
Rect objectBoundingRectangle = Rect(0,0,0,0);


//int to string helper function
string intToString(int number){

//this function has a number input and string output
std::stringstream ss;
ss << number;
return ss.str();
}

void searchForMovement(Mat thresholdImage, Mat &cameraFeed){
//notice how we use the '&' operator for the cameraFeed. This is because we wish
//to take the values passed into the function and manipulate them, rather than just working with a copy.
//eg. we draw to the cameraFeed in this function which is then displayed in the main() function.
bool objectDetected=false;
Mat temp;
thresholdImage.copyTo(temp);
//these two vectors needed for output of findContours
vector< vector<Point> > contours;
vector<Vec4i> hierarchy;
//find contours of filtered image using openCV findContours function
//findContours(temp,contours,hierarchy,CV_RETR_CCOMP,CV_CHAIN_APPROX_SIMPLE );// retrieves all contours
findContours(temp,contours,hierarchy,CV_RETR_EXTERNAL,CV_CHAIN_APPROX_SIMPLE );// retrieves external contours

//if contours vector is not empty, we have found some objects
if(contours.size()>0)objectDetected=true;
else objectDetected = false;

if(objectDetected){
    //the largest contour is found at the end of the contours vector
    //we will simply assume that the biggest contour is the object we are looking for.
    vector< vector<Point> > largestContourVec;
    largestContourVec.push_back(contours.at(contours.size()-1));
    //make a bounding rectangle around the largest contour then find its centroid
    //this will be the object's final estimated position.
    objectBoundingRectangle = boundingRect(largestContourVec.at(0));
    int xpos = objectBoundingRectangle.x+objectBoundingRectangle.width/2;
    int ypos = objectBoundingRectangle.y+objectBoundingRectangle.height/2;

    //update the objects positions by changing the 'theObject' array values
    theObject[0] = xpos , theObject[1] = ypos;
}
//make some temp x and y variables so we dont have to type out so much
int x = theObject[0];
int y = theObject[1];
//draw some crosshairs on the object
circle(cameraFeed,Point(x,y),20,Scalar(0,255,0),2);
line(cameraFeed,Point(x,y),Point(x,y-25),Scalar(0,255,0),2);
line(cameraFeed,Point(x,y),Point(x,y+25),Scalar(0,255,0),2);
line(cameraFeed,Point(x,y),Point(x-25,y),Scalar(0,255,0),2);
line(cameraFeed,Point(x,y),Point(x+25,y),Scalar(0,255,0),2);
putText(cameraFeed,"Tracking object at (" + intToString(x)+","+intToString(y)+")",Point(x,y),1,1,Scalar(255,0,0),2);



}
int main(){

//some boolean variables for added functionality
bool objectDetected = false;
//these ...
(more)