本文整理汇总了Python中SimpleCV.Image.embiggen方法的典型用法代码示例。如果您正苦于以下问题:Python Image.embiggen方法的具体用法?Python Image.embiggen怎么用?Python Image.embiggen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleCV.Image
的用法示例。
在下文中一共展示了Image.embiggen方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: query_blob
# 需要导入模块: from SimpleCV import Image [as 别名]
# 或者: from SimpleCV.Image import embiggen [as 别名]
def query_blob(id):
blob = Image("static\\img\\%d.jpg" % id).crop(
int(request.form["x"]), int(request.form["y"]), int(request.form["width"]), int(request.form["height"])
)
if blob and "SK_MODEL" in app.config:
if blob.height > blob.width:
blob = blob.resize(h=app.config["PATCH_SIZE"])
else:
blob = blob.resize(w=app.config["PATCH_SIZE"])
blob = blob.embiggen((app.config["PATCH_SIZE"], app.config["PATCH_SIZE"]))
np_img = blob.getGrayNumpy().transpose().reshape(-1)
pred = labels.inverse_transform(sk_model.predict(np_img))[0]
return jsonify(prediction=pred)
else:
return jsonify(prediction="")
示例2: Image
# 需要导入模块: from SimpleCV import Image [as 别名]
# 或者: from SimpleCV.Image import embiggen [as 别名]
from SimpleCV import Image, Color
import time
img = Image('ladies.jpg')
#print img.size()
# Embiggen the image, put it on a green background, in the upper right
emb = img.embiggen((560, 400), Color.GREEN, (0, 0))
emb.show()
time.sleep(10)