diff --git a/docs/how-to-build/how-to-build.md b/docs/how-to-build/how-to-build.md index c558aa341..de75d810c 100644 --- a/docs/how-to-build/how-to-build.md +++ b/docs/how-to-build/how-to-build.md @@ -1,3 +1,11 @@ +### Git clone ncnn repo with submodule + +``` +$ git clone https://github.com/Tencent/ncnn.git +$ cd +$ git submodule update --init +``` + * [Build for Linux x86](#build-for-linux-x86) * [Build for Windows x64 using VS2017](#build-for-windows-x64-using-visual-studio-community-2017) * [Build for MacOSX](#build-for-macosx) diff --git a/docs/how-to-use-and-FAQ/efficient-roi-resize-rotate.md b/docs/how-to-use-and-FAQ/efficient-roi-resize-rotate.md index b237168c9..7aee8cf51 100644 --- a/docs/how-to-use-and-FAQ/efficient-roi-resize-rotate.md +++ b/docs/how-to-use-and-FAQ/efficient-roi-resize-rotate.md @@ -11,8 +11,7 @@ +-----im_w-----+ ``` ```cpp -const unsigned char* data = im.data + (y * im_w + x) * 3; -ncnn::Mat in = ncnn::Mat::from_pixels(data, ncnn::PIXEL_RGB, roiw, roih, im_w * 3); +ncnn::Mat in = ncnn::Mat::from_pixels_roi(im.data, ncnn::PIXEL_RGB, im_w, im_h, x, y, roiw, roih); ``` ### image roi crop + resize + convert to ncnn::Mat @@ -27,8 +26,7 @@ ncnn::Mat in = ncnn::Mat::from_pixels(data, ncnn::PIXEL_RGB, roiw, roih, im_w * +-----im_w-----+ target_w ``` ```cpp -const unsigned char* data = im.data + (y * im_w + x) * 3; -ncnn::Mat in = ncnn::Mat::from_pixels_resize(data, ncnn::PIXEL_RGB, roiw, roih, im_w * 3, target_w, target_h); +ncnn::Mat in = ncnn::Mat::from_pixels_roi_resize(im.data, ncnn::PIXEL_RGB, im_w, im_h, x, y, roiw, roih, target_w, target_h); ``` ### ncnn::Mat export image + offset paste