{"id":135,"date":"2020-10-25T15:04:23","date_gmt":"2020-10-25T07:04:23","guid":{"rendered":"https:\/\/www.346pro.club\/?p=135"},"modified":"2022-03-24T23:37:07","modified_gmt":"2022-03-24T15:37:07","slug":"%e4%bf%ae%e6%94%b9opencv%e7%9a%84%e9%a2%9c%e8%89%b2%e8%bd%ac%e6%8d%a2%e6%ba%90%e7%a0%81","status":"publish","type":"post","link":"https:\/\/www.346pro.club\/?p=135","title":{"rendered":"\u4fee\u6539OpenCV\u7684\u989c\u8272\u8f6c\u6362\u6e90\u7801"},"content":{"rendered":"\n<p>\u8054\u52a8<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-\u4e0d\u4f1a\u53d6\u540d\u7684hoshinokun wp-block-embed-\u4e0d\u4f1a\u53d6\u540d\u7684hoshinokun\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"yx8990Oegj\"><a href=\"https:\/\/www.346pro.club\/?p=127\">OpenCV\u5728YUV420\u5904\u7406\u65f6\u7684\u95ee\u9898<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"\u300a OpenCV\u5728YUV420\u5904\u7406\u65f6\u7684\u95ee\u9898 \u300b\u2014\u4e0d\u4f1a\u53d6\u540d\u7684HoshinoKun\" src=\"https:\/\/www.346pro.club\/?p=127&#038;embed=true#?secret=RKurdf5qfV#?secret=yx8990Oegj\" data-secret=\"yx8990Oegj\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>\u8bb0\u5f55\u4e00\u4e0b\u81ea\u5df1\u627e\u989c\u8272\u8f6c\u6362\u51fd\u6570\u7684\u8fc7\u7a0b<\/p>\n\n\n\n<p>\u6700\u5f00\u59cb\u627e\u5230\u989c\u8272\u8f6c\u6362\u51fd\u6570<code>cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )<\/code>\u662f\u5728\u6587\u4ef6<code>modules\\imgproc\\src\\color.cpp<\/code>\uff0c\u76f8\u5173\u90e8\u5206\u4ee3\u7801\u5982\u4e0b<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">        case COLOR_RGB2YUV_YV12: case COLOR_BGR2YUV_YV12: case COLOR_RGBA2YUV_YV12: case COLOR_BGRA2YUV_YV12:\n        case COLOR_RGB2YUV_IYUV: case COLOR_BGR2YUV_IYUV: case COLOR_RGBA2YUV_IYUV: case COLOR_BGRA2YUV_IYUV:\n            cvtColorBGR2ThreePlaneYUV(_src, _dst, swapBlue(code), uIndex(code));\n            break;<\/pre>\n\n\n\n<p>\u4e8e\u662f\u5728<code>modules\\imgproc\\src\\color_yuv.dispatch.cpp<\/code>\u627e\u5230\u51fd\u6570<code>cvtColorBGR2ThreePlaneYUV( InputArray _src, OutputArray _dst, bool swapb, int uidx)<\/code><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">void cvtColorBGR2ThreePlaneYUV( InputArray _src, OutputArray _dst, bool swapb, int uidx)\n{\n    CvtHelper&lt; Set&lt;3, 4>, Set&lt;1>, Set&lt;CV_8U>, TO_YUV > h(_src, _dst, 1);\n\n    hal::cvtBGRtoThreePlaneYUV(h.src.data, h.src.step, h.dst.data, h.dst.step, h.src.cols, h.src.rows,\n                               h.scn, swapb, uidx);\n}<\/pre>\n\n\n\n<p>\u5728\u540c\u6837\u7684\u6587\u4ef6\u4e0b\u9762\u627e\u5230\u51fd\u6570<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">void cvtBGRtoThreePlaneYUV(const uchar * src_data, size_t src_step,\n                           uchar * dst_data, size_t dst_step,\n                           int width, int height,\n                           int scn, bool swapBlue, int uIdx)\n{\n    CV_INSTRUMENT_REGION();\n\n    CALL_HAL(cvtBGRtoThreePlaneYUV, cv_hal_cvtBGRtoThreePlaneYUV, src_data, src_step, dst_data, dst_step, width, height, scn, swapBlue, uIdx);\n\n    CV_CPU_DISPATCH(cvtBGRtoThreePlaneYUV, (src_data, src_step, dst_data, dst_step, width, height, scn, swapBlue, uIdx),\n        CV_CPU_DISPATCH_MODES_ALL);\n}<\/pre>\n\n\n\n<p>\u597d\u5bb6\u4f19\u8fd9\u4e48\u591a\u5c42...\u7136\u540e\u5728<code>modules\\imgproc\\src\\hal_replacement.hpp<\/code>\u627e\u5230\u51fd\u6570\u5b9a\u4e49<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#define cv_hal_cvtBGRtoThreePlaneYUV hal_ni_cvtBGRtoThreePlaneYUV<\/pre>\n\n\n\n<p>\u8fd9\u662f\u4e00\u4e2a\u786c\u4ef6\u4ea4\u4e92\u7684hal\u51fd\u6570\uff0c\u6211\u4eec\u65e0\u6cd5\u5bf9\u5176\u8fdb\u884c\u4fee\u6539<\/p>\n\n\n\n<p>\u4e8e\u662f\u5728\u672c\u6587\u7ae0\u6240\u6307\u7684\u76ee\u6807\u9879\u76ee\u4e2d\uff0c\u6211\u91c7\u53d6\u4e86\u7ed5\u8fc7opencv\u7684\u786c\u4ef6\u51fd\u6570\uff0c\u91cd\u5199\u4e86\u989c\u8272\u8f6c\u6362\u4ee3\u7801\u90e8\u5206\u6765\u8fbe\u5230\u8fd9\u4e00\u76ee\u7684\u3002<\/p>\n\n\n\n<p>\u5177\u4f53\u7684\u6539\u5199\u6211\u653e\u5728\u4e86<a href=\"https:\/\/github.com\/hoshinohikari\/static-movie-generator\/tree\/rewrite\">GitHub\u9879\u76ee<\/a>\u4e2d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8054\u52a8 \u8bb0\u5f55\u4e00\u4e0b\u81ea\u5df1\u627e\u989c\u8272\u8f6c\u6362\u51fd\u6570\u7684\u8fc7\u7a0b \u6700\u5f00\u59cb\u627e\u5230&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/www.346pro.club\/?p=135\">Continue reading<span class=\"screen-reader-text\">\u4fee\u6539OpenCV\u7684\u989c\u8272\u8f6c\u6362\u6e90\u7801<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-135","post","type-post","status-publish","format-standard","hentry","category-technology","entry"],"_links":{"self":[{"href":"https:\/\/www.346pro.club\/index.php?rest_route=\/wp\/v2\/posts\/135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.346pro.club\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.346pro.club\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.346pro.club\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.346pro.club\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=135"}],"version-history":[{"count":0,"href":"https:\/\/www.346pro.club\/index.php?rest_route=\/wp\/v2\/posts\/135\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.346pro.club\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.346pro.club\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.346pro.club\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}