Browse Source

update doc

tags/20200916
nihui 5 years ago
parent
commit
c954bd742b
2 changed files with 10 additions and 4 deletions
  1. +8
    -0
      docs/how-to-build/how-to-build.md
  2. +2
    -4
      docs/how-to-use-and-FAQ/efficient-roi-resize-rotate.md

+ 8
- 0
docs/how-to-build/how-to-build.md View File

@@ -1,3 +1,11 @@
### Git clone ncnn repo with submodule

```
$ git clone https://github.com/Tencent/ncnn.git
$ cd <ncnn-root-dir>
$ 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)


+ 2
- 4
docs/how-to-use-and-FAQ/efficient-roi-resize-rotate.md View File

@@ -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


Loading…
Cancel
Save