Ask Your Question

Rex's profile - activity

2020-10-11 12:17:55 -0600 received badge  Notable Question (source)
2020-07-16 22:52:33 -0600 received badge  Notable Question (source)
2020-01-17 02:27:02 -0600 received badge  Popular Question (source)
2019-09-09 09:45:18 -0600 received badge  Popular Question (source)
2016-02-20 21:38:38 -0600 received badge  Popular Question (source)
2015-02-28 14:35:07 -0600 received badge  Famous Question (source)
2014-04-23 11:08:21 -0600 received badge  Notable Question (source)
2013-12-01 06:21:29 -0600 received badge  Popular Question (source)
2012-12-14 05:18:24 -0600 asked a question compiling traincascade

Hi,

I cannot find any instructions for compiling the traincascade application on windows.

I am using Win7, vs2008.

What would the best manner be to compile traincascade on my system? Where would I find documentation about this?

Thanks.

2012-12-12 10:47:51 -0600 asked a question imread crashing for no reason whatsoever

HI,

Is this supposed to crash?

cv::Mat ReturnMat=imread("Path/To/My/image.jpg");

I am using 2.4.3 and the VS 2008 along with teh prebuilt binaries of opencv.

Nothing wrong with the image and nothing wrong with teh path (tried lots of different combinations)

Unless I am mistaken opencv will not be that unstable. This is seriously wonky.

Are there known issues with the prebuilt libraries on Win 7?

PS, I discovered that this:

cv::Mat ReturnMat=imread("hello.jpg");

does not crash (Does not load the image either though)

but this:

cv::Mat ReturnMat=imread("hellfddddddddddddddddddddddddo.jpg");

does. ????

Thanks.

2012-12-12 05:56:38 -0600 asked a question filestorage failing on isOpened() (and crashing)

Hi,

(2.4.3, VS 2008, Qt)

if passing the FileStorage constructor below file it fails:

Having tried everything inclkuding feeding it the contents of the file in string format (which the reference manual says should work) my only hope now is that there is something wrong with the file format.?

This is indeed straight from the opencv

<opencv_storage> <settings> <boardsize_width> 9</boardsize_width> <boardsize_height>6</boardsize_height>

<square_size>50</square_size>

<calibrate_pattern>"CHESSBOARD"</calibrate_pattern>

<input>"images/CameraCalibraation/VID5/VID5.xml"</input> <input_fliparoundhorizontalaxis>0</input_fliparoundhorizontalaxis>

<input_delay>100</input_delay>

<calibrate_nrofframetouse>25</calibrate_nrofframetouse> <calibrate_fixaspectratio> 1 </calibrate_fixaspectratio> <calibrate_assumezerotangentialdistortion>1</calibrate_assumezerotangentialdistortion> <calibrate_fixprincipalpointatthecenter> 1 </calibrate_fixprincipalpointatthecenter>

<write_outputfilename>"out_camera_data.xml"</write_outputfilename> <write_detectedfeaturepoints>1</write_detectedfeaturepoints> <write_extrinsicparameters>1</write_extrinsicparameters> <show_undistortedimage>1</show_undistortedimage>

</settings> </opencv_storage>

This is my code:

void Calib3dOCV::startCalibration(const QString& SettingsFileName){

Calib3dSettings s;

std::string FN=SettingsFileName.toStdString();
FileStorage fs(FN, FileStorage::READ); // Read the settings
if (!fs.isOpened())
{
    qDebug() << "Could not open the configuration file: " << SettingsFileName;
    return;
}
s.read(fs["Settings"]);// >> s;
fs.release();  

vector<vector<Point2f> > imagePoints;
Mat cameraMatrix, distCoeffs;
Size imageSize;
int mode = s.inputType == Calib3dSettings::IMAGE_LIST ? CAPTURING : DETECTION;
//clock_t prevTimestamp = 0;
const Scalar RED(0,0,255), GREEN(0,255,0);

return;

}

Am I overlooking something here?

2012-12-12 05:42:41 -0600 received badge  Student (source)
2012-12-12 04:05:59 -0600 commented answer ideal calibration boards (chessboard or circles)

Thanks Alexander. Under \opencv\samples\cpp threre are jpgs right01-right14 which may also help to test some code.

2012-12-11 04:48:47 -0600 asked a question ideal calibration boards (chessboard or circles)

Hi,

1-Does the opencv download not have an image of an ideal calibration board in it which one can print out and paste to a flat piece of metal?

2-The tutorial (which is really good btw) of which I am testing the code in the calibration section, lacks sample images with a calibration board in different poses? I do not yet have a camera connected and it would be handy to have some testing images at hand to run the calibration code on.

If either or both of above are in the opencv package it would be great to know where. I have not managed to locate them.

TIA.

2012-12-10 07:22:51 -0600 asked a question findContour crashes despite image being CV_8UC1

Hi,

the tutorial code for finding contours crashes on the method findContours.

I have almost coppied the code exactly and played with the parameters, checked the code according to the reference manual.

As far as I can tell I am not overlooking something. Is the method findContours known to be broken?

I have seen the previsou posts on this but they seem to point to the image not being CV_8UC1 which in my case is checked for.

See code below for what I am attempting:

//If already GrayScale
if(!CurrentMat.type()==CV_8UC1){
    QMessageBox::information(0,"ProcessImage","Image is not grayscale, bailing");
    return;
}

RNG rng(12345); //Random number

Mat canny_output;
vector<vector<Point> > contours;
vector<Vec4i> hierarchy;
/// Detect edges using canny


blur(CurrentMat,CurrentMat, Size(3,3)); //Does not really help
//Canny( CurrentMat, canny_output, thresh, thresh*15, 3 );
computeGradient(CurrentMat);

/// Find contours
findContours( CurrentMat, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, Point(0, 0) );
2012-12-10 05:55:49 -0600 commented answer rectangle color always gray

Thanks. There was an alpha channel in CurrentMat which caused the problem. Not sure why. CvtColor CV_BGRA2BGR seems to have sorted the problem out.

2012-12-10 04:44:05 -0600 received badge  Editor (source)
2012-12-10 04:43:07 -0600 asked a question rectangle color always gray

Hi

Silly little problem , but for some reason the method rectangle does not react to the input argument.

This should yield a red box, but the box is always gray no matter what I do to the input arguments of Scalar.

rectangle( CurrentMat, matchLoc, Point( matchLoc.x + TemplateMat.cols , matchLoc.y + TemplateMat.rows ), Scalar(0,0,255), 2, 8, 0);

Any suggestions? TIA.

2012-12-03 04:16:48 -0600 commented answer convertTo from CV_32f to CV_8U

Thanks that worked.

2012-12-03 03:04:04 -0600 asked a question convertTo from CV_32f to CV_8U

I want to do a bilateral filter and my image has to be type CV_8UC1/C3 for this.

To convert it would appear I have to use convertTo, but this is simply not working.

This is what I am doing:

Mat Temp= Mat(CurrentMat.size(),CV_8U);
CurrentMat.convertTo(Temp,CV_8UC3);
Mat Result=Temp.clone();
qDebug()<<CV_8UC1<<CV_8UC3;
qDebug()<<"Type"<<Temp.type()<<Result.type()<<CurrentMat.type();
qDebug()<<"Data"<<Result.data<<CurrentMat.data;     
bilateralFilter ( CurrentMat, Result, 5, 15, 15 );

Via the output I can clearly see that the type of Temp is 24 and not 0 or 16 which it should become.

Appreciated.

2012-11-26 06:42:20 -0600 asked a question qt .pro file example

Hi, I am still studying whatever documentation I can find on OpenCV. New to it. Wondering whether there is any place I can find a small compilable example project combining OpenCV with Qt. Normally the .pro file is the starting point from which I would be able to generate the makefiles for my envirionmnet (Windows, IDE:Visual Studio)

TIA !

2012-11-26 06:31:47 -0600 asked a question dxf matching

Hi, I am looking for functionality to match a model derived from a CAD dxf to images of flat products whereby the essence is to determine the coordinates and orientation of the products that have been identified. I cannot find an obvious set of functions in open CV pertaining to this. Better still would be an example.

Can anyone point me in the right direction? Appreciated!