Ask Your Question

Akhar's profile - activity

2019-03-16 05:26:39 -0500 received badge  Notable Question (source)
2016-03-06 06:53:12 -0500 received badge  Popular Question (source)
2013-02-19 03:59:00 -0500 received badge  Supporter (source)
2013-02-19 03:54:25 -0500 received badge  Critic (source)
2013-02-16 02:06:38 -0500 commented answer [C++] OpenCV2.4.3, cv::resize produces empty image

Ah yes, thank you, silly mistake: that is now switched. Alas it still did not fix the issue, mayhap I should test the beta library. Though I am hesitant to believe something is off with the stable release of course.

2013-02-15 16:01:20 -0500 commented answer [C++] OpenCV2.4.3, cv::resize produces empty image

I appreciate the assistance. It was adjusted as per your instructions however I'm sorry to say the same issues are still present, whether I use step/height4/width3. Step being the one I used first before a bunch of melatonin-induced debugging.

2013-02-15 15:37:43 -0500 received badge  Editor (source)
2013-02-15 04:44:03 -0500 asked a question [C++] OpenCV2.4.3, cv::resize produces empty image

I have been attempting to use OpenCV together with Tesseract to produce some manner of Label reader. 'resize' under the cv namespace has however refused to cooperate and produces an erroneous image with a red cross much like a union jack. Here is the (most likely) offending piece(s) of code;

cv::VideoCapture capture;
cv::Mat CVImg;
if ( !capture.open(CV_CAP_ANY) ) 
{
    //TODO
    return;
}
if (!IsIconic((HWND)this->Handle.ToInt32()))
{
    if (!capture.read(CVImg)) 
    {
        //TODO
        return;
    }
    cv::Mat CVNewImg (pictureBox1->Height, pictureBox1->Width, CVImg.type());
    cv::resize(CVImg,CVNewImg, CVNewImg.size(), 0, 0, CV_INTER_LINEAR); //Problematic
    displayMat(CVNewImg);
}
void displayMat (cv::Mat DSPIMG)
{
    if (DSPIMG.type() == CV_8UC3)
    {
        this->pictureBox1->Image=(gcnew System::Drawing::Bitmap(
        DSPIMG.size().width,
        DSPIMG.size().height,
        DSPIMG.size().width * 3,
        System::Drawing::Imaging::PixelFormat::Format24bppRgb,
        (System::IntPtr)DSPIMG.data));
    }
}

This is in windows MFC, so forgive me if I do not wish to cover an entire page with all the junk code. If this is something very simple that I have overlooked I would very much appreciate it if you in your superior wisdom could enlighten me, perhaps I have completely misinterpreted the correct use of the function. In short: It is very possible I am being a complete moron, alas my sleep has been rather lacking as I am under a lot of pressure time-wise.

I can parse the original CVImg to displayMat and it will display properly, save for not actually adjusting to the size of the picturebox of course. However not so with CVNewImg, producing the aforementioned symbol of britland.