Skip to content

Instantly share code, notes, and snippets.

@hiroyuki-sato
hiroyuki-sato / opencv-glib.md
Created March 21, 2022 14:18
OpenCV glib懸案 3/21
View opencv-glib.md
  • OpenCV Image Filtering は様々なフィルタリングが提供されています。関数の中には、デフォルト値が設定されているものがあります。

以下は、デフォルトオプションが指定されている関数の例です。

cv::blur (InputArray src, OutputArray dst, Size ksize, Point anchor=Point(-1,-1), int borderType=BORDER_DEFAULT)
cv::filter2D (InputArray src, OutputArray dst, int ddepth, InputArray kernel, Point anchor=Point(-1,-1), double delta=0, int borderType=BORDER_DEFAULT)
cv::Laplacian (InputArray src, OutputArray dst, int ddepth, int ksize=1, double scale=1, double delta=0, int borderType=BORDER_DEFAULT)
cv::Sobel (InputArray src, OutputArray dst, int ddepth, int dx, int dy, int ksize=3, double scale=1, double delta=0, int borderType=BORDER_DEFAULT)
@hiroyuki-sato
hiroyuki-sato / ayame_signaling.rb
Last active February 5, 2022 13:36
あやめのログを整形する
View ayame_signaling.rb
#!/usr/bin/env ruby
require 'json'
=begin
KEYS = %[
clientID
connectionId
message
messageroomId
View embulk.md
N,NAME
1,林檎
2,蜜柑
3,白桃
4,南瓜
View digdag.md
  • 仕組み上タスク毎に作業ディレクトリを作ってpy>, sh>, rb>などのスクリプトオペレータ以外は変えられない。
  • タスク毎にカレンとディレクトリは変わるが、カレントディレクトリにはdigdag pushしたコンテンツがあるディレクトリになっている。
  • digdag pushは .で始まるファイルはpushしない

ということを踏まえて

  • digdag pushするプロジェクト直下に、pipenv というディレクトリを作り pipenvの設定を置く
  • py>オペレータ実行時に、上記ディレクトリを参照するようにする

イメージ

View rbenv.txt
rbenv install jruby-9.3.0.0
Downloading jruby-bin-9.3.0.0.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/2dc1f85936d3ff3adc20d90e5f4894499c585a7ea5fedec67154e2f9ecb1bc9b
Installing jruby-9.3.0.0...
tr: Illegal byte sequence
BUILD FAILED (macOS 11.6 using ruby-build 20210928)
Inspect or clean up the working tree at /var/folders/3s/5cm202m95zsglpy26c6_7j9m0000gn/T/ruby-build.20210930202800.79151.JkfMTR
Results logged to /var/folders/3s/5cm202m95zsglpy26c6_7j9m0000gn/T/ruby-build.20210930202800.79151.log
View gist:37b04e2609a5b8674ed665727f4a505f
org.embulk.output.s3.TestS3FileOutputPlugin > testEmbulk STANDARD_ERROR
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Hidden dependencies are uninitialized. Maybe using classes loaded by Embulk's top-level ClassLoader.
testCompile "junit:junit:4.13.2"
testCompile "org.embulk:embulk-core:0.10.32"
@hiroyuki-sato
hiroyuki-sato / ransac.md
Last active July 15, 2021 10:19
cloud compare ransac
View ransac.md

\ を削除して行を連結してください。(Windowsの場合)

-O 入力ファイル名 \
-SAVE_CLOUDS FILE 出力ファイル名.bin \
-RANSAC ENABLE_PRIMITIVE PLANE CYLINDER CONE TORUS \
        SUPPORT_POINTS 10000 \
 EPSILON_PERCENTAGE_OF_SCALE 0.072 \
@hiroyuki-sato
hiroyuki-sato / embulk.md
Last active June 16, 2021 09:13
embulk dependencies example
View embulk.md

ロックファイルのあるべき姿

build.gradleが適切に設定されていれば、以下の行が含まれているはず

javax.validation:validation-api:1.1.0.Final
com.fasterxml.jackson.core:jackson-annotations:2.6.7
com.fasterxml.jackson.core:jackson-core:2.6.7
com.fasterxml.jackson.core:jackson-databind:2.6.7
@hiroyuki-sato
hiroyuki-sato / embulk.txt
Created June 15, 2021 13:31
embuk-filter-column compare result
View embulk.txt
#########################################
# example/add_columns.yml
#########################################
******************************************
* v0.9
******************************************
2021-06-15 22:14:53.363 +0900: Embulk v0.9.23
2021-06-15 22:14:54.719 +0900 [WARN] (main): DEPRECATION: JRuby org.jruby.embed.ScriptingContainer is directly injected.
View build.gradle
// Adding dependencies on JAXB explicitly.
// JAXB 2.2.11 is chosen here because:
// 1. JDK 8's bundled JAXB is 2.2.8. Better with a closer version while we are on Java 8.
// https://javaee.github.io/jaxb-v2/doc/user-guide/ch02.html#a-2-2-8
// 2. Neither com.sun.xml.bind:jaxb-core:2.2.8 nor com.sun.xml.bind:jaxb-impl:2.2.8 does not exist on Maven Central.
// 3. 2.2.11 looks to be used by the most Java libraries among JAXB 2.2.
// https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api
// https://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-core
// https://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-impl