Select to view content in your preferred language

ScannedMapDigitizer smd.create_mask giving black outputs

334
0
02-10-2023 10:59 AM
AveryDurham
New Contributor

I'm trying to run arcgis.learn code to digitize a scanned map. So far, no matter the parameters I set, the binary mask output is all blank with every pixel having a [0,0,0] RBG value. The zoneColors are the exact values for red that is found in the input image. The other three variables I don't know as much about so I expect the error is in there somewhere.

Here is my code: 

zoneColors = (234, 26, 26)
colorRange = 10
kSize = [3, 3]
kType = "rect"
 
smd.create_mask(color_list = zoneColors, color_delta = colorRange, kernel_size = kSize, kernel_type = kType, show_result = True)

 

Here is the output:

AveryDurham_0-1676055475731.png

 

When I run the code with similar parameters to create the template image it seems to create a binary raster just fine.

AveryDurham_0-1676057055210.png

 

Any idea on what I need to do to actually get a binary mask?

I'm using python 3.7.11 and running the code in Visual Studio.

 

 

EDIT: I found that what I needed was to have double brackets around the colors variable.

[[236, 24, 24]]

0 Kudos
0 Replies