View Single Post
  #1   Spotlight this post!  
Unread 06-02-2016, 20:15
The Doctor's Avatar
The Doctor The Doctor is offline
Robotics is life
AKA: Hackson
FRC #3216 (MRT)
Team Role: Programmer
 
Join Date: Mar 2014
Rookie Year: 2013
Location: United States
Posts: 152
The Doctor is on a distinguished road
Running a custom deinterlacng program on the driver station

I'm trying to get two cameras running on our robot this year. I've started putting some code into our main program [Java]:

globals:
Code:
final int numcameras = 2; // we've got this many cameras
int[] cameras;
int curcamera;
NIVision.Image curframe;
CameraServer cserver;
init:
Code:
curframe = NIVision.imaqCreateImage(NIVision.ImageType.IMAGE_RGB, 0);
for (int i = 0; i < numcameras; i++) {
	cameras[i] = NIVision.IMAQdxOpenCamera("cam" + (i+1), NIVision.IMAQdxCameraControlMode.CameraControlModeController);
	NIVision.IMAQdxConfigureGrab(cameras[i]);
}
curcamera = 0;
cserver = CameraServer.getInstance();
periodic:
Code:
curcamera += 1; curcamera %= numcameras;
NIVision.IMAQdxGrab(cameras[curcamera], curframe, 1);
cserver.setImage(curframe);
...However, this code will rapidly switch between the cameras. What I want to do is write a program to run on the driver station, to "deinterlace" the images, by displaying every other frame in its own spot. I'm quite fluent in Processing (Java with some cool libraries), which would make deinterlacing the images easy if I had the image stream available... My question is: how do I get raw image data from the robot on the driver station? I ideally want a solution that can work through the FMS.

Is there a part of the NIVision library that can receive this stream? Or do I need another Java library? And how is it possible to access the video stream with third-party programs in the DS?
__________________
Robots + Python + pentesting == me;
Blog ~ GitHub ~ Keybase
If you have a pressing issue to discuss with me, kik me at slush.puddles since I don't check CD very often.