{"provider_name":"Hatena Blog","author_name":"namaza","blog_url":"https://ytrewq.hatenablog.com/","width":"100%","categories":["\u5c0f\u30cd\u30bf"],"version":"1.0","author_url":"https://blog.hatena.ne.jp/namaza/","image_url":null,"title":"OpenCV\u3067\u753b\u50cf\u306e\u900f\u660e\u306a\u30d4\u30af\u30bb\u30eb\u306e\u5272\u5408\u3092\u8abf\u3079\u308b","provider_url":"https://hatena.blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fytrewq.hatenablog.com%2Fentry%2F2017%2F04%2F15%2F204713\" title=\"OpenCV\u3067\u753b\u50cf\u306e\u900f\u660e\u306a\u30d4\u30af\u30bb\u30eb\u306e\u5272\u5408\u3092\u8abf\u3079\u308b - \u96d1\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","type":"rich","blog_title":"\u96d1\u8a18","url":"https://ytrewq.hatenablog.com/entry/2017/04/15/204713","published":"2017-04-15 20:47:13","description":"\u5b8c\u5168\u306b\u900f\u660e\u306e\u90e8\u5206\u3057\u304b\u6e21\u305b\u307e\u305b\u3093\u3002 Python 2.7.10 # -*- coding:utf-8 -*-import cv2 #\u30a2\u30eb\u30d5\u30a1\u30c1\u30e3\u30cd\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u305f\u3081\u306bcv2.IMREAD_UNCHANGED\u3092\u6e21\u3059image = cv2.imread('exa.png',cv2.IMREAD_UNCHANGED)#countNonZero\u306f1\u30c1\u30e3\u30cd\u30eb\u306e\u753b\u50cf\u3057\u304b\u6e21\u305b\u306a\u3044\u306e\u3067\u3001\u30a2\u30eb\u30d5\u30a1\u30c1\u30e3\u30cd\u30eb\u306e\u307f\u53d6\u308a\u51fa\u3059transparentArray = cv2.split(image)[3]# == transparentArray = image[:,:,3]imageLen = image.shape[0] *\u2026","height":"190"}