Ask Your Question

mcsplace's profile - activity

2019-06-19 06:28:06 -0600 received badge  Famous Question (source)
2018-03-12 20:26:49 -0600 received badge  Notable Question (source)
2017-06-17 20:20:30 -0600 received badge  Popular Question (source)
2016-01-07 09:07:41 -0600 received badge  Student (source)
2015-06-30 10:10:23 -0600 commented question Is there a way to keep imwrite from overwriting files..?

I am using a name generator for the image filename... Problem is that I forget to move the files after a run.. Then I start up the application again and overwrite my previous run...

I have tried the cvHaveImageReader() and it works as @sturkmen stated above... However, is there any documentation on this function...? I can't find anything.. Thanks,

2015-06-30 07:16:25 -0600 asked a question Is there a way to keep imwrite from overwriting files..?

Using the latest OpenCV 3.0 on a Linux platform. Using the following to write out image files. However it is more than happy to overwrite an existing file... Is there a mechanism to keep imwrite() from overwriting files...?

/* Create parameters */
vector<int> params;
if( fileExt.compare( "png" ) == 0 )
{
    params.push_back( IMWRITE_PNG_COMPRESSION );
    params.push_back( png_compress_level );
}

/* Try to write image */
try
{
    imwrite( filename, *img, params );
}
catch (runtime_error& ex) 
{
    fprintf(stderr, "Exception converting image to PNG format: %s\n", ex.what());
    return( 0 );
}
2015-06-30 07:07:26 -0600 received badge  Supporter (source)
2015-06-18 10:50:22 -0600 asked a question MAT image type / structure

I see defines to convert (using cvtColor for example) colour space (COLOR_YUV22GRAY) or representation (COLOR_RGB2BGR), but is there a mechanism to store or determine if a image is RGB, YUV2, or BGR, etc...?