用python计算图像面积_地图图像中屋顶面积的计算

这篇博客介绍如何使用Python来分析图像,特别是针对Google Maps静态图像,应用边缘检测算法来计算特定地址的屋顶面积。通过geocoding获取坐标,然后使用ndimage和scikit-image库进行图像处理。
摘要由CSDN通过智能技术生成

我是一个R用户,在使用Python进行图像分析时遇到了问题。什么是计算图像中心建筑物面积的有效方法?其目标是将边缘算法应用于googlemaps静态图像,并计算地址屋顶的表面积。在from pygeocoder import Geocoder

import urllib

import numpy as np

from scipy import ndimage

from skimage import filter, io, measure

import matplotlib.pyplot as plt

def getMap(address):

"""Geocode address and retreive image centered

around lat/long"""

results = Geocoder.geocode(address)

lat, lng = results[0].coordinates

zip_code = results[0].postal_code

map_url = 'https://maps.googleapis.com/maps/api/staticmap?center={0},{1}&size=640x640&zoom=19&sensor=false&maptype=roadmap&&style=visibility:simplified|gamma:0.1'

request_url = map_url.format(lat, lng)

req = urllib.urlopen(request_url)

return(req)

def

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值