viuer terminal images
This commit is contained in:
+10
-1
@@ -3,6 +3,7 @@ use image_similarity::descriptors::{DCT, Descriptor};
|
||||
use image_similarity::store::DescriptorStore;
|
||||
use std::env;
|
||||
use log::{info, debug, error};
|
||||
use viuer::{Config, print};
|
||||
|
||||
struct Cfg {
|
||||
path: String
|
||||
@@ -31,6 +32,14 @@ fn main() {
|
||||
|
||||
let img = image::open(cfg.path)
|
||||
.expect("Unable to open file");
|
||||
println!("Iamge");
|
||||
let conf = viuer::Config {
|
||||
width: Some(16),
|
||||
height: Some(8),
|
||||
..Default::default()
|
||||
};
|
||||
viuer::print(&img, &conf).expect("Image printing failed.");
|
||||
println!("Iamge");
|
||||
let store =
|
||||
DescriptorStore::new()
|
||||
.with_file("store.messagepack");
|
||||
@@ -38,5 +47,5 @@ fn main() {
|
||||
let phash: u64 = desc.describe(&img);
|
||||
info!("Phash integer:\n{phash}");
|
||||
info!("Phash binary:\n{phash:064b}");
|
||||
store.knn(phash, 4);
|
||||
store.knn(phash, 10);
|
||||
}
|
||||
Reference in New Issue
Block a user