Struct opencv::xfeatures2d::LATCH
source · pub struct LATCH { /* private fields */ }
Expand description
latch Class for computing the LATCH descriptor. If you find this code useful, please add a reference to the following paper in your work: Gil Levi and Tal Hassner, “LATCH: Learned Arrangements of Three Patch Codes”, arXiv preprint arXiv:1501.03719, 15 Jan. 2015
LATCH is a binary descriptor based on learned comparisons of triplets of image patches.
- bytes is the size of the descriptor - can be 64, 32, 16, 8, 4, 2 or 1
- rotationInvariance - whether or not the descriptor should compansate for orientation changes.
- half_ssd_size - the size of half of the mini-patches size. For example, if we would like to compare triplets of patches of size 7x7x then the half_ssd_size should be (7-1)/2 = 3.
- sigma - sigma value for GaussianBlur smoothing of the source image. Source image will be used without smoothing in case sigma value is 0.
Note: the descriptor can be coupled with any keypoint extractor. The only demand is that if you use set rotationInvariance = True then you will have to use an extractor which estimates the patch orientation (in degrees). Examples for such extractors are ORB and SIFT.
Note: a complete example can be found under /samples/cpp/tutorial_code/xfeatures2D/latch_match.cpp
Implementations§
source§impl LATCH
impl LATCH
sourcepub fn create(
bytes: i32,
rotation_invariance: bool,
half_ssd_size: i32,
sigma: f64
) -> Result<Ptr<LATCH>>
pub fn create( bytes: i32, rotation_invariance: bool, half_ssd_size: i32, sigma: f64 ) -> Result<Ptr<LATCH>>
§C++ default parameters
- bytes: 32
- rotation_invariance: true
- half_ssd_size: 3
- sigma: 2.0
sourcepub fn create_def() -> Result<Ptr<LATCH>>
pub fn create_def() -> Result<Ptr<LATCH>>
§Note
This alternative version of LATCH::create function uses the following default values for its arguments:
- bytes: 32
- rotation_invariance: true
- half_ssd_size: 3
- sigma: 2.0
Trait Implementations§
source§impl AlgorithmTrait for LATCH
impl AlgorithmTrait for LATCH
source§impl AlgorithmTraitConst for LATCH
impl AlgorithmTraitConst for LATCH
fn as_raw_Algorithm(&self) -> *const c_void
source§fn write(&self, fs: &mut impl FileStorageTrait) -> Result<()>
fn write(&self, fs: &mut impl FileStorageTrait) -> Result<()>
source§fn write_1(&self, fs: &mut impl FileStorageTrait, name: &str) -> Result<()>
fn write_1(&self, fs: &mut impl FileStorageTrait, name: &str) -> Result<()>
source§fn write_with_name(&self, fs: &Ptr<FileStorage>, name: &str) -> Result<()>
fn write_with_name(&self, fs: &Ptr<FileStorage>, name: &str) -> Result<()>
source§fn write_with_name_def(&self, fs: &Ptr<FileStorage>) -> Result<()>
fn write_with_name_def(&self, fs: &Ptr<FileStorage>) -> Result<()>
§Note
source§fn empty(&self) -> Result<bool>
fn empty(&self) -> Result<bool>
source§fn save(&self, filename: &str) -> Result<()>
fn save(&self, filename: &str) -> Result<()>
source§fn get_default_name(&self) -> Result<String>
fn get_default_name(&self) -> Result<String>
source§impl Boxed for LATCH
impl Boxed for LATCH
source§unsafe fn from_raw(ptr: <LATCH as OpenCVFromExtern>::ExternReceive) -> Self
unsafe fn from_raw(ptr: <LATCH as OpenCVFromExtern>::ExternReceive) -> Self
source§fn into_raw(self) -> <LATCH as OpenCVTypeExternContainer>::ExternSendMut
fn into_raw(self) -> <LATCH as OpenCVTypeExternContainer>::ExternSendMut
source§fn as_raw(&self) -> <LATCH as OpenCVTypeExternContainer>::ExternSend
fn as_raw(&self) -> <LATCH as OpenCVTypeExternContainer>::ExternSend
source§fn as_raw_mut(&mut self) -> <LATCH as OpenCVTypeExternContainer>::ExternSendMut
fn as_raw_mut(&mut self) -> <LATCH as OpenCVTypeExternContainer>::ExternSendMut
source§impl Feature2DTrait for LATCH
impl Feature2DTrait for LATCH
fn as_raw_mut_Feature2D(&mut self) -> *mut c_void
source§fn detect(
&mut self,
image: &impl ToInputArray,
keypoints: &mut Vector<KeyPoint>,
mask: &impl ToInputArray
) -> Result<()>
fn detect( &mut self, image: &impl ToInputArray, keypoints: &mut Vector<KeyPoint>, mask: &impl ToInputArray ) -> Result<()>
source§fn detect_def(
&mut self,
image: &impl ToInputArray,
keypoints: &mut Vector<KeyPoint>
) -> Result<()>
fn detect_def( &mut self, image: &impl ToInputArray, keypoints: &mut Vector<KeyPoint> ) -> Result<()>
source§fn detect_multiple(
&mut self,
images: &impl ToInputArray,
keypoints: &mut Vector<Vector<KeyPoint>>,
masks: &impl ToInputArray
) -> Result<()>
fn detect_multiple( &mut self, images: &impl ToInputArray, keypoints: &mut Vector<Vector<KeyPoint>>, masks: &impl ToInputArray ) -> Result<()>
source§fn detect_multiple_def(
&mut self,
images: &impl ToInputArray,
keypoints: &mut Vector<Vector<KeyPoint>>
) -> Result<()>
fn detect_multiple_def( &mut self, images: &impl ToInputArray, keypoints: &mut Vector<Vector<KeyPoint>> ) -> Result<()>
source§fn compute(
&mut self,
image: &impl ToInputArray,
keypoints: &mut Vector<KeyPoint>,
descriptors: &mut impl ToOutputArray
) -> Result<()>
fn compute( &mut self, image: &impl ToInputArray, keypoints: &mut Vector<KeyPoint>, descriptors: &mut impl ToOutputArray ) -> Result<()>
source§fn compute_multiple(
&mut self,
images: &impl ToInputArray,
keypoints: &mut Vector<Vector<KeyPoint>>,
descriptors: &mut impl ToOutputArray
) -> Result<()>
fn compute_multiple( &mut self, images: &impl ToInputArray, keypoints: &mut Vector<Vector<KeyPoint>>, descriptors: &mut impl ToOutputArray ) -> Result<()>
source§fn detect_and_compute(
&mut self,
image: &impl ToInputArray,
mask: &impl ToInputArray,
keypoints: &mut Vector<KeyPoint>,
descriptors: &mut impl ToOutputArray,
use_provided_keypoints: bool
) -> Result<()>
fn detect_and_compute( &mut self, image: &impl ToInputArray, mask: &impl ToInputArray, keypoints: &mut Vector<KeyPoint>, descriptors: &mut impl ToOutputArray, use_provided_keypoints: bool ) -> Result<()>
source§fn detect_and_compute_def(
&mut self,
image: &impl ToInputArray,
mask: &impl ToInputArray,
keypoints: &mut Vector<KeyPoint>,
descriptors: &mut impl ToOutputArray
) -> Result<()>
fn detect_and_compute_def( &mut self, image: &impl ToInputArray, mask: &impl ToInputArray, keypoints: &mut Vector<KeyPoint>, descriptors: &mut impl ToOutputArray ) -> Result<()>
fn read(&mut self, file_name: &str) -> Result<()>
fn read_from_node(&mut self, unnamed: &impl FileNodeTraitConst) -> Result<()>
source§impl Feature2DTraitConst for LATCH
impl Feature2DTraitConst for LATCH
fn as_raw_Feature2D(&self) -> *const c_void
fn descriptor_size(&self) -> Result<i32>
fn descriptor_type(&self) -> Result<i32>
fn default_norm(&self) -> Result<i32>
fn write(&self, file_name: &str) -> Result<()>
fn write_to_storage(&self, unnamed: &mut impl FileStorageTrait) -> Result<()>
fn get_default_name(&self) -> Result<String>
fn write_to_storage_with_name( &self, fs: &mut impl FileStorageTrait, name: &str ) -> Result<()>
fn write_to_storage_ptr_with_name( &self, fs: &Ptr<FileStorage>, name: &str ) -> Result<()>
source§impl LATCHTrait for LATCH
impl LATCHTrait for LATCH
fn as_raw_mut_LATCH(&mut self) -> *mut c_void
fn set_bytes(&mut self, bytes: i32) -> Result<()>
fn set_rotation_invariance(&mut self, rotation_invariance: bool) -> Result<()>
fn set_half_ss_dsize(&mut self, half_ssd_size: i32) -> Result<()>
fn set_sigma(&mut self, sigma: f64) -> Result<()>
source§impl LATCHTraitConst for LATCH
impl LATCHTraitConst for LATCH
impl Send for LATCH
Auto Trait Implementations§
impl Freeze for LATCH
impl RefUnwindSafe for LATCH
impl !Sync for LATCH
impl Unpin for LATCH
impl UnwindSafe for LATCH
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
source§impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
source§unsafe fn modify_inplace<Res>(
&mut self,
f: impl FnOnce(&Mat, &mut Mat) -> Res
) -> Res
unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res ) -> Res
Mat
or another similar object. By passing
a mutable reference to the Mat
to this function your closure will get called with the read reference and a write references
to the same Mat
. This is of course unsafe as it breaks the Rust aliasing rules, but it might be useful for some performance
sensitive operations. One example of an OpenCV function that allows such in-place modification is imgproc::threshold
. Read more