Skip to content
Advertisement

Tag: image

Is there a fast way to shuffle numpy image in segments?

I want to write a function that can take small images and return a permutation of them, block-wise. Basically I want to turn this: Into this: There was an excellent answer in Is there a function in Python that shuffle data by data blocks? that helped me write a solution. However for ~50,000 28×28 images this takes a long time

Image Type Error: OpenCV Python

I get an image type error when I run my code. I know HoughLinesP requires a grayscale image but when I try to convert the source image to grayscale I get the following error(1): error: (-215) depth == 0 || depth == 2 || depth == 5 in function cv::cvtColor If I run HoughLinesP without converting to grayscale I get

OpenCV Composting 2 images of differing size

I need to alpha-blend 2 images that are not the same size. I’ve managed to get them to composite by resizing to the same size, so I’ve got part of the logic: I’m wondering if I need to make a mask that is the same size as the larger image and then use that with my first image. If so,

Advertisement