Ask Your Question

soheil1365's profile - activity

2017-12-18 12:12:44 -0600 received badge  Famous Question (source)
2016-07-18 06:04:14 -0600 received badge  Famous Question (source)
2015-11-16 05:29:53 -0600 received badge  Notable Question (source)
2015-03-31 08:43:36 -0600 received badge  Notable Question (source)
2014-11-11 21:58:32 -0600 received badge  Popular Question (source)
2014-08-16 04:13:08 -0600 received badge  Popular Question (source)
2013-07-21 22:17:36 -0600 received badge  Student (source)
2013-06-15 09:27:46 -0600 commented answer cv::fitline

thank you...

2013-06-15 09:18:03 -0600 commented answer cv::fitline

Can you describe me more what you mean by "length 5" in your response?

2013-06-15 09:12:41 -0600 commented answer cv::fitline

thank you very much... these two second elements are points on the fitted line or are the given points? if they are on the fit line, they should have some distance with exact points that I gave to fitline function Am I right?

2013-06-15 08:11:15 -0600 asked a question cv::fitline

Hi guys

I am using opencv /C++ I am using cv::fitline for fitting one line btw different given 2D points.

    cv::fitLine(vecDraw,myLine,CV_DIST_L1,0,0.01,0.01);

after executing this code as you know my output is in "myLine" variable. my question:

do I need to use cv::Line after cv::fitline for drawing the line on one image or cv::fitline draw our line itself? if using cv::Line is necessary how can I use it regarding to "myLine" variable which containes my requested line?

thanks in advance

I need your help as soon as possible.

2013-04-28 05:21:12 -0600 commented question Houghlines detects incorrectly

oh nooo...I do not think so...because all the other people work with houghlines function properly...

2013-04-27 08:52:06 -0600 commented question Houghlines detects incorrectly

again it gives me wrong answer... some additional and useless lines will be detected...I did it right now

2013-04-27 07:37:34 -0600 commented question Houghlines detects incorrectly

Mat src_gray, grad_x, grad_y, abs_grad_x, abs_grad_y, grad,temp,dst,cdst; vector<Vec2f> lines; vector<Vec2f> all; noOfLines = 0; Point pt1, pt2; int scale = 1; int delta = 0; int ddepth = CV_16S; img.copyTo(temp); GaussianBlur( img, temp, Size(3,3), 0, 0, BORDER_DEFAULT ); cvtColor(temp, src_gray, CV_RGB2GRAY ); Sobel( src_gray, grad_x, ddepth, 1, 0, 3, scale, delta, BORDER_DEFAULT ); convertScaleAbs( grad_x, abs_grad_x ); Sobel( src_gray, grad_y, ddepth, 0, 1, 3, scale, delta, BORDER_DEFAULT ); convertScaleAbs( grad_y, abs_grad_y ); addWeighted( abs_grad_x, 0.5, abs_grad_y, 0.5, 0, grad ); Canny(img,, dst, 128, 200, 3); cvtColor(dst, cdst, CV_GRAY2BGR); HoughLines(dst, lines,10 , CV_PI/10, 128, 0,0 );

Then I drew the detected lines

2013-04-27 05:22:15 -0600 asked a question Houghlines detects incorrectly

Hello guys...

I am detecting line with houghlines in opencv/c++.but the result are not logical... how can I improve the results.

for example some of the trivial lines are not detected while some wrong lines will be drawn... you can see in my image why this diagonal line has been detected while it is not really line(look at thresholded image) and in the other hand some trivial lines(edge) which are really line are not detected... thank you vwry much for any help

image description


Edit: Added code from comment:

Mat src_gray, grad_x, grad_y, abs_grad_x, abs_grad_y, grad,temp,dst,cdst; 
vector<Vec2f> lines; 
vector<Vec2f> all; 
noOfLines = 0; 
Point pt1, pt2; 
int scale = 1; 
int delta = 0; 
int ddepth = CV_16S; 
img.copyTo(temp);
GaussianBlur( img, temp, Size(3,3), 0, 0, BORDER_DEFAULT ); 
cvtColor(temp, src_gray, CV_RGB2GRAY ); 
Sobel( src_gray, grad_x, ddepth, 1, 0, 3, scale, delta, BORDER_DEFAULT );
convertScaleAbs( grad_x, abs_grad_x ); 
Sobel( src_gray, grad_y, ddepth, 0, 1, 3, scale, delta, BORDER_DEFAULT );
convertScaleAbs( grad_y, abs_grad_y ); 
addWeighted( abs_grad_x, 0.5, abs_grad_y, 0.5, 0, grad ); 
Canny(img,, dst, 128, 200, 3); 
cvtColor(dst, cdst, CV_GRAY2BGR); 
HoughLines(dst, lines,10 , CV_PI/10, 128, 0,0 );
2013-02-08 16:55:15 -0600 asked a question reverse thresholding

Hi my friend

IS it possible in opencv to extract the original image from the thresholded of that?

I am going to put a button in my application which has 2 states...with its pressing ,threshold the image, with pressing it again original image is shown to me?

is it possible to do that?

thanks in advance

2013-02-04 17:27:15 -0600 asked a question Line detectionin opencv C++

Hi my friends

I am a new comer in opencv.I want to detect the lines in image...but I want to select which kind of line (vertical or Horizental)... It means when I want to detect Horizental lines , only horizental lines are shown to me.and does for Vertical lines.

Description: I am working in opencv C++ and I have used HoughLineP function.but this function shows me all the lines which are detected but I want to choose lines between horizental and vertical lines...How can I seperate these lines?

then How can I understand the angle of one of the specific lines with x axis?

thanks in advance from your helps