homography,
camera_buffer: vec![0u8; IMAGE_AREA],
- camera: Camera::new("/dev/video0").unwrap(),
+ camera: Camera::new("/dev/video2").unwrap(),
chunks: SPECTOGRAM_AREA
};
+
array.camera.start(&Config {
interval: (1, FPS as u32),
resolution: (IMAGE_WIDTH as u32, IMAGE_HEIGHT as u32),
fn calibrate (&mut self) {
// rscam gives and empty image if its not prompted a couple times
for _i in 0..10 {
- self.camera_buffer = self.camera.capture().unwrap()[..].try_into().expect("Image is wrong size");
+ self.camera_buffer = self.camera.capture().unwrap()[..].try_into().expect("Image is wrong size"); //delete assignment
}
// enter unsafe and get the homography array
let homography = [0f64; 9]; // homography is a 3x3 matrix of 64-bit floats
let mut image_array = ImageArray::new(homography);
+ println!("registered image array");
+
// create the debug window
let debug_window = create_window("Debug", Default::default())?;
+
// create window for displaying images and display calibration image
let display_window = create_window("Display", Default::default())?;
- let calibration_image = ImageReader::open("calibration.jpg")?.decode()?;
+ let calibration_image = ImageReader::open("src/calibration.jpg")?.decode()?;
display_window.set_image("Display", calibration_image)?;
+
// wait for the user to press a key before continuing
for event in display_window.event_channel()? {
if let event::WindowEvent::KeyboardInput(event) = event {
}
}
+
// calibrate camera
image_array.calibrate();
// open audio file
- let mut reader = hound::WavReader::open("/home/will/Downloads/Adducci - Around the Horn.wav").unwrap();
+ let mut reader = hound::WavReader::open("/home/will/Music/Adducci - Around the Horn.wav").unwrap();
let file_rate = reader.spec().sample_rate;
// setup audio output and build output stream
{
try
{
- Mat img1 = imread( samples::findFile("calibration.jpg")/*, IMREAD_GRAYSCALE */);
+ Mat img1 = imread( samples::findFile("src/calibration.jpg")/*, IMREAD_GRAYSCALE */);
Mat img2(IMAGE_HEIGHT, IMAGE_WIDTH, CV_8UC3, camera_ptr);
// detect keypoints and compute descriptors