[][src]Struct darknet::Image

pub struct Image {
    pub image: image,
}

The image type used by darknet.

Fields

image: image

Implementations

impl Image[src]

pub fn zeros(w: usize, h: usize, c: usize) -> Image[src]

Returns an image filled with zeros.

pub fn open<P: AsRef<Path>>(filename: P) -> Result<Self, Error>[src]

Open image from a file.

pub fn resize(&self, w: usize, h: usize) -> Self[src]

Resize the image without keeping the ratio.

pub fn letter_box(&self, w: usize, h: usize) -> Self[src]

Resize the image while keeping the ratio.

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

Crop a bounding box from the image.

pub unsafe 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 a slice.

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

Returns pixel values as a mutable slice.

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

Get the image width.

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

Get the image height.

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

Get the image channels.

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

Get the image shape tuple (channels, height, width).

pub fn to_image_buffer<P>(
    &self
) -> Result<ImageBuffer<P, Vec<P::Subpixel>>, Error> where
    P: Pixel + 'static,
    P::Subpixel: 'static,
    P::Subpixel: ConvertSubpixel, 
[src]

Convert Image to ImageBuffer from 'image' crate

Trait Implementations

impl Clone for Image[src]

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

Make a deep-copy of the image.

impl Debug for Image[src]

impl Drop for Image[src]

impl<'a> From<&'a DynamicImage> for Image[src]

impl<'a, P, Container> From<&'a ImageBuffer<P, Container>> for Image where
    P: Pixel + 'static,
    P::Subpixel: 'static,
    Container: Deref<Target = [P::Subpixel]>,
    P::Subpixel: ConvertSubpixel, 
[src]

impl From<DynamicImage> for Image[src]

impl<P, Container> From<ImageBuffer<P, Container>> for Image where
    P: Pixel + 'static,
    P::Subpixel: 'static,
    Container: Deref<Target = [P::Subpixel]>,
    P::Subpixel: ConvertSubpixel, 
[src]

impl<'a> IntoCowImage<'a> for Image[src]

impl<'a> IntoCowImage<'a> for &'a Image[src]

impl Send for Image[src]

impl<'_, P> TryFrom<&'_ Image> for ImageBuffer<P, Vec<P::Subpixel>> where
    P: Pixel + 'static,
    P::Subpixel: 'static,
    P::Subpixel: ConvertSubpixel, 
[src]

type Error = Error

The type returned in the event of a conversion error.

impl<P> TryFrom<Image> for ImageBuffer<P, Vec<P::Subpixel>> where
    P: Pixel + 'static,
    P::Subpixel: 'static,
    P::Subpixel: ConvertSubpixel, 
[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe 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.