Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Display 4 images and save as in a table (opencv , C )

Hello,

The code will read an image and cut into 4 parts so 4 small images. My problem is to display 4 images and save in a table.

I can display only the last image but not all with imshow : imshow ( "smallImages", cv::Mat ( image , rect ));

Please help me and think you.

for  ( int y =  0 ; y < image . rows ; y += smallSize . height )
    {
        for  ( int x =  0 ; x < image  . cols ; x += smallSize . width )
        {
            cv :: Rect rect =   cv :: Rect ( x , y , smallSize . width , smallSize . height );
            smallImages . push_back ( cv :: Mat ( image  , rect ));
            imshow ( "smallImages", cv::Mat ( image , rect ));

        }
    }
click to hide/show revision 2
retagged

updated 2014-06-20 02:59:13 -0600

berak gravatar image

Display 4 images and save as in a table (opencv , C )

Hello,

The code will read an image and cut into 4 parts so 4 small images. My problem is to display 4 images and save in a table.

I can display only the last image but not all with imshow : imshow ( "smallImages", cv::Mat ( image , rect ));

Please help me and think you.

for  ( int y =  0 ; y < image . rows ; y += smallSize . height )
    {
        for  ( int x =  0 ; x < image  . cols ; x += smallSize . width )
        {
            cv :: Rect rect =   cv :: Rect ( x , y , smallSize . width , smallSize . height );
            smallImages . push_back ( cv :: Mat ( image  , rect ));
            imshow ( "smallImages", cv::Mat ( image , rect ));

        }
    }

Display 4 images and save as in a table (opencv , C C++ )

Hello,

The code will read an image and cut into 4 parts so 4 small images. My problem is to display 4 images and save in a table.

I can display only the last image but not all with imshow : imshow ( "smallImages", cv::Mat ( image , rect ));

Please help me and think you.

for  ( int y =  0 ; y < image . rows ; y += smallSize . height )
    {
        for  ( int x =  0 ; x < image  . cols ; x += smallSize . width )
        {
            cv :: Rect rect =   cv :: Rect ( x , y , smallSize . width , smallSize . height );
            smallImages . push_back ( cv :: Mat ( image  , rect ));
            imshow ( "smallImages", cv::Mat ( image , rect ));

        }
    }