[−][src]Struct darknet::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]
B: Borrow<BBox>,
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]
&self
) -> Result<ImageBuffer<P, Vec<P::Subpixel>>, Error> where
P: Pixel + 'static,
P::Subpixel: 'static,
P::Subpixel: ConvertSubpixel,
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.
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Image
[src]
impl Drop for Image
[src]
impl<'a> From<&'a DynamicImage> for Image
[src]
fn from(from: &'a DynamicImage) -> Self
[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]
P: Pixel + 'static,
P::Subpixel: 'static,
Container: Deref<Target = [P::Subpixel]>,
P::Subpixel: ConvertSubpixel,
fn from(buffer: &ImageBuffer<P, Container>) -> Self
[src]
impl From<DynamicImage> for Image
[src]
fn from(from: DynamicImage) -> Self
[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]
P: Pixel + 'static,
P::Subpixel: 'static,
Container: Deref<Target = [P::Subpixel]>,
P::Subpixel: ConvertSubpixel,
fn from(buffer: ImageBuffer<P, Container>) -> Self
[src]
impl<'a> IntoCowImage<'a> for Image
[src]
fn into_cow_image(self) -> Cow<'a, Image>
[src]
impl<'a> IntoCowImage<'a> for &'a Image
[src]
fn into_cow_image(self) -> Cow<'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]
P: Pixel + 'static,
P::Subpixel: 'static,
P::Subpixel: ConvertSubpixel,
type Error = Error
The type returned in the event of a conversion error.
fn try_from(from: &Image) -> Result<Self, Self::Error>
[src]
impl<P> TryFrom<Image> for ImageBuffer<P, Vec<P::Subpixel>> where
P: Pixel + 'static,
P::Subpixel: 'static,
P::Subpixel: ConvertSubpixel,
[src]
P: Pixel + 'static,
P::Subpixel: 'static,
P::Subpixel: ConvertSubpixel,
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,