Ask Your Question

Goldenline's profile - activity

2016-06-23 17:19:39 -0600 asked a question stream video from iPhone to OS X app and process it

I am working on an OS X app: the goal is to stream video from iPhone and perform object recognition. The issue is that I am not able to capture the camera image. Is there a way to add the iPhone video feed directly from the phone instead of streaming the video? I tried to use url stream but Xcode does not read or open the camera.

2015-07-09 12:03:56 -0600 asked a question iOS VideoCapture cap(0); Code will never be executed

I am trying to capture my computer webcam image using Xcode. Here my code: // // main.cpp // OpevCVTest1

#include <iostream>
#include "opencv2/opencv.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/core/core.hpp"
#include "opencv2/video/video.hpp"
using namespace cv;

int main(int argc, const char * argv[]) {
std::cout << "OpenCV Version" << CV_VERSION << std::endl;
return 0;

VideoCapture cap(0); - Error message “code will never be executed” semantic issue
cap.open(0);

if (!cap.isOpened()) {
    std::cout << "Unable to read stream from specified device." << std::endl;

}

while (true)
{
    // retrieve the frame:
    Mat frame;
    if (!cap.read(frame)) {
        std::cout << "Unable to retrieve frame from video stream." << std::endl;
        break;
    }
    // display it:
    imshow("MyVideo", frame);

    // check if Esc has been pressed:
    if (waitKey(1) == 27) {
        break;
    }
    // else continue:
}

cap.release();



    }