Questions tagged [mask]
An image mask is a bitmap that specifies an area to paint, but not the color. In effect, an image mask acts as a stencil to specify where to place color on the page. Quartz uses the current fill color to paint an image mask.
2,696
questions
0
votes
0
answers
11
views
How do I use convert_alpha to give a mask pixel perfect collision? [duplicate]
So here's my code, stripped down just to include the relevant parts:
import pygame
pygame.init()
display_surface = pygame.display.set_mode((1300, 1000))
levelimage = pygame.Surface.convert_alpha(...
-1
votes
1
answer
39
views
Phone mask depending on URL
Using a script to enter a phone number by mask. Here is the part of the code that does this:
let t = $("input[type=tel]");
$.each(t, function() {
$(this).mask("+38 (000) 000-00-00&...
0
votes
1
answer
35
views
How can I make a mask for a rect?
Can I make a mask of a rect, if so, how? I'm trying to make collisions between a mask and a rect, and since I can't make a rect of a mask(No pixel perfect collision then) I figured I'd ask if I could ...
2
votes
2
answers
42
views
How to modify image in custom Tensorflow layer? (working example provided)
How can I draw a filled rectangle as a custom (data augmentation) layer in Tensorflow 2 on Python 3?
Input
Expected output
With image_pil = Image.fromarray(image), I get the error:
AttributeError: ...
0
votes
1
answer
41
views
How to mask a tensor's time steps prior to event boolean
I have time-series data in the form of [batch_size, horizon, feature]. Events occur every so often, and I demarcate them in a separate "meta" tensor as a boolean flag. i.e., it's a tensor of ...
2
votes
1
answer
32
views
Split matrices into smaller blocks and do something based on its values
I have a numpy array ys_big_seg which has the following shape: (146, 128, 128). It contains pixel masks which values can be 0 or 1. 1 if the pixel is in a given category otherwise 0. I have to scale ...
0
votes
0
answers
13
views
Comparing masks with binary & and have the number of differences in JS
export enum VALUES {
VALUE1 = 0x0001,
VALUE2 = 0x0002,
VALUE3 = 0x0004,
VALUE4 = 0x0008,
VALUE5 = 0x0010,
VALUE6 = 0x0020,
VALUE7 = 0x0040,
VALUE8 = 0x0080,
VALUE9 = 0x0100
}
In JS ...
0
votes
1
answer
56
views
+50
Applying an iterable mask, checking it against a value - if value doesn't satisfy the mask condition, move to the next value which does
I currently have some code where I've created a mask which checks to see if a variable matches the first position in a sequence, called index_pos_overload. If it matches, the variable is chosen, and ...
0
votes
2
answers
47
views
Why isn't the 'mask' class working in my Bootstrap 5 project?
The latest Bootstrap 5 is giving a tough time in adding class="mask" to my background image. It doesn't even work at all.
<head>
<link href="https://cdn.jsdelivr.net/npm/...
0
votes
0
answers
39
views
How can I get the value correctly with split?
I'm trying to get the value entered by the user and whenever he changes this redeemed value is also changed, but when I put a small value: R$5.00
nothing happens,
is only accepting high value: 400.00 ...
1
vote
2
answers
55
views
Merge two NumPy arrays into one
Say I have the following two arrays, a and b:
import numpy as np
a = np.array([[[1, 0],
[1, 1]],
[[1, 0],
[0, 0]],
[[0, 0],
[1, 0]]])
...
0
votes
0
answers
12
views
I'm having an error in my COCO JSON file when I start training my RCNN model TypeError: coordinate list must contain at least 2 coordinates
[1][my json file look like this {"id": 1049, "dataset_id": 34, "category_ids": [], "path": "/datasets/son/Dental (other) - 199.jpg", "width":...
1
vote
1
answer
32
views
Checking if points fall into shapefile (polygons and points are in different unit)
I'm trying to create a mask following this question's answer, so that I can color areas inside my shape file only. I will post the code example here (which is pretty much the same with the code in my ...
1
vote
2
answers
37
views
Drop rows where column duplicate and and other column null
Seeking to drop rows where col1 is duplicate and col2 is null, but only when both conditions are met.
Therefore, where col1 is duplicate and col2 is not null, row should not be dropped.
d = {'col1': ['...
1
vote
1
answer
50
views
Mask NumPy array and extract values where condition is met
How can I mask two NumPy arrays properly? I want find pe values that are not equal to 255, for example. I also want my desired output array be the same size aspd and pe, i.e., (7, 7) and filled with 0'...
-1
votes
0
answers
33
views
How can I filter the rows of a dataframe from a mask with two conditions?
I have this mask:
filter= (data2.query("price=='Nan' and surface_covered_in_m2=='Nan' and surface_total_in_m2== 'NaN' "))
And I want to delete all the rows of the dataset that meet that ...
0
votes
1
answer
34
views
HTML, Javascript Canvas image and make transparent with alpha mask image
I am new with canvas in html, I have two images first one is a normal jpeg image and the second is the same edited with alpha (black and white) so the thing is I want to make the first transparent ...
0
votes
0
answers
74
views
How can I "mask" a particle effect using unity mask component
Image component can be masked as expected, but it doesn't work when it comes to particles.
Problem
I have tried changing stencil id to be the same as the id shown in mask component in my particle ...
0
votes
1
answer
22
views
Mask Image with disappearing text
I want to have a background and a mask which lie on top of each other. So the visitor has an impression of an normal background image. But when the visitor scrolls down the text/navbar is sticky and ...
1
vote
1
answer
243
views
Remove uneven vertical and horizontal lines from an image using cv2 Python
The objective is to remove uneven vertical and horizontal lines from an images using cv2 Python.
Currently, I am using these two code block to remove the horizontal and vertical lines.
Remove vertical ...
0
votes
0
answers
47
views
CSS mask not working when used files from local computer
I have some problem with CSS mask-image property. Here is link for working code:
https://codepen.io/Nacho20/pen/MWQrPRy . Ok, but when I try to use images for masking from local computer it stops ...
1
vote
1
answer
81
views
How do I fill up mask holes in OpenCV?
I'm using a clothing dataset for some tasks and I need to create a black and white mask of the clothing items. I'm using this code to achieve the below:
img = cv2.imread(filepath, 0)
#img_gray = cv2....
2
votes
0
answers
24
views
How can I make this sprite cull at the nearest wall?
Im working on a build-engine style unity game, and something regarding my explosion sprites has really been bugging me. My map is split into several pieces for both occlusion culling and my method for ...
0
votes
1
answer
75
views
Masked out large irregular shape from image with Python
The objective is to remove large irregular area and maintained only character in the image.
For example, given the following
and the expected masked output
I have the impression this can be achieved ...
0
votes
0
answers
24
views
Fill area between two overlapping shapes
I am trying to convert a binary mask consisting of two lines to a mask that consists of the area between the two lines.
However I am stuck and don't have an idea on how to move forward.
Here is an ...
0
votes
0
answers
46
views
resize mask without changing the size of a polygon within the mask
I am trying to resize a polygon within a mask while keeping the size of mask same with opencv.
I have created a mask with mask = np.zeros_like(img).
I have created a polygon with points with polyfill ...
0
votes
0
answers
18
views
how to exactly according to the 2D binary mask slice number and read the same slice from the patient's 3D data
have a nice time
I wanted to edit a piece of code.
My medical data has a nifti format and includes three-dimensional 3D MRI data and my two-dimensional binary mask.
I have 20 different patients, each ...
0
votes
0
answers
14
views
The use of masks in image classification tasks
I am working on an image classification problem and the dataset comes in the following format :
class_1_folder : consists of images_folder and mask_folder
class_2_folder : consists of images_folder ...
0
votes
0
answers
31
views
How to send a binary mask file from C++ CGI
I'm trying to send a mask file from CGI get request.
I have no compilation errors. But have a error 500 error with Apache2. i'm not shure how to send the data and co-pilot do not help a lot.
But if i ...
0
votes
0
answers
20
views
html/css: svg or png cant replicate masking even with simple copy paste example
Was originally trying to get a .svg to mask a div. After spending a few hours trying to apply related examples I couldn't get it working.
Have been gradually working back to the most basic example of ...
0
votes
0
answers
16
views
Alternative to matplotlib.path.contains_points to mask an array from a vector of coordinates
I have a template array filled with NaNs that I want to mask. To create the mask, I have boundary points that were created through QGIS, they represent borders of glaciers (https://github.com/...
-1
votes
1
answer
43
views
How do I calculate the mean of values with the same label given by a mask for multi-dimensional data?
My input x is a tensor of [B, C, H, W] dim. B is batch size, C number of channels, H height and W width. I have a mask m of [H, W] dim. For each batch size and each channel I want to use the mask m to ...
0
votes
1
answer
53
views
Fabric.js create dynamic image mask
I want to mask the original image using alpha mask image. I can do alpha masking on image with the following code. But I want to be able to edit the mask with the brush, how can I do that?
In theory ...
1
vote
0
answers
51
views
dice coefficient and dice loss very low in UNET segmentation
I'm doing binary segmentation using UNET. My dataset is composed of images and masks. I divided the images and masks into different folders ( train_images, train_masks, val_images and val_masks). Then ...
0
votes
0
answers
20
views
Mask name in logstash
hi guys, is there any solution to mask the name in logstash string message?
I didn't find any solution on the internet and in any elasticsearch topic or document, has anyone tried this?
0
votes
2
answers
50
views
How to extend mask region (True) by 1 or 2 pixels?
I have a numpy mask of True and False values, detecting black regions in an image.
I want to extend the True regions by 1 or 2 pixel.
For example, considering this mask:
[[False False False False ...
0
votes
0
answers
22
views
ValueError: shape mismatch: with same shape (need work around)
I tried to simplify the problem as much as possible for reproducing purposes, sorry for the inconvenience.
report_groups = pd.Series((('<2', '<2'), ('<2', '2'), ('<2', '3'), ('<2', '4≤')...
0
votes
1
answer
58
views
Python - Pandas mapping error: Reindexing only valid with uniquely valued Index objects
I am working on a function which is meant to map an ID from one dataframe to another based on one of two fields (Ticker or CUSIP). The main df is a custodian file which has the fields below:
Ticker
...
0
votes
0
answers
27
views
Probabilistic Atlas in Advanced Normalization Tools (ANTs)
thanks for reading.
I´m new in the world of neuroimaging, where I want to quantify certain structures in the brain (Locus coeruleus), using ANTS and a Probabilistic Atlas of the Human Locus Coeruleu (...
0
votes
2
answers
85
views
How to mask all characters except last 3 characters on a string display only
Hi I am working in Angular and in one of the field which is phone number ,I want to mask the string on HTML view only except the last 3 characters. How can I do that ?
Example: - 1212121212 as ...
0
votes
1
answer
76
views
How can i detect circles with color
I want to find red circles. I used opencv2, Simple Blob Detector. When i apply mask on a photo it can't find circles. It has no error messages, it just can't find any circles.
This is what i get -> ...
0
votes
0
answers
11
views
Initialising weight-dependant masks
I have read through "Are Neural Nets Modular? Inspecting Functional Modularity Through Differentiable Weight Masks", R Csordas et Al, (2021) and am having trouble understanding how the ...
0
votes
1
answer
31
views
Numpy where function over second dimension of Array
I have an Array X with the dimension DxN and an Array Y with dimension 1xN. Y only contains 1's and -1's. Now I want a new Array with every element of X for which Y has a 1. I know I have to use a np....
0
votes
0
answers
217
views
How to implement text mask in MUI Textfield
So I want to implement a mask to my mui Textfields for price and credit card number, but idk how. For example I want the price texfield to start with "$", and the card number to be separated ...
1
vote
1
answer
57
views
pygame - mask collision not working, return always same collision point
I'm trying to create a pixel-perfect collision but if I try to print the collision value I always get collision on point (8, 0). this is my code, thank you.
collisionsroom1 = pygame.image.load("...
0
votes
1
answer
22
views
Replace all non-intersecting values with 0, between two numpy arrays
Say I have a multi-dimensional array, for example:
a = array([[[86, 27],
[26, 59]],
[[ 1, 16],
[46, 5]],
[[71, 85],
[ 6, 71]]])
And say I have a one-dimensional array (b), with ...
1
vote
1
answer
110
views
How to automatically take a '/' (slash) in input field using reactJS
How can I format an input to place a slash before the value that the user enters, so that the user cannot delete it because it is already formatted that way. I'm trying to add functionality to input /...
1
vote
1
answer
51
views
css rotate introduces outline when using SVG clip-path or mask
Is there a way to stop this outline in firefox?
#blob { background: red; width: 500px; height: 500px; clip-path: url(#myClip); transform: rotate(20deg);}
<div id="blob"></div>
<svg&...
0
votes
0
answers
54
views
Mask TextField Cuba Platform
I have an input field where I need to apply a mask so that the input is in the format of a fractional value with two decimal places. The graphic component was created on Vaadin. I try use MaskField, ...
0
votes
0
answers
42
views
Trying to make mask overlap but not working properly [duplicate]
Hi im tryin to make simulator for parking with use of genetic alghorythm, and from the begining im having trouble with colliding with mask i dont what im doing wrong but my track mask and car mask are ...