Say I have a multi-dimensional array, for example: And say I have a one-dimensional array (b), with some values which may be seen in my multi-dimensional array (a): Now I want to replace all of the non-intersecting values in array a with zero. I want to get the following result: How could I achieve this? I tried several ways of
Tag: mask
Vectorized approach to masking red and blue channels in an image
I am trying to change all the red and blue pixels in an image to black to have only green pixels (based on certain conditions). To do this right now I am using multiple for loops and the process, although it works, is extremely slow. The code I have so far – Is there any way I can vectorize this
mask and apply numpy where function to a vector in c++
I’m using C++ and want to combine the masking of a vector and the search for the indexes where a condition is verified, similarly to the numpy where function. Here’s an example: After using masked should look like this: masked = {62, 62, 70, 65} Afterwards, I want to find the indexes where id vector elements are greater than masked
Training MaskRCNN on custom data issue
I am trying to train Mask RCNN on a custom dataset of floorplans. I am following this article on Medium to do this: https://medium.com/analytics-vidhya/a-simple-guide-to-maskrcnn-custom-dataset-implementation-27f7eab381f2 . After having some issues with annotation formats and packages I got around to training the model. However, I stumbled upon the following error code: I could not find anything about this error and was hoping
Pygame collision with masks
I have made a putt-putt game and now I want to add a slanted wall type. Because of this, I need to use masks for the collision (until now I have just used rects). I have spent hours learning about masks and trying to figure out why my code won’t work. There are no errors, the collision just isn’t detected.