# Rookie1's profile - activity

2014-11-09 10:24:56 -0500 asked a question erase founded contour from vector

Hi!

I have vector which contains contous of image in rectangles, that have certain size and I want to erase from this vector ones which are not close to each other in X axis.

I added this condition, but it seems to be incorrectly written cause I'm getting this failure :

"std::_Vector_iterator<_Myvec> std::vector<_Ty>::erase(std::_Vector_const_iterator<_Myvec>)' : cannot convert parameter 1 from 'cv::Rect_<_Tp>' to 'std::_Vector_const_iterator<_Myvec>' "

Here is this part of my script:

if (std::abs(prostokat[i].x - prostokat[j].x) > 7)

prostokat.erase(prostokat[i]);

I would be really thankfull if someone would help my solve this issue.

2014-11-08 05:34:51 -0500 asked a question Erasing an unwanted contour from vector

Hi! I'm writing script in C++ where I want to find contours of image lying on the similar places on Y axis. I wrote one condition but it doesn't work precisly as I want to because sometimes it finds also few more contours layin on the same line with each other, but not the same line as the other. I only want to have 5 to 7 contours laying on one line. I added other condition to erase the one that is not laying on the same line, but I got failure : "cannot convert parameter 1 from 'cv::Rect_<_Tp>' to 'std::_Vector_const_iterator<_Myvec>' " I'm posting this part of my script. First situation is here:

int ilosc = prostokat.size();

for(int i = 0; i< ilosc; i++ ) { int licznik = 0; int wysoko = 10;

for(int j = 0; j< ilosc; j++ )
{

if ((std::abs(prostokat[i].x - prostokat[j].x) <=210) && abs(prostokat[i].y - prostokat[j].y) <=10)

{

if(i != j)
{

Scalar color = Scalar( rng.uniform(0, 255), rng.uniform(0,255), rng.uniform(0,255) );
rectangle( drawing, prostokat[i].tl(), prostokat[i].br(), color, 2, 8, 0 );
namedWindow( "Contours", CV_WINDOW_AUTOSIZE );
imshow( "Contours", drawing);


}

for(int a = 0; a < prostokat.size(); a++) { for(int b = 0; b < prostokat.size(); b++) { for(int c = 0; c < prostokat.size(); c++) {

       if((a != b) && ((prostokat[a].y) - (prostokat[b].y))>10 && (a != c) && ((prostokat[a].y) - (prostokat[c].y))>10)
{
prostokat.erase(prostokat[a]);
}

}
}


}

2014-10-15 16:06:15 -0500 asked a question Sorting contours in C++

Hi! I have a problem with sorting bounding boxes in X axis. Here is part of my script:

for (int b=0; b < prostokat.size(); b++) if(prostokat[0].x < prostokat[b].x ) prostokat[b] = prostokat[0]; But it assigns value of first rectangle to rest of founded.

2014-09-17 10:48:42 -0500 asked a question Converting image from grayscale to binary

As you can see in the topic I want to convert simple image in grayscale that contains only black number/letter on white background to binary. I would want to set 0 where pixel is less than f.e. 100 and 255 where its greater than 100. Can you tell me how can I do it?

2014-08-27 12:22:02 -0500 asked a question problem with using moveWindow

Hello!

I am writing a script in C++ that will be detecting and recognizing vehicle registration plates. I've already found all signs and now I want to compare them with my base. I wanted to use moveWindow but when program is trying to compile I get statement: error C3861: 'moveWindow': identifier not found. I think I attached all libraries. Below is part of my script where I'm adding libraries.

# include <iostream>

using namespace cv; using namespace std; I would be very grateful if someone would help me.

Hello!

I am writing a script in C++ that will be detecting and recognizing vehicle registration plates. I've already found objects of my interest but I have a problem in cutting out detected signs from picture. I want to do it because I want to resize them and compare them to my database. I think I have to use ROI function but I don't know how.

I tried to do so, but when I'm trying to compile the program I get this statement:

error C2664: 'cv::imshow' : cannot convert parameter 2 from 'cv::Rect' to 'cv::InputArray'
1>          Reason: cannot convert from 'cv::Rect' to 'const cv::_InputArray'


So here is my question: could anybody tell me how to do it? Below I post part of my script.

Scalar color = Scalar( rng.uniform(0, 255), rng.uniform(0,255), rng.uniform(0,255) );
rectangle( image_roi, prostokat[j].tl(), prostokat[j].br(), color, 2, 8, 0 );
Rect roi_1(prostokat[1].x, prostokat[1].y, prostokat[1].width, prostokat[1].height);
Mat image_1 = image(roi_1);
namedWindow( "Example1", CV_WINDOW_AUTOSIZE );
imshow("Example1",roi_1);


I would be very grateful if someone would help me.