Replies: 2 comments
-
| You could use  fn read_and_crop_image() -> Array2<u8> {
    let big_image: Array2<u8> = read_the_image();
    let cropped = big_image.slice_move(s![0..3000, 0..4000]);
    cropped
}You could also do something similar with  Another option is to copy the relevant portion, which may be beneficial if the original image is much larger than the cropped portion: fn read_and_crop_image() -> Array2<u8> {
    let big_image: Array2<u8> = read_the_image();
    let cropped = big_image.slice(s![0..3000, 0..4000]).to_owned();
    cropped
} | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            -
| Thank you! | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
Hi thanks for the lib! I want to own a part of array, just like what OpenCV does. Consider the (simplified) code:
However it errors, since ArrayView should not outlive the Array it belongs to. I have tried
ArcArraybut it does not seem to support.slice()as well.With OpenCV I can do:
Beta Was this translation helpful? Give feedback.
All reactions