sample program from leJOS News “openCV web streaming”

This is where you talk about the EV3 software itself, installation issues, and programming talk.

Moderators: roger, gloomyandy, skoehler

clplaneguy
Novice
Posts: 29
Joined: Sat Feb 18, 2017 3:44 pm

sample program from leJOS News “openCV web streaming”

Postby clplaneguy » Sat Apr 28, 2018 10:59 pm

I am trying to run the sample program from leJOS News “openCV web streaming”. I get the error massage
VIDEOIO ERROR: V4L/V4L2: VIDIOC_S_CROP

At line

Code: Select all

VideoCapture vid = new VideoCapture (0);

My test code follows . . .
Does anyone know what the problem might be?


Code: Select all

import java.net.ServerSocket;
import java.net.Socket;
 
import org.opencv.core.Core;
import org.opencv.highgui.Highgui;
import org.opencv.highgui.VideoCapture;


public class OpenCV_test
{    /////////////////////////////////////////////////////////////////////////
                                                                             //
 public static void main(String[] args) throws Exception {    ///////////    //
        System.out.println();                                          //    //   
        System.out.println("4/8/2018");                                //    //   
        System.out.println("Program: OpenCV web streaming");           //    //     
        System.loadLibrary(Core.NATIVE_LIBRARY_NAME);                  //    //   
        System.out.println("Point 1");                                 //    //   
        VideoCapture vid = new VideoCapture (0);                       //    //   
        System.out.println("Point 2");                                 //    //   
        vid.set (Highgui.CV_CAP_PROP_FRAME_WIDTH, 160);                //    //   
        System.out.println("Point 3");                                 //    //   
        vid.set (Highgui.CV_CAP_PROP_FRAME_HEIGHT, 120);               //    //   
        System.out.println("Point 4");                                 //    //   
        //vid.open(0);                                                 //    //   
        vid.open(-1);                                                  //    //
                                                                       //    //
        System.out.println("Point 5");                                 //    //
        ServerSocket ss = new ServerSocket (8080);   // 8080           //    //
        System.out.println("Point 6");                                 //    //
        Socket sock = ss.accept();                                     //    //
        System.out.println("Socket connected");                        //    //
        String boundary = "That’s it folks!";                          //    //
        System.out.println("Camera open");                             //    //
       }    /////////////////////////////////////////////////////////////    //   
                                                                             //
 }    /////////////////////////////////////////////////////////////////////////

User avatar
gloomyandy
leJOS Team Member
Posts: 6047
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: sample program from leJOS News “openCV web streaming”

Postby gloomyandy » Sun Apr 29, 2018 5:06 pm

I think you can just ignore that message, does your program work?
leJOS news https://lejosnews.wordpress.com/


Return to “EV3 Software”

Who is online

Users browsing this forum: No registered users and 2 guests