1 | initial version |
@sweptica you should not adapt the code as it is since the other case had different requirements and features. You need to play with the original code which I point in the other thread plus to play with some customizations in the parameters. For example changing the following in the code:
... ... int N = 1; ... ... if( maxCosine < 0.3 && ratio <= 0.15) ... ... adaptiveThreshold(~gray, bin, 255, CV_ADAPTIVE_THRESH_MEAN_C, THRESH_BINARY, 15, -5); imshow("bin", bin);
// find squares and draw them Mat inv; cvtColor(/~/bin, inv, CV_GRAY2BGR); imshow("inv", inv); vector<vector<point> > squares; findSquares(inv, squares);
I managed to get the following result:
2 | No.2 Revision |
@sweptica you should not adapt the code as it is since the other case had different requirements and features. You need to play with the original code which I point in the other thread plus to play with some customizations in the parameters. For example changing the following in the code:
...
...
int N = 1;
...
...
if( maxCosine < 0.3 && ratio <= 0.15)
...
...
adaptiveThreshold(~gray, bin, 255, CV_ADAPTIVE_THRESH_MEAN_C, THRESH_BINARY, 15, -5);
imshow("bin", I managed to get the following result:
I guess with some further process and customization you will get the desired result. Plus as @sturkmen said it would be nice to see some pictures with people on it, since the requirements I have the feeling that would be totally different.
3 | No.3 Revision |
@sweptica you should not adapt the code as it is since the other case had different requirements and features. You need to play with the original code which I point in the other thread plus to play with some customizations in the parameters. For example changing the following in the code:
...
...
int N = 1;
...
findContours(gray, contours, RETR_TREE, CHAIN_APPROX_SIMPLE);
...
if( maxCosine < 0.3 && ratio <= 0.15)
...
...
adaptiveThreshold(~gray, bin, 255, CV_ADAPTIVE_THRESH_MEAN_C, THRESH_BINARY, 15, -5);
imshow("bin", bin);
// find squares and draw them
Mat inv;
cvtColor(/*~*/bin, inv, CV_GRAY2BGR);
imshow("inv", inv);
vector<vector<Point> > squares;
findSquares(inv, squares);
I managed to get the following result:
I guess with some further process and customization you will get the desired result. Plus as @sturkmen said it would be nice to see some pictures with people on it, since the requirements I have the feeling that would be totally different.
4 | No.4 Revision |
@sweptica you should not adapt the code as it is since the other case had different requirements and features. You need to play with the original code which I point in the other thread plus to play with apply some customizations in the parameters. parameters regarding your use case. For example changing the following in the code:
...
...
int N = 1;
...
findContours(gray, contours, RETR_TREE, CHAIN_APPROX_SIMPLE);
...
if( maxCosine < 0.3 && ratio <= 0.15)
...
...
adaptiveThreshold(~gray, bin, 255, CV_ADAPTIVE_THRESH_MEAN_C, THRESH_BINARY, 15, -5);
imshow("bin", bin);
// find squares and draw them
Mat inv;
cvtColor(/*~*/bin, inv, CV_GRAY2BGR);
imshow("inv", inv);
vector<vector<Point> > squares;
findSquares(inv, squares);
I managed to get the following result:
I guess with some further process and customization you will get the desired result. Plus as @sturkmen said it would be nice to see some pictures with people on it, since the requirements I have the feeling that would be totally different.
5 | No.5 Revision |
@sweptica you should not adapt the code as it is since the other case had different requirements and features. You need to play with the original code which I point in the other thread plus to apply some customizations in the parameters regarding your use case. For example changing the following in the code:
...
...
int N = 1;
...
findContours(gray, contours, RETR_TREE, CHAIN_APPROX_SIMPLE);
...
if( maxCosine < 0.3 && ratio <= 0.15)
...
...
adaptiveThreshold(~gray, bin, 255, CV_ADAPTIVE_THRESH_MEAN_C, THRESH_BINARY, 15, -5);
imshow("bin", bin);
// find squares and draw them
Mat inv;
cvtColor(/*~*/bin, inv, CV_GRAY2BGR);
imshow("inv", inv);
vector<vector<Point> > squares;
findSquares(inv, squares);
I managed to get the following result:
I guess with some further process and customization you will get the desired result. Plus as @sturkmen said it would be nice to see some pictures with people on it, since the requirements I have the feeling that would be totally different.