1 | initial version |
You should used a different name for each image:
char image_name[ 4 ][] = { "image1", "image2", "image3", "image4" };
for( int y = 0, i = 0 ; y < image.rows ; y += smallSize.height )
for( int x = 0 ; x < image.cols ; x += smallSize.width, ++i )
imshow( image_name[ i ], smallImages[ i ] );
waitKey( 0 );
Otherwise, you display every image in the same window, therefore, you only see the last one. By the way, don't forget the waitKey, otherwise, you won't see anything! (but I guess you already have it?)
2 | Udpate code |
You should used a different name for each image:
char image_name[ 4 ][] ][ 255 ] = { "image1", "image2", "image3", "image4" };
for( int y = 0, i = 0 ; y < image.rows ; y += smallSize.height )
for( int x = 0 ; x < image.cols ; x += smallSize.width, ++i )
imshow( image_name[ i ], smallImages[ i ] );
waitKey( 0 );
Otherwise, you display every image in the same window, therefore, you only see the last one. By the way, don't forget the waitKey, otherwise, you won't see anything! (but I guess you already have it?)
3 | Update code. |
You should used a different name for each image:
char image_name[ 4 ][ 255 ] = { "image1", "image2", "image3", "image4" };
for( int y = 0, i = 0 ; y < image.rows ; y += smallSize.height )
for( int x = 0 ; x < image.cols ; x += smallSize.width, ++i )
{
imshow( smallImages[ i ].push_back( cv::Mat( image, rect ).clone() );
cv::imshow( image_name[ i ], smallImages[ i ] );
}
waitKey( 0 );
Otherwise, you display every image in the same window, therefore, you only see the last one. By the way, don't forget the waitKey, otherwise, you won't see anything! (but I guess you already have it?)
4 | No.4 Revision |
You should used use a different name for each image:
char image_name[ 4 ][ 255 ] = { "image1", "image2", "image3", "image4" };
for( int y = 0, i = 0 ; y < image.rows ; y += smallSize.height )
for( int x = 0 ; x < image.cols ; x += smallSize.width, ++i )
{
smallImages[ i ].push_back( cv::Mat( image, rect ).clone() );
cv::imshow( image_name[ i ], smallImages[ i ] );
}
waitKey( 0 );
Otherwise, you display every image in the same window, therefore, you only see the last one. By the way, don't forget the waitKey, otherwise, you won't see anything! (but I guess you already have it?)
5 | No.5 Revision |
You should use a different name for each image:
char image_name[ 4 ][ 255 ] = { "image1", "image2", "image3", "image4" };
for( int y = 0, i = 0 ; y < image.rows ; y += smallSize.height )
for( int x = 0 ; x < image.cols ; x += smallSize.width, ++i )
{
smallImages[ i ].push_back( smallImages.push_back( cv::Mat( image, rect ).clone() );
cv::imshow( image_name[ i ], smallImages[ i ] );
}
waitKey( 0 );
Otherwise, you display every image in the same window, therefore, you only see the last one. By the way, don't forget the waitKey, otherwise, you won't see anything! (but I guess you already have it?)