ee.Image.reduceConnectedComponents
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ใช้ตัวลดกับพิกเซลทั้งหมดภายใน "ออบเจ็กต์" แต่ละรายการ ระบบจะถือว่าพิกเซลเป็นของออบเจ็กต์หากพิกเซลเชื่อมต่อกัน (8 ทิศทาง) และมีค่าเดียวกันในแถบ "ป้ายกำกับ" โดยแถบป้ายกำกับจะใช้เพื่อระบุการเชื่อมต่อเท่านั้น ส่วนที่เหลือจะใช้เป็นอินพุตสำหรับตัวลด
การใช้งาน | การคืนสินค้า |
---|
Image.reduceConnectedComponents(reducer, labelBand, maxSize) | รูปภาพ |
อาร์กิวเมนต์ | ประเภท | รายละเอียด |
---|
ดังนี้ image | รูปภาพ | รูปภาพที่อินพุตเข้ามา |
reducer | ตัวลดตำแหน่ง | ตัวลดที่จะใช้กับพิกเซลภายในคอมโพเนนต์ที่เชื่อมต่อ |
labelBand | สตริง ค่าเริ่มต้น: null | ชื่อของแบนด์ที่จะใช้ในการตรวจหาการเชื่อมต่อ หากไม่ได้ระบุ ระบบจะใช้แถบแรก |
maxSize | จำนวนเต็ม ค่าเริ่มต้น: 256 | ขนาดของพื้นที่ใกล้เคียงที่ต้องพิจารณาเมื่อรวมค่า ระบบจะมาสก์ออบเจ็กต์ที่มีขนาดใหญ่กว่า maxSize ในมิติแนวนอนหรือแนวตั้ง เนื่องจากบางส่วนของออบเจ็กต์อาจอยู่นอกพื้นที่ใกล้เคียง |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003eReduces pixel values within connected regions (objects) of an image based on a user-provided reducer function.\u003c/p\u003e\n"],["\u003cp\u003eObjects are identified by contiguous pixels sharing the same value in a specified label band (defaults to the first band if not provided).\u003c/p\u003e\n"],["\u003cp\u003eThe reducer function receives all image bands except the label band as input and aggregates pixel values within each object.\u003c/p\u003e\n"],["\u003cp\u003eA \u003ccode\u003emaxSize\u003c/code\u003e parameter limits the size of objects considered for reduction, masking larger objects to avoid edge effects.\u003c/p\u003e\n"]]],[],null,["# ee.Image.reduceConnectedComponents\n\nApplies a reducer to all of the pixels inside of each 'object'. Pixels are considered to belong to an object if they are connected (8-way) and have the same value in the 'label' band. The label band is only used to identify the connectedness; the rest are provided as inputs to the reducer.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-------------------------------------------------------------------------|---------|\n| Image.reduceConnectedComponents`(reducer, `*labelBand* `, `*maxSize*`)` | Image |\n\n| Argument | Type | Details |\n|---------------|-----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `image` | Image | The input image. |\n| `reducer` | Reducer | The reducer to apply to pixels within the connected component. |\n| `labelBand` | String, default: null | The name of the band to use to detect connectedness. If unspecified, the first band is used. |\n| `maxSize` | Integer, default: 256 | Size of the neighborhood to consider when aggregating values. Any objects larger than maxSize in either the horizontal or vertical dimension will be masked, since portions of the object might be outside of the neighborhood. |"]]