Ask Your Question
-1

what is the fast way to cut image to half

asked 2019-01-20 05:39:29 -0600

updated 2019-01-20 08:52:18 -0600

i need to cut my image and now i am using crop of numpy like that a[a.shape[0] // 2:a.shape[0], :] , there is a faster function or faster processing way to cut the image ? thanks very much

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-01-20 08:58:58 -0600

berak gravatar image

updated 2019-01-20 09:00:36 -0600

there is a faster function or faster processing way to cut the image ?

no, there isn't.

that's a numpy "slice" (look it up, please).

no memory gets copied, both "halves" reference the original image's pixels, so that's as fast as it ever can be.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-01-20 05:39:29 -0600

Seen: 357 times

Last updated: Jan 20 '19