Sha256: 5210ac055b3353eaae9ae50c70583f8d4d17340fc16bd27361b68e457fc54eac
Contents?: true
Size: 1.06 KB
Versions: 5
Compression:
Stored size: 1.06 KB
Contents
# typed: strict require "eikon/version" require "eikon/comparator" require "eikon/video_processor" require "eikon/image_processor" require "vips" require "sorbet-runtime" module Eikon extend T::Sig class Error < StandardError; end sig { params(filename: T.untyped).returns(String) } def self.dhash_for_image(filename) image = Eikon::ImageProcessor.new(filename) image.preprocess_image image.generate_byte_array image.byte_array end sig { params(filename: String, number_of_frames: Integer).returns(T::Array[T::Hash[String, T.any(Integer, String)]]) } def self.dhash_for_video(filename, number_of_frames = 0) video_processor = Eikon::VideoProcessor.new(filename) storage_path = video_processor.split_video_into_images(number_of_frames) dhashes = video_processor.get_frames_dhash(storage_path) dhashes end sig { params(filename_1: String, filename_2: String).returns(Integer) } def self.distance_between_files(filename_1, filename_2) Eikon::Comparator.compare(dhash_for_image(filename_1), dhash_for_image(filename_2)) end end
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
eikon-0.1.10 | lib/eikon.rb |
eikon-0.1.9 | lib/eikon.rb |
eikon-0.1.8 | lib/eikon.rb |
eikon-0.1.7 | lib/eikon.rb |
eikon-0.1.6 | lib/eikon.rb |