Ask Your Question

Revision history [back]

Capture Window has strange ASCII characters?!!

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!!

click to hide/show revision 2
added debug summary

Capture Window has strange ASCII characters?!!

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...