Friday, 9 August 2013

ranger studio opencv boost saving a .tif file

ranger studio opencv boost saving a .tif file

I am trying a save a .tif file from a sick camera. I can save the .dat and
.xml file that can be opened in ranger studio. But I want to be able to
save a .tif file and I have been unable to do the conversions. I will try
to explain the code as much as I can.
first, I get the camera buffer and save a .dat and .xml file for working
with, and this part works fine:
box::CameraBuffer *c_buffer = work_data->WaitForCBuffer();
c_buffer->Save(wxString::Format("%sraw_%d", PATH, image_no).c_str());
Next saving the image, (please don't tell me the opencv libraries are old):
boost::lock_guard<boost::recursive_mutex> image_lock(work_data->GetImage());
CvImage const &image = work_data->GetImage(WorkData::IMAGE_GET);
boost::gil::tiff_write_view(wxString().Format("%simage%d.tif", PATH,
sequence_number).c_str(),boost::gil::interleaved_view(image .width(),
image .roi().y + image .roi().height,(boost::gil::gray16_pixel_t
*)image .data(),image .step()));
I am getting a 1kb tif image so it's empty. I am looking for an example of
taking the camera buffer above and saving it. Thanks

No comments:

Post a Comment