Ask Your Question
0

Capture Window has strange ASCII characters?!!

asked 2014-11-07 20:49:51 -0600

Nimble_Ninja gravatar image

updated 2014-11-07 20:57:55 -0600

When I use imshow() the image is shown for 1 camera, but there are strange ascii characters along the top bar instead of the window name...anybody else have this issue? I am using Opencv249, VS2013, Win 8.1 and running 64 bit app

image description

trying stereo camera as well...here is code:

#include "opencv\cv.h";
#include "opencv2\highgui\highgui.hpp";
#include "opencv2\imgproc\imgproc.hpp";

#include <iostream>;

using namespace cv;
using namespace std;



int main()
{
    VideoCapture stream1(0); //camera 1
    VideoCapture stream2(1); // camera 2

    if (!stream1.isOpened()) { //check if video device 0 has been initialised
        cout << "cannot open camera";
    };

    if (!stream2.isOpened()) { //check if video device 1 has been initialised
        cout << "cannot open camera";
    };




//  if (!stream1.isOpened()) return 1;
//  if (!stream2.isOpened()) return 1;




    for (;;){
//  while (true){
        Mat cameraFrame1;
        Mat cameraFrame2;

        stream1.read(cameraFrame1);
        stream2.read(cameraFrame2);

        namedWindow("RedCamera", WINDOW_AUTOSIZE);
        imshow("RedCamera", cameraFrame1);

        namedWindow("BlackCamera", WINDOW_AUTOSIZE);
        imshow("BlackCamera", cameraFrame2);

        if (waitKey(30) >= 0) break;
            }

    return 0;

}

Any help is appreciated!!

BTW...this is what showed up in debug build window(): 1>------ Build started: Project: StereoCapture, Configuration: Debug x64 ------ 1> Source.cpp 1>Source.cpp(1): warning C4067: unexpected tokens following preprocessor directive - expected a newline 1>Source.cpp(2): warning C4067: unexpected tokens following preprocessor directive - expected a newline 1>Source.cpp(3): warning C4067: unexpected tokens following preprocessor directive - expected a newline 1>Source.cpp(5): warning C4067: unexpected tokens following preprocessor directive - expected a newline 1> StereoCapture.vcxproj -> C:\Users\User\documents\visual studio 2013\Projects\StereoCapture\x64\Debug\StereoCapture.exe ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

I don't know if the unexpected tokens is causing this...I have no idea what those lines mean...

edit retag flag offensive close merge delete

Comments

1

please triple-check the opencv libs your program is linking. do not use debug libs with a release build, or the other way round.

"gibberrish" strings are mostly a result of linking to different models of the c++stdlib.

also, include the c++ headers like:

#include "opencv2/core/core.hpp"   // forward slashes, no semicolon required.

and avoid the old c headers like opencv/cv.h

berak gravatar imageberak ( 2014-11-08 00:27:24 -0600 )edit

Thanks for the response!! It was indeed the cv files... I had the files input in the global sheet and not in the individual property sheets for the debug and release. Thank you so much for point me to it!!

Nimble_Ninja gravatar imageNimble_Ninja ( 2014-11-08 10:04:08 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-11-11 21:19:41 -0600

Nimble_Ninja gravatar image

Thanks for the response!! It was indeed the cv files... I had the files input in the global sheet and not in the individual property sheets for the debug and release. Thank you so much for point me to it!!

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-11-07 20:49:51 -0600

Seen: 866 times

Last updated: Nov 11 '14