pub struct BboxAnswer { /* private fields */ }Expand description
The answer to a Bbox: the edges of the region, from 0 to 1.
Each edge is a fraction of the width or the height of the image, as the API gives it. The API
rounds each edge to 0.01. It serializes as
{"left": l, "top": t, "right": r, "bottom": b, "confidence": c}.
Implementations§
Source§impl BboxAnswer
impl BboxAnswer
Sourcepub fn into_question(self) -> Bbox
pub fn into_question(self) -> Bbox
Returns the question of the answer, with its values, so that code can ask it again.
Sourcepub fn confidence(&self) -> f64
pub fn confidence(&self) -> f64
Returns the confidence of the API in the region, from 0 to 1.
Sourcepub fn to_pixels(&self, image: &Image) -> PixelBox
pub fn to_pixels(&self, image: &Image) -> PixelBox
Returns the region in the pixels of the original of image.
image must be the image that the API saw. The original is the image that the caller
gave. Thus the region is correct also for a crop, and for an image that the image feature
scaled. Each edge rounds to the nearest pixel. right and bottom are the first pixels
after the region.
Trait Implementations§
Source§impl Clone for BboxAnswer
impl Clone for BboxAnswer
Source§impl Debug for BboxAnswer
impl Debug for BboxAnswer
Auto Trait Implementations§
impl Forget for BboxAnswer
impl Freeze for BboxAnswer
impl Move for BboxAnswer
impl RefUnwindSafe for BboxAnswer
impl Send for BboxAnswer
impl Sync for BboxAnswer
impl Unpin for BboxAnswer
impl UnsafeUnpin for BboxAnswer
impl UnwindSafe for BboxAnswer
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