Ask Your Question

srinu ambati's profile - activity

2016-06-07 10:05:40 -0500 received badge  Popular Question (source)
2015-09-30 12:37:22 -0500 received badge  Student (source)
2014-09-25 23:08:54 -0500 received badge  Famous Question (source)
2014-01-14 02:08:04 -0500 received badge  Notable Question (source)
2013-09-17 00:23:26 -0500 received badge  Popular Question (source)
2012-12-16 02:46:14 -0500 asked a question Template matching in xcode

Hi all, I have used the following code for pattern recognition . But it is giving the false matching result . Please help me what is wrong in it . This is written in xcode .

Mat img_display;
img.copyTo( img_display );

/// Create the result matrix
int result_cols =  img.cols - templ.cols + 1;
int result_rows = img.rows - templ.rows + 1;

result.create( result_cols, result_rows, CV_32FC1 );

/// Do the Matching and Normalize
matchTemplate( img, templ, result, 5 );
normalize( result, result, 0, 1, NORM_MINMAX, -1, Mat() );

/// Localizing the best match with minMaxLoc
double minVal; double maxVal; Point minLoc; Point maxLoc;
Point matchLoc;

minMaxLoc( result, &minVal, &maxVal, &minLoc, &maxLoc, Mat() );


/// For SQDIFF and SQDIFF_NORMED, the best matches are lower values. For all the other methods, the higher the better
if( match_method  == CV_TM_SQDIFF || match_method == CV_TM_SQDIFF_NORMED )
{
    matchLoc = minLoc;
    printf("fsf");
}
else
{
    matchLoc = maxLoc;
    printf("fsf2");
}

/// Show me what you got
rectangle( img_display, matchLoc, Point( matchLoc.x + templ.cols , matchLoc.y + templ.rows ), Scalar::all(0), 2, 8, 0 );
//rectangle( result, matchLoc, Point( matchLoc.x + templ.cols , matchLoc.y + templ.rows ), Scalar::all(0), 2, 8, 0 );

//imshow( image_window, img_display );
//imshow( result_window, result );
2012-12-14 04:42:31 -0500 asked a question Measure distance from detected object using opencv

Hi all,

I have detected the circles using the HoughCircles method. Now I would like to find the distance from the object . So please give me some ideas or links. Thanks in advance .

2012-12-14 00:16:11 -0500 asked a question Detect Only circles using the openCV

Hi all,

I am using the following code to detect the circles but it is also detecting the other shapes . Please help me to detect the circles .

Mat src, src_gray;

/// Read the image
src = t2;

if(! src.data )                              // Check for invalid input
{
    cout <<  "Could not open or find the image" << std::endl ;
    //cv::waitKey(5000);
}

/// Convert it to gray
cvtColor( src, src_gray, CV_BGR2GRAY );
blur( src_gray, src_gray, Size(3,3) );

/// Reduce the noise so we avoid false circle detection
GaussianBlur( src_gray, src_gray, Size(9, 9), 2, 2 );

Mat src_lines; Mat src_gray_lines;
int thresh_lines = 100;
RNG rng_lines(12345);

Mat threshold_output;
vector<vector<Point> > contours;
vector<Vec4i> hierarchy;

src_gray_lines = src_gray;
/// Detect edges using Threshold
threshold( src_gray_lines, threshold_output, thresh_lines, 255, THRESH_BINARY );
/// Find contours
findContours( threshold_output, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, Point(0, 0) );

/// Find the rotated rectangles and ellipses for each contour
vector<RotatedRect> minRect( contours.size() );
vector<RotatedRect> minEllipse( contours.size() );

for( size_t i = 0; i < contours.size(); i++ )
{
    minRect[i] = minAreaRect( Mat(contours[i]) );
}

/// Draw contours + rotated rects + ellipses
Mat drawing = Mat::zeros( threshold_output.size(), CV_8UC3 );
for( size_t i = 0; i< contours.size(); i++ )
{
    // rotated rectangle
    Point2f rect_points[4];
    minRect[i].points( rect_points );
    for( int j = 0; j < 4; j++ )
        line( src, rect_points[j], rect_points[(j+1)%4], Scalar(255,0,0), 1, 8 );
}

Thanks in advance .

2012-12-11 00:58:43 -0500 asked a question Issue at the line imread("one.jpg") in xcode

Hi all,

I am using a file from openCV framework in Xcode . Everything is good but at this line

src = imread("ellipse.jpg"); // Eventhough I Pass the full path of Image it is not reading the Image
if(! src.data )                            
{
    cout <<  "Could not open or find the image" << std::endl ;
    cv::waitKey(5000);
}

It always return the " Could not open or find the image " message . The file is in the resource folder of my project .

2012-12-10 06:10:02 -0500 asked a question Highlight the squares,rectangles in an image using OpenCV ( iOS App )

Hi all,

I have to highlight the Squares,rectangles in an Image using the OpenCV . Please let me know if you need clarity or in detail description . Any Ideas,links or codes would be helpful . Thanks in advance

2012-12-10 05:27:25 -0500 commented answer OpenCV Crash Issue when using in xcode

Thank you bjoemz. Last doubt is Whatever Image I am passing it is giving the output as square. Please help me . Thanks in advance.

2012-12-10 05:25:42 -0500 received badge  Scholar (source)
2012-12-10 03:09:02 -0500 asked a question OpenCV Crash Issue when using in xcode

I am doing a iOS App to detect the circles and squares in an image . For that I am using the openCV link . When I compile it it is crashing at the this line

  int iheight = 460;
int jwidth = 320;

if( (data[istep+jchannels+0] > 200) && (data[istep+jchannels+1] > 200) && (data[istep+jchannels+2] > 220) )` Please help me , Thanks in advance.

2012-12-07 05:37:48 -0500 asked a question Integration of squares.cpp in xcode

Hi all,

I have used the squares.cpp file which I downloaded from OpenCV website, in Xcode . It is giving the errors Reference to Point is ambitious .

Please tell me how to fix this issue. Thank in advance

2012-12-07 04:36:55 -0500 commented answer Highlight the Squares in an Image using OpenCV for iOS

hmm thanks for your reply dude

2012-12-07 03:47:40 -0500 commented answer Highlight the Squares in an Image using OpenCV for iOS

I got it I have squares.cpp file. But unable to integrate it in the Xcode Project. Please tell me. Thanks in advance .

2012-12-07 01:28:49 -0500 commented question Highlight the Squares in an Image using OpenCV for iOS

I have seen that but not getting . If you have any samples please send me the links. Thanks in advance .

2012-12-07 01:16:00 -0500 commented answer Highlight the Squares in an Image using OpenCV for iOS

Could you send me the link?

2012-12-06 22:49:05 -0500 asked a question Highlight the Squares in an Image using OpenCV for iOS

Hi all,

I have to highlight the squares in an Image Using the OpenCv . I am trying to implement this since 3 days , but not getting how to do this. Please help me to do this . Thanks in advance .

2012-12-06 06:15:59 -0500 received badge  Editor (source)
2012-12-06 04:56:49 -0500 received badge  Supporter (source)
2012-12-06 04:05:55 -0500 asked a question FaceDetection in iOS using OpenCV

Hi all,

I have followed this link http://docs.opencv.org/doc/tutorials/ios/video_processing/video_processing.html#opencviosvideoprocessing . But I am unable to find the class called CVCameracontroller . Please give me if any one have it. Thanks and Regards, Srinu