View Single Post
  #4   Spotlight this post!  
Unread 09-02-2012, 12:00
basicxman basicxman is offline
Emily Horsman
FRC #2200 (MMRambotics)
Team Role: Programmer
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Burlington, Ontario
Posts: 971
basicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant future
Send a message via AIM to basicxman Send a message via MSN to basicxman Send a message via Yahoo to basicxman
Re: SmartDashboard Laptop Camera Black Image

Same problem on a Gateway NV5905h, believe it has to do with this: http://code.google.com/p/javacv/wiki/Windows7AndOpenCV

Quote:
I cannot capture from my Webcam using opencv_highgui or OpenCVFrameGrabber

OpenCV uses Video for Windows, which does not always work properly under Windows 7. Use VideoInputFrameGrabber instead, which uses DirectShow and should always work correctly.
EDIT: WPILaptopCamera.java

Code:
package edu.wpi.first.wpijavacv;

import static com.googlecode.javacv.cpp.opencv_highgui.*;
/**
 * A class used to gather images from cameras connected to the laptop
 * @author Greg
 */
public class WPILaptopCamera extends WPIDisposable {
    CvCapture cam;

    public WPILaptopCamera() {
        cam = cvCreateCameraCapture(0);
    }

    public WPIColorImage getCurrentFrame(){
        return new WPIColorImage(cvQueryFrame(cam));
    }

    @Override
    protected void disposed() {
    }

}
Reply With Quote