Alright, I wrote up some new code and I am getting some linking errors around cscore. Here is my make file.
Here is the error Im getting
Code:
/tmp/ccVjljw2.o: In function `cs::VideoSource::VideoSource(cs::VideoSource const&)':
test.cpp:(.text._ZN2cs11VideoSourceC2ERKS0_[_ZN2cs11VideoSourceC5ERKS0_]+0x44): undefined reference to `cs::CopySource(int, int*)'
(And a bunch more like this)
Code:
# the compiler
CC = g++
#compiler flags:
CFLAGS = -std=c++0x `pkg-config --cflags --libs opencv` -I/home/pi/wpiutil/include -I/home/pi/ntcore/include -I/home/pi/cscore/include -L/home/pi/wpiutil/Linux/arm -L/home/pi/ntcore/arm/ntcore/build/libs/ntcore/static -L/home/pi/cscore/Linux/arm -lwpiutil -lntcore -lcscore
TARGET = test
all: $(TARGET)
$(TARGET): $(TARGET).cpp
$(CC) $(CFLAGS) -o $(TARGET) $(TARGET).cpp
clean:
$(RM) (TARGET)
$(RM) (CAMSERV)
Here is my code
Code:
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <iostream>
#include <ntcore.h>
#include <networktables/NetworkTable.h>
#include <cscore.h>
void processImage() {
}
void VisionThread() {
cs::UsbCamera camera = cs::UsbCamera("cam0", 0);
cs::CvSink sink = cs::CvSink("sink");
sink.SetSource(camera);
cs::CvSource source = cs::CvSource("src", cs::VideoMode::PixelFormat::kMJPEG, 640, 480, 30);
cs::MjpegServer mjpegServer = cs::MjpegServer("server", 1182);
mjpegServer.SetSource(source);
cv::Mat input;
cv::Mat output;
while(true) {
sink.GrabFrame(input);
cv::cvtColor(input, output, cv::COLOR_BGR2GRAY);
source.PutFrame(output);
}
}
int main(int argc, const char** argv) {
VisionThread();
return 0;
}
Thank you for the help!
- Drew