poisson-image-editing icon indicating copy to clipboard operation
poisson-image-editing copied to clipboard

Unable to handle target images of bigger size (in MB)

Open Hiteshsaai opened this issue 4 years ago • 2 comments

I am trying to scrape a part of one image and mask it in another image to check its capability of blending, , but it failed to mask the image due to memory allocation error, is there any way to pull this off for bigger size images ?? below i am attaching the error from CLI.

Please move the object to desired location to apparate.

Blending ... Traceback (most recent call last): File "main.py", line 82, in poisson_blend_result = poisson_edit(source, target, target_mask, offset) File "C:\Users\i29140\Documents\poisson-image-editing\poisson_image_editing.py", line 56, in poisson_edit mat_A = laplacian_matrix(y_range, x_range) File "C:\Users\i29140\Documents\poisson-image-editing\poisson_image_editing.py", line 25, in laplacian_matrix mat_A = scipy.sparse.block_diag([mat_D] * n).tolil() File "C:\Program Files (x86)\Python37-32\lib\site-packages\scipy\sparse\construct.py", line 677, in block_diag return bmat(rows, format=format, dtype=dtype) File "C:\Program Files (x86)\Python37-32\lib\site-packages\scipy\sparse\construct.py", line 608, in bmat data = np.empty(nnz, dtype=dtype) MemoryError: Unable to allocate 363. MiB for an array with shape (47610792,) and data type float64

Hiteshsaai avatar May 18 '20 22:05 Hiteshsaai

@PPPW can you help me with the issue

Hiteshsaai avatar Jul 07 '20 16:07 Hiteshsaai

Try to resize all images to 600 height. It works.

Siddharth1698 avatar Mar 09 '22 18:03 Siddharth1698