[][src]Struct darknet::Image

pub struct Image {
    pub image: image,
}

Fields

image: image

Methods

impl Image[src]

pub fn empty(w: i32, h: i32) -> Image[src]

Returns empty RGB image.

pub fn from_image_buffer_rgb(buffer: &RgbImage) -> Image[src]

Construct image from given RgbImage.

pub fn open<P: AsRef<Path> + ?Sized>(filename: &P) -> ImageResult<Image>[src]

Open image from file.

pub fn to_image_buffer_rgb(&self) -> RgbImage[src]

Convert image copy to RgbImage.

pub fn save<P: AsRef<Path> + ?Sized>(&self, path: &P) -> ImageResult<()>[src]

Save image to file.

pub fn resize(&mut self, w: usize, h: usize)[src]

Resize image (uses letterbox_image internally).

pub fn show(&self, name: &str) -> i32[src]

Show image if darknet library was compiled with OpenCV or save image as 'name'.jpg

pub fn crop_bbox(&self, bbox: &BBox) -> Image[src]

Crop bbox from image.

pub fn get_raw_data(&self) -> *mut f32[src]

Returns pointer to raw image data.

pub fn get_data<'a>(&'a self) -> &'a [f32][src]

Returns pixel values as slice.

pub fn get_w(&self) -> usize[src]

Image width

pub fn get_h(&self) -> usize[src]

Image height

pub fn get_wf(&self) -> f32[src]

pub fn get_hf(&self) -> f32[src]

Trait Implementations

impl Clone for Image[src]

fn clone(&self) -> Image[src]

Full copy of image

impl Drop for Image[src]

Auto Trait Implementations

impl RefUnwindSafe for Image

impl !Send for Image

impl !Sync for Image

impl Unpin for Image

impl UnwindSafe for Image

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SetParameter for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.