Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/image.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDark Matter <darkmatter1932@gmail.com>2016-03-03 04:27:25 +0300
committerDark Matter <darkmatter1932@gmail.com>2016-03-03 04:27:25 +0300
commit8f3ea101eb20e32092bab0e9c15514d8fb27cc79 (patch)
tree7cb4f27d2293a4881519991037f8a921634e93cd /doc
parent8a0d406d0e00e7956eba2afe7d45b46afb7216d0 (diff)
Update simpletransform.md
Diffstat (limited to 'doc')
-rw-r--r--doc/simpletransform.md23
1 files changed, 21 insertions, 2 deletions
diff --git a/doc/simpletransform.md b/doc/simpletransform.md
index 2f5be1f..52b5341 100644
--- a/doc/simpletransform.md
+++ b/doc/simpletransform.md
@@ -6,8 +6,27 @@ like cropping, translation, scaling and rotation.
<a name="image.crop"></a>
### [res] image.crop([dst,] src, x1, y1, [x2, y2]) ###
Crops image `src` at coordinate `(x1, y1)` up to coordinate
-`(x2, y2)`. If `dst` is provided, it is used to store the output
-image. Otherwise, returns a new `res` Tensor.
+`(x2, y2)`. The coordinate indexing is zero-based and `(x2, y2)` is non-inclusive.
+If `dst` is provided, it is used to store the output
+image. Otherwise, returns a new `res` Tensor.
+
+```lua
+-- The indexing starts with 0 and 2 is non-inclusive coordinate.
+> require('image')
+> image.crop(torch.Tensor(3, 2, 2), 0, 0 , 2, 2) -- crop is a correct crop and the result is 3x2x2 tensor.
+(1,.,.) =
+ 0 0
+ 0 0
+
+(2,.,.) =
+ 0 0
+ 0 0
+
+(3,.,.) =
+ 0 0
+ 0 0
+[torch.DoubleTensor of size 3x2x2]
+```
### [res] image.crop([dst,] src, format, width, height) ###
Crops a `width x height` section of source image `src`. The argument