that is a known issue of OpenCV, it often uses BGR instead of RGB.
You have to switch the B and R. You can copy code from IVT/Image/ImageAccessCV.cpp, which does exactly the same for loading an image with the aid of OpenCV. I'll add ImageAccessCV::SaveToFile in the next version.
Pedram
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
take a look at the new version 1.3.9 of the IVT. I added the function ImageAccessCV::SaveToFile and also updated the example application IVT/examples/SimpleAppCV (resp. IVT/win32/SimpleAppCV) to show the use of ImageAccessCV::LoadFromFile and ImageAccessCV::SaveToFile.
Pedram
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've tried this new version of IVT.
I used this code here:
//storeimageastiffvoidFileHelper::saveAsTiff(CByteImage*image,stringfilename){stringfile;file.append("/images/");file.append(filename);if(!ImageAccessCV::SaveToFile(image,file.c_str())){//printf("Fehler: konnte Bild (%s) nicht speichern \n",file.c_str());}}
The image wil be saved but it's return the message "segmentation failure".
I read in the code, this is a message from OpenCV. How I can prevent this error?
I saw in the new function code that the error message of the new function has the wrong message.
printf("error: CByteImage::eRGB24Split not supported by ImageAccessCV::LoadFromFile\n");
should be:
printf("error: CByteImage::eRGB24Split not supported by ImageAccessCV::SaveToFile\n");
Thanks for your help :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I'm trying to save an edited Image with opencv as an tiff file.
Here my sample code:
Now my problem is, the file will be created but the color is wrong. It's in blue…
What's wrong with my sample?
Thanks for any help :)
Hi,
that is a known issue of OpenCV, it often uses BGR instead of RGB.
You have to switch the B and R. You can copy code from IVT/Image/ImageAccessCV.cpp, which does exactly the same for loading an image with the aid of OpenCV. I'll add ImageAccessCV::SaveToFile in the next version.
Pedram
Hi,
take a look at the new version 1.3.9 of the IVT. I added the function ImageAccessCV::SaveToFile and also updated the example application IVT/examples/SimpleAppCV (resp. IVT/win32/SimpleAppCV) to show the use of ImageAccessCV::LoadFromFile and ImageAccessCV::SaveToFile.
Pedram
Hi,
I've tried this new version of IVT.
I used this code here:
The image wil be saved but it's return the message "segmentation failure".
I read in the code, this is a message from OpenCV. How I can prevent this error?
I saw in the new function code that the error message of the new function has the wrong message.
should be:
Thanks for your help :)