Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

copy small image in big image

i try to copy a small image stored in a Mat to a bigger image stored in a Mat. but i always end with a black big image. here is my code: JAVA

no1.copyTo(sudokuGrid.submat(new Rect(60 ,60 ,no1.width(), no1.height())));

copy small image in big image

i try to copy a small image stored in a Mat to a bigger image stored in a Mat. but i always end with a black big image. here is my code: JAVA

no1.copyTo(sudokuGrid.submat(new Rect(60 ,60 ,no1.width(), no1.height())));

Edit: When i use the code in C it works fine

small_image.copyTo(big_image(cv::Rect(x,y,small_image.cols, small_image.rows)));

copy small image in big image

i try to copy a small image stored in a Mat to a bigger image stored in a Mat. but i always end with a black big image. here is my code: JAVA

Mat no1 = Highgui.imread(Environment.getExternalStorageDirectory().getPath() + "/Pictures/no1.jpg");
Mat sudokuGrid = Highgui.imread(Environment.getExternalStorageDirectory().getPath() + "/Pictures/emptysudoku.jpg");
no1.copyTo(sudokuGrid.submat(new Rect(60 ,60 ,no1.width(), no1.height())));

Edit: When i use the code in C it works fine

small_image.copyTo(big_image(cv::Rect(x,y,small_image.cols, small_image.rows)));