{"id":1447,"date":"2012-12-08T00:00:04","date_gmt":"2012-12-07T15:00:04","guid":{"rendered":"http:\/\/www.atinfinity.info\/blog\/?p=1447"},"modified":"2014-10-16T21:15:40","modified_gmt":"2014-10-16T12:15:40","slug":"nativeviewer%e3%81%ae%e4%bd%bf%e3%81%84%e6%96%b9","status":"publish","type":"post","link":"http:\/\/www.atinfinity.info\/blog\/archives\/1447","title":{"rendered":"NativeViewer\u306e\u4f7f\u3044\u65b9"},"content":{"rendered":"<p>\u3053\u306e\u8a18\u4e8b\u306f<a href=\"http:\/\/partake.in\/events\/13622c9b-3ada-4dd8-a967-56fe8927541b\" title=\"Computer Vision Advent Calendar 2012\" target=\"_blank\">Computer Vision Advent Calendar 2012<\/a>\u306e12\/8\u306e\u8a18\u4e8b\u517c<a href=\"https:\/\/twitter.com\/sakanazensen\" title=\"@sakanazensen\" target=\"_blank\">@sakanazensen<\/a>\u3055\u3093\u3078\u306e\u8a95\u751f\u65e5\u30d7\u30ec\u30bc\u30f3\u30c8\u3068\u3057\u3066\u66f8\u3044\u305f\u3082\u306e\u3067\u3059\uff0e<\/p>\n<p>\u3064\u3044\u6700\u8fd1\uff0cOpenCV\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30c7\u30d0\u30c3\u30b0\u4e2d\u306bMat\u306e\u4e2d\u8eab\u3092\u30d7\u30ec\u30d3\u30e5\u30fc\u3067\u304d\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u300c<a href=\"http:\/\/sourceforge.net\/projects\/nativeviewer\/\" title=\"NativeViewer\" target=\"_blank\">NativeViewer<\/a>\u300d\u306ev1.0\u304c\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u307e\u3057\u305f\uff0e\u3053\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u4f7f\u3044\u65b9\u306b\u3064\u3044\u3066\u89e3\u8aac\u8a18\u4e8b\u306e\u8981\u671b\u304c\u3042\u3063\u305f\u306e\u3067<del datetime=\"2012-12-06T13:05:03+00:00\">\uff0830\u5206\u304f\u3089\u3044\u3067\u3066\u304d\u3068\u30fc\u306b\uff09<\/del>\u66f8\u3044\u3066\u307f\u307e\u3057\u305f\uff0e\u57fa\u672c\u7684\u306b\u516c\u5f0f\u306e<a href=\"http:\/\/sourceforge.net\/p\/nativeviewer\/wiki\/QuickStartGuide\/\" title=\"QuickStartGuide\" target=\"_blank\">QuickStartGuide<\/a>\u3068\u307b\u307c\u540c\u3058\u5185\u5bb9\u3067\u3059\uff0e<\/p>\n<p>\u4ee5\u964d\u306e\u8aac\u660e\u306fVisual Studio 2012\u3092\u4f7f\u3063\u3066\u8aac\u660e\u3057\u307e\u3059\uff08Visual Studio 2010\u7248\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3082\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\uff09\uff0e<br \/>\n<font color=\"#ff0000\"><strong>\u203b\u6ce8\u610f\uff1aVisual Studio Professional\u4ee5\u4e0a\u306e\u30a8\u30c7\u30a3\u30b7\u30e7\u30f3\u3067\u3057\u304b\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u4f7f\u3048\u306a\u3044\u3088\u3046\u3067\u3059\uff0e<\/strong><\/font><\/p>\n<p><strong>\u25a0\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/strong><br \/>\n<a href=\"http:\/\/sourceforge.net\/projects\/nativeviewer\/files\/VisualStudio2012\/\" title=\"\u914d\u5e03\u30da\u30fc\u30b8\" target=\"_blank\">\u914d\u5e03\u30da\u30fc\u30b8<\/a>\u304b\u3089<strong>NativeViewer_VS2012_v1.0.0.vsix<\/strong>\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059\uff0e<\/p>\n<p><strong>\u25a0\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/strong><br \/>\n\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f<strong>NativeViewer_VS2012_v1.0.0.vsix<\/strong>\u3092\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u307e\u3059\uff0e\u3053\u3053\u3067<strong>\u300c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u300d<\/strong>\u30dc\u30bf\u30f3\u3092\u62bc\u3059\u3068\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5b8c\u4e86\u3067\u3059\uff0e<\/p>\n<tbody>\n<tr>\n<td><img loading=\"lazy\" title=\"\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\" src=\"http:\/\/www.atinfinity.info\/img\/opencv\/NativeViewer\/NativeViewer01.png\" alt=\"\" width=\"450\" height=\"375\" \/><\/td>\n<\/tr>\n<\/tbody>\n<p><strong>\u25a0\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/strong><br \/>\n\u306a\u3093\u3066\u3053\u3068\u3082\u306a\u30442\u5024\u5316\u306e\u30b5\u30f3\u30d7\u30eb\u3067\u3059\uff0e\u3053\u306e\u30b5\u30f3\u30d7\u30eb\u3092\u7528\u3044\u3066\u4f7f\u3044\u65b9\u306e\u8aac\u660e\u3092\u884c\u3044\u307e\u3059\uff0e<\/p>\n<pre class=\"lang:c++ decode:true \" >#include &lt;iostream&gt;\r\n#include &lt;opencv2\/core\/core.hpp&gt;\r\n#include &lt;opencv2\/imgproc\/imgproc.hpp&gt;\r\n#include &lt;opencv2\/highgui\/highgui.hpp&gt;\r\n\r\nusing namespace cv;\r\nusing namespace std;\r\n\r\n#ifdef _DEBUG\r\n#pragma comment(lib, \"opencv_core243d.lib\")\r\n#pragma comment(lib, \"opencv_imgproc243d.lib\")\r\n#pragma comment(lib, \"opencv_highgui243d.lib\")\r\n#else\r\n#pragma comment(lib, \"opencv_core243.lib\")\r\n#pragma comment(lib, \"opencv_imgproc243.lib\")\r\n#pragma comment(lib, \"opencv_highgui243.lib\")\r\n#endif\r\n\r\nint main( int argc, char** argv)\r\n{\r\n\tMat image;\r\n\tMat gray;\r\n\tMat bin;\r\n\r\n\t\/\/(1)\u753b\u50cf\u8aad\u307f\u8fbc\u307f\r\n\timage = imread(argv[1], 1);\r\n\r\n\t\/\/(2)\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u5316\r\n\tcvtColor(image, gray, CV_BGR2GRAY);\r\n\r\n\t\/\/(3)2\u5024\u5316\r\n\tthreshold(gray, bin, 100, 255, THRESH_BINARY);\r\n\r\n\t\/\/(4)2\u5024\u5316\u753b\u50cf\u306e\u8868\u793a\r\n\tnamedWindow(\"bin\", 1);\r\n\timshow(\"bin\", bin);\r\n\twaitKey(0);\r\n\treturn 0;\r\n}<\/pre>\n<p><strong>\u25a0\u5b9f\u969b\u306b\u4f7f\u3063\u3066\u307f\u308b<\/strong><br \/>\n\u3053\u306e\u4f8b\u3067\u306f2\u5024\u5316\u7d50\u679c\u3092\u30a6\u30a3\u30f3\u30c9\u30a6\u306b\u63cf\u753b\u3057\u3066\u3044\u307e\u3059\u304c\uff0c\u30c7\u30d0\u30c3\u30b0\u306e\u6642\u306b2\u5024\u5316\u306e\u524d\u306e\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u304c\u6b63\u3057\u3044\u7d50\u679c\u306a\u306e\u304b\u77e5\u308a\u305f\u3044\u3088\u3046\u306a\u5834\u5408\u3082\u3042\u3063\u3066\uff0c\u5f93\u6765\u306f\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u7528\u306bnamedWindow\u3068imshow\u3092\u8ffd\u52a0\u3057\uff0c\u30ea\u30d3\u30eb\u30c9\u30fb\u518d\u5b9f\u884c\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3057\u305f\uff0e\u5730\u5473\u306b\u9762\u5012\u304f\u3055\u3044\u3067\u3059\u3002\u3002\u3002\u3053\u306e\u4f8b\u3067\u306f\u30ea\u30d3\u30eb\u30c9\u3057\u3066\u3082\u305d\u3093\u306a\u306b\u6642\u9593\u306f\u304b\u304b\u308a\u307e\u305b\u3093\u304c\u305d\u308c\u306a\u308a\u306e\u898f\u6a21\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3060\u3068\u30d3\u30eb\u30c9\u6642\u9593\u304c\u3082\u3063\u305f\u3044\u306a\u3044\u3067\u3059\uff0e<\/p>\n<p>NativeViewer\u3092\u4f7f\u3046\u3068\u30c7\u30d0\u30c3\u30b0\u7528\u306b\u65b0\u305f\u306bnamedWindow\u3068imshow\u3092\u8ffd\u52a0\u3057\u3066\u30ea\u30d3\u30eb\u30c9\u3059\u308b\u3068\u3044\u3063\u305f\u9762\u5012\u306a\u4f5c\u696d\u304b\u3089\u89e3\u653e\u3055\u308c\u307e\u3059\uff0e\u3084\u308b\u306e\u306f<font color=\"#ff0000\"><strong>\u30c7\u30d0\u30c3\u30b0\u4e2d\u306bCtrl\u30ad\u30fc\u3092\u62bc\u3057\u306a\u304c\u3089\u30d7\u30ec\u30d3\u30e5\u30fc\u3057\u305f\u3044Mat\u30af\u30e9\u30b9\u306e\u5909\u6570\u306b\u30de\u30a6\u30b9\u30ab\u30fc\u30bd\u30eb\u3092\u5408\u308f\u305b\u308b\u3060\u3051<\/strong><\/font>\u3067\u3059\uff0e<\/p>\n<tbody>\n<tr>\n<td><img loading=\"lazy\" title=\"\u30c7\u30d0\u30c3\u30b0\" src=\"http:\/\/www.atinfinity.info\/img\/opencv\/NativeViewer\/NativeViewer02.png\" alt=\"\" width=\"433\" height=\"482\" \/><\/td>\n<\/tr>\n<\/tbody>\n<p>\u3053\u3053\u3067\u306f\u30c7\u30d0\u30c3\u30b0\u4e2d\u306bCtrl\u30ad\u30fc\u3092\u62bc\u3057\u306a\u304c\u3089\u300cgray\u300d\u3068\u3044\u3046\u5909\u6570\u306b\u30de\u30a6\u30b9\u30ab\u30fc\u30bd\u30eb\u3092\u5408\u308f\u305b\u3066\u307f\u307e\u3059\uff0e\u3059\u308b\u3068\uff0c\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30d7\u30ec\u30d3\u30e5\u30fc\u753b\u9762\u304c\u8868\u793a\u3055\u308c\uff0cgray\u306e\u63cf\u753b\u5185\u5bb9\u3092\u8996\u899a\u7684\u306b\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff0e\u30c7\u30d0\u30c3\u30b0\u6642\u306b\u3068\u3066\u3082\u4fbf\u5229\u306a\u306e\u3067Visual Studio\u4f7f\u3044\u306b\u306f\u30aa\u30b9\u30b9\u30e1\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u3059\uff01<\/p>\n<tbody>\n<tr>\n<td><img loading=\"lazy\" title=\"\u30d7\u30ec\u30d3\u30e5\u30fc\" src=\"http:\/\/www.atinfinity.info\/img\/opencv\/NativeViewer\/NativeViewer03.png\" alt=\"\" width=\"496\" height=\"541\" \/><\/td>\n<\/tr>\n<\/tbody>\n<p><strong>\u25a0\u30aa\u30d7\u30b7\u30e7\u30f3<\/strong><br \/>\n\u307e\u305f\uff0cVisual Studio\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u753b\u9762\u304b\u3089NativeViewer\u306b\u95a2\u3059\u308b\u30ec\u30a4\u30a2\u30a6\u30c8\u7b49\u306e\u8a2d\u5b9a\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff0e<\/p>\n<tbody>\n<tr>\n<td><img loading=\"lazy\" title=\"\u30aa\u30d7\u30b7\u30e7\u30f3\" src=\"http:\/\/www.atinfinity.info\/img\/opencv\/NativeViewer\/NativeViewer04.png\" alt=\"\" width=\"757\" height=\"441\" \/><\/td>\n<\/tr>\n<\/tbody>\n<p><strong>\u25a0\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/strong><br \/>\n<strong>\u300c\u62e1\u5f35\u6a5f\u80fd\u3068\u66f4\u65b0\u30d7\u30ed\u30b0\u30e9\u30e0\u300d<\/strong>\u753b\u9762\u304b\u3089<strong>\u300cNativeViewer\u300d<\/strong>\u3092\u9078\u629e\u3057\u3066\uff0c<strong>\u300c\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u300d<\/strong>\u30dc\u30bf\u30f3\u3092\u62bc\u3059\u3053\u3068\u3067\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff0e<\/p>\n<tbody>\n<tr>\n<td><img loading=\"lazy\" title=\"\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\" src=\"http:\/\/www.atinfinity.info\/img\/opencv\/NativeViewer\/NativeViewer05.png\" alt=\"\" width=\"600\" height=\"413\" \/><\/td>\n<\/tr>\n<\/tbody>\n<p><strong>\u25a0\u4f59\u8ac7<\/strong><br \/>\n12\/22\u3042\u305f\u308a\u306b<a href=\"http:\/\/partake.in\/events\/13622c9b-3ada-4dd8-a967-56fe8927541b\" title=\"Computer Vision Advent Calendar 2012\" target=\"_blank\">Computer Vision Advent Calendar 2012<\/a>\u5411\u3051\u306e\u5225\u306e\u8a18\u4e8b\u516c\u958b\u4e88\u5b9a\u3067\u3059\uff08\u4ed6\u4eba\u4e8b\uff09\uff0e\u904e\u5ea6\u306a\u671f\u5f85\u306f\u305b\u305a\u306b\u304a\u5f85\u3061\u304f\u3060\u3055\u3044\u3002\u3002\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u306e\u8a18\u4e8b\u306fComputer Vision Advent Calendar 2012\u306e12\/8\u306e\u8a18\u4e8b\u517c@sakanazensen\u3055\u3093\u3078\u306e\u8a95\u751f\u65e5\u30d7\u30ec\u30bc\u30f3\u30c8\u3068\u3057\u3066\u66f8\u3044\u305f\u3082\u306e\u3067\u3059\uff0e \u3064\u3044\u6700\u8fd1\uff0cOpenCV\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30c7\u30d0\u30c3\u30b0\u4e2d\u306b &hellip; <a href=\"http:\/\/www.atinfinity.info\/blog\/archives\/1447\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a>&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[22,6],"tags":[],"_links":{"self":[{"href":"http:\/\/www.atinfinity.info\/blog\/wp-json\/wp\/v2\/posts\/1447"}],"collection":[{"href":"http:\/\/www.atinfinity.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.atinfinity.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.atinfinity.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.atinfinity.info\/blog\/wp-json\/wp\/v2\/comments?post=1447"}],"version-history":[{"count":68,"href":"http:\/\/www.atinfinity.info\/blog\/wp-json\/wp\/v2\/posts\/1447\/revisions"}],"predecessor-version":[{"id":1674,"href":"http:\/\/www.atinfinity.info\/blog\/wp-json\/wp\/v2\/posts\/1447\/revisions\/1674"}],"wp:attachment":[{"href":"http:\/\/www.atinfinity.info\/blog\/wp-json\/wp\/v2\/media?parent=1447"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.atinfinity.info\/blog\/wp-json\/wp\/v2\/categories?post=1447"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.atinfinity.info\/blog\/wp-json\/wp\/v2\/tags?post=1447"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}