pub struct ImageBase<T, C>where
C: ColourModel,
T: Data,{
pub data: ArrayBase<T, Ix3>,
/* private fields */
}
Expand description
Basic structure containing an image.
Fields§
§data: ArrayBase<T, Ix3>
Images are always going to be 3D to handle rows, columns and colour channels
This should allow for max compatibility with maths ops in ndarray.
Caution should be taken if performing any operations that change the
number of channels in an image as this may cause other functionality to
perform incorrectly. Use conversions to one of the Generic
colour models
instead.
Implementations§
Source§impl<T, U, C> ImageBase<U, C>where
U: Data<Elem = T>,
T: Copy + Clone + FromPrimitive + Num + NumCast + PixelBound,
C: ColourModel,
impl<T, U, C> ImageBase<U, C>where
U: Data<Elem = T>,
T: Copy + Clone + FromPrimitive + Num + NumCast + PixelBound,
C: ColourModel,
Source§impl<T, U, C> ImageBase<T, C>where
T: Data<Elem = U>,
C: ColourModel,
impl<T, U, C> ImageBase<T, C>where
T: Data<Elem = U>,
C: ColourModel,
Sourcepub fn pixel(&self, row: usize, col: usize) -> ArrayView<'_, U, Ix1>
pub fn pixel(&self, row: usize, col: usize) -> ArrayView<'_, U, Ix1>
Get a view of all colour channels at a pixels location
pub fn into_type_raw<C2>(self) -> ImageBase<T, C2>where
C2: ColourModel,
Trait Implementations§
Source§impl<T, U, C> CannyEdgeDetectorExt<T> for ImageBase<U, C>where
U: DataMut<Elem = T>,
T: Copy + Clone + FromPrimitive + Real + Num + NumAssignOps,
C: ColourModel,
impl<T, U, C> CannyEdgeDetectorExt<T> for ImageBase<U, C>where
U: DataMut<Elem = T>,
T: Copy + Clone + FromPrimitive + Real + Num + NumAssignOps,
C: ColourModel,
Source§type Output = ImageBase<OwnedRepr<bool>, C>
type Output = ImageBase<OwnedRepr<bool>, C>
Output type, this is different as canny outputs a binary image
Source§fn canny_edge_detector(
&self,
params: CannyParameters<T>,
) -> Result<Self::Output, Error>
fn canny_edge_detector( &self, params: CannyParameters<T>, ) -> Result<Self::Output, Error>
Run the edge detection algorithm with the given parameters. Due to Canny
being specified as working on greyscale images all current implementations
assume a single channel image returning an error otherwise.
Source§impl<T, U, C> ConvolutionExt<T> for ImageBase<U, C>
impl<T, U, C> ConvolutionExt<T> for ImageBase<U, C>
Source§type Output = ImageBase<OwnedRepr<T>, C>
type Output = ImageBase<OwnedRepr<T>, C>
Type for the output as data will have to be allocated
Source§fn conv2d<B: Data<Elem = T>>(
&self,
kernel: ArrayBase<B, Ix3>,
) -> Result<Self::Output, Error>
fn conv2d<B: Data<Elem = T>>( &self, kernel: ArrayBase<B, Ix3>, ) -> Result<Self::Output, Error>
Perform a convolution returning the resultant data
applies the default padding of zero padding
Source§fn conv2d_inplace<B: Data<Elem = T>>(
&mut self,
kernel: ArrayBase<B, Ix3>,
) -> Result<(), Error>
fn conv2d_inplace<B: Data<Elem = T>>( &mut self, kernel: ArrayBase<B, Ix3>, ) -> Result<(), Error>
Performs the convolution inplace mutating the containers data
applies the default padding of zero padding
Source§fn conv2d_with_padding<B: Data<Elem = T>>(
&self,
kernel: ArrayBase<B, Ix3>,
strategy: &impl PaddingStrategy<T>,
) -> Result<Self::Output, Error>
fn conv2d_with_padding<B: Data<Elem = T>>( &self, kernel: ArrayBase<B, Ix3>, strategy: &impl PaddingStrategy<T>, ) -> Result<Self::Output, Error>
Perform a convolution returning the resultant data
applies the default padding of zero padding
Source§fn conv2d_inplace_with_padding<B: Data<Elem = T>>(
&mut self,
kernel: ArrayBase<B, Ix3>,
strategy: &impl PaddingStrategy<T>,
) -> Result<(), Error>
fn conv2d_inplace_with_padding<B: Data<Elem = T>>( &mut self, kernel: ArrayBase<B, Ix3>, strategy: &impl PaddingStrategy<T>, ) -> Result<(), Error>
Performs the convolution inplace mutating the containers data
applies the default padding of zero padding
Source§impl<T, U> From<ImageBase<U, CIEXYZ>> for Image<T, RGB>where
U: Data<Elem = T>,
T: Copy + Clone + FromPrimitive + Num + NumAssignOps + NumCast + PartialOrd + Display + PixelBound,
impl<T, U> From<ImageBase<U, CIEXYZ>> for Image<T, RGB>where
U: Data<Elem = T>,
T: Copy + Clone + FromPrimitive + Num + NumAssignOps + NumCast + PartialOrd + Display + PixelBound,
Source§impl<T, U> From<ImageBase<U, Gray>> for Image<T, RGB>where
U: Data<Elem = T>,
T: Copy + Clone + FromPrimitive + Num + NumAssignOps + NumCast + PartialOrd + Display + PixelBound,
impl<T, U> From<ImageBase<U, Gray>> for Image<T, RGB>where
U: Data<Elem = T>,
T: Copy + Clone + FromPrimitive + Num + NumAssignOps + NumCast + PartialOrd + Display + PixelBound,
Source§impl<T, U> From<ImageBase<U, HSV>> for Image<T, RGB>where
U: Data<Elem = T>,
T: Copy + Clone + FromPrimitive + Num + NumAssignOps + NumCast + PartialOrd + Display + PixelBound,
impl<T, U> From<ImageBase<U, HSV>> for Image<T, RGB>where
U: Data<Elem = T>,
T: Copy + Clone + FromPrimitive + Num + NumAssignOps + NumCast + PartialOrd + Display + PixelBound,
Source§impl<T, U> From<ImageBase<U, RGB>> for Image<T, CIEXYZ>where
U: Data<Elem = T>,
T: Copy + Clone + FromPrimitive + Num + NumAssignOps + NumCast + PartialOrd + Display + PixelBound,
impl<T, U> From<ImageBase<U, RGB>> for Image<T, CIEXYZ>where
U: Data<Elem = T>,
T: Copy + Clone + FromPrimitive + Num + NumAssignOps + NumCast + PartialOrd + Display + PixelBound,
Source§impl<T, U> From<ImageBase<U, RGB>> for Image<T, Gray>where
U: Data<Elem = T>,
T: Copy + Clone + FromPrimitive + Num + NumAssignOps + NumCast + PartialOrd + Display + PixelBound,
impl<T, U> From<ImageBase<U, RGB>> for Image<T, Gray>where
U: Data<Elem = T>,
T: Copy + Clone + FromPrimitive + Num + NumAssignOps + NumCast + PartialOrd + Display + PixelBound,
Source§impl<U, T> From<ImageBase<U, RGB>> for Image<T, HSV>where
U: Data<Elem = T>,
T: Copy + Clone + FromPrimitive + Num + NumAssignOps + NumCast + PartialOrd + Display + PixelBound,
impl<U, T> From<ImageBase<U, RGB>> for Image<T, HSV>where
U: Data<Elem = T>,
T: Copy + Clone + FromPrimitive + Num + NumAssignOps + NumCast + PartialOrd + Display + PixelBound,
Source§impl<T, U, C> HistogramEqExt<T> for ImageBase<U, C>where
U: DataMut<Elem = T>,
T: Copy + Clone + Ord + Num + NumAssignOps + ToPrimitive + FromPrimitive + PixelBound,
C: ColourModel,
impl<T, U, C> HistogramEqExt<T> for ImageBase<U, C>where
U: DataMut<Elem = T>,
T: Copy + Clone + Ord + Num + NumAssignOps + ToPrimitive + FromPrimitive + PixelBound,
C: ColourModel,
type Output = ImageBase<OwnedRepr<T>, C>
Source§fn equalise_hist(&self, grid: Grid<T>) -> Self::Output
fn equalise_hist(&self, grid: Grid<T>) -> Self::Output
Equalises an image histogram returning a new image.
Grids should be for a 1xN image as the image is flattened during processing
Source§fn equalise_hist_inplace(&mut self, grid: Grid<T>)
fn equalise_hist_inplace(&mut self, grid: Grid<T>)
Equalises an image histogram inplace
Grids should be for a 1xN image as the image is flattened during processing
Source§impl<T, U, C> MedianFilterExt for ImageBase<U, C>
impl<T, U, C> MedianFilterExt for ImageBase<U, C>
Source§impl<U, C> MorphologyExt for ImageBase<U, C>
impl<U, C> MorphologyExt for ImageBase<U, C>
type Output = ImageBase<OwnedRepr<bool>, C>
fn erode(&self, kernel: ArrayView2<'_, bool>) -> Self::Output
fn erode_inplace(&mut self, kernel: ArrayView2<'_, bool>)
fn dilate(&self, kernel: ArrayView2<'_, bool>) -> Self::Output
fn dilate_inplace(&mut self, kernel: ArrayView2<'_, bool>)
fn union(&self, other: &Self) -> Self::Output
fn union_inplace(&mut self, other: &Self)
fn intersection(&self, other: &Self) -> Self::Output
fn intersection_inplace(&mut self, other: &Self)
Source§impl<T, U, C> PaddingExt<T> for ImageBase<U, C>
impl<T, U, C> PaddingExt<T> for ImageBase<U, C>
Source§impl<T, U, C> SobelExt for ImageBase<U, C>where
U: DataMut<Elem = T>,
T: Copy + Clone + Num + NumAssignOps + Neg<Output = T> + FromPrimitive + Real,
C: ColourModel,
impl<T, U, C> SobelExt for ImageBase<U, C>where
U: DataMut<Elem = T>,
T: Copy + Clone + Num + NumAssignOps + Neg<Output = T> + FromPrimitive + Real,
C: ColourModel,
Source§impl<T, U, C> ThresholdApplyExt<T> for ImageBase<U, C>where
U: Data<Elem = T>,
Image<U, C>: Clone,
T: Copy + Clone + Ord + Num + NumAssignOps + ToPrimitive + FromPrimitive + PixelBound,
C: ColourModel,
impl<T, U, C> ThresholdApplyExt<T> for ImageBase<U, C>where
U: Data<Elem = T>,
Image<U, C>: Clone,
T: Copy + Clone + Ord + Num + NumAssignOps + ToPrimitive + FromPrimitive + PixelBound,
C: ColourModel,
Source§impl<T, U, C> ThresholdMeanExt<T> for ImageBase<U, C>where
U: Data<Elem = T>,
Image<U, C>: Clone,
T: Copy + Clone + Ord + Num + NumAssignOps + ToPrimitive + FromPrimitive + PixelBound,
C: ColourModel,
impl<T, U, C> ThresholdMeanExt<T> for ImageBase<U, C>where
U: Data<Elem = T>,
Image<U, C>: Clone,
T: Copy + Clone + Ord + Num + NumAssignOps + ToPrimitive + FromPrimitive + PixelBound,
C: ColourModel,
Source§impl<T, U, C> ThresholdOtsuExt<T> for ImageBase<U, C>where
U: Data<Elem = T>,
Image<U, C>: Clone,
T: Copy + Clone + Ord + Num + NumAssignOps + ToPrimitive + FromPrimitive + PixelBound,
C: ColourModel,
impl<T, U, C> ThresholdOtsuExt<T> for ImageBase<U, C>where
U: Data<Elem = T>,
Image<U, C>: Clone,
T: Copy + Clone + Ord + Num + NumAssignOps + ToPrimitive + FromPrimitive + PixelBound,
C: ColourModel,
Source§impl<T, U, C, V> TransformExt<V> for ImageBase<U, C>
impl<T, U, C, V> TransformExt<V> for ImageBase<U, C>
Auto Trait Implementations§
impl<T, C> Freeze for ImageBase<T, C>where
T: Freeze,
impl<T, C> RefUnwindSafe for ImageBase<T, C>
impl<T, C> Send for ImageBase<T, C>
impl<T, C> Sync for ImageBase<T, C>
impl<T, C> Unpin for ImageBase<T, C>
impl<T, C> UnwindSafe for ImageBase<T, C>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more