I have an application where I trained a model using Mask-R CNN to identify windows and doors in images of houses. The model predicts objects in unseen images online and on these predictions we try to fit new designs of windows and doors using a custom built front end. To fit new designs onto the ..
I’ve been trying long and hard to figure out how to apply circle mask to an image I have. I’ve looked at this and this as well as many others to no avail. Each of them ask me to add a circular mask. The code that I use is similar to below: offset = 0 ..
for example: say I have x = np.array[[‘positive’,’a’],[‘negative’,’b’],[‘positive’,’c’], [‘negative’,’d’]] and I want a new array with the value v = [[‘positive’,’a’], [‘positive’,’c’]] How could this be done? Thank you your time! Source: Python..
I have a raster image with some values are nan and these are supposed to be filled by the valid values. These valid values should meet two conditions: within a certain distance to the target pixel, and are flagged as true in an input FlagMask. The rasterio.fill.fillnodata https://rasterio.readthedocs.io/en/latest/api/rasterio.fill.html can achieve filling nodata with the distance ..
Im trying to make a collision detection system for a game im making. This section of code works fine when I am detecting collisions when the objects are smaller, but now once I make a mask of a moon which can be up to 1000 pixels in diameter it starts to lag my computer. Ive ..
I need help with the mask parameter to apply the keypoint detection to a specific region of interest. How can I define the region with x/y ranges in a np.array? import numpy as np import cv2 as cv img = cv.imread(‘test_img.jpg’) gray = cv.cvtColor(img,cv.COLOR_BGR2GRAY) gray2 = np.float32(gray) print(img.shape) max_corners = 20 quality_level = 8 / ..
Most efficient way to mask a 4D Boolean array with a 2D Boolean mask. I tried two methods: A. Reshape mask to 4D and mask B. Reshape mask to 4D and product two matrixes import numpy as np import time I = 150 J = 2000 K = I S = 25 matrix_to_mask = np.random.choice(a=[True, ..
I have two images, one is a binary dicom/nifti and one is an original dicom/nifti, how I can mask binary on the original and get masked output from the original image. figure 1 is binary, figure 2 is original and figure 3 is the output sample that i need.enter image description here enter image description ..
I had the same problem as this question since 2J, but none of the answers worked with Python 3, so today I took all day to solve the problem: python opencv cv2 matchTemplate with transparency (graphics taken from the question) I finally managed to write a cv2.matchTemplate() with mask (transparency / alpha channel) and python ..
I have this image: I want to get the contours of every unique (none-zero) value, so basically this output: [array([[1, 1], [3, 2], [3, 1]], dtype=int32), array([[4, 2], [4, 3], [5, 3], [5, 2]], dtype=int32), array([[2, 4], [3, 4]], dtype=int32)] I can achieve this by converting the image into binary mask and then using cv2‘s ..