Skip to content

Instantly share code, notes, and snippets.

@atuyosi
atuyosi / not_contains_level2.txt
Created February 17, 2016 18:30
tesseract-ocr 3.04 日本語未収録漢字のうち、JIS第二水準漢字の一覧
@atuyosi
atuyosi / detail_segfault_text2image#195
Created February 19, 2016 06:28
text2image Segfault on MacOSX(related with #195)
(lldb) run --text=eng.training_text --outputbase=./eng.dejavu.exp0 --font='DejaVu Sans Thin' --fonts_dir=~/Library/Fonts
There is a running process, kill it and restart?: [Y/n] y
Process 50212 exited with status = 9 (0x00000009)
Process 50237 launched: '/usr/local/bin/text2image' (x86_64)
Process 50237 stopped
* thread #1: tid = 0xc2291, 0x0000000100b98358 libpangoft2-1.0.0.dylib`pango_fc_font_get_glyph + 25, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x0000000100b98358 libpangoft2-1.0.0.dylib`pango_fc_font_get_glyph + 25
libpangoft2-1.0.0.dylib`pango_fc_font_get_glyph:
-> 0x100b98358 <+25>: movq (%rcx), %rdi
0x100b9835b <+28>: testq %rdi, %rdi
@atuyosi
atuyosi / switch-image-threshold-method
Created April 14, 2016 11:40
Example for "preprocessedImageForTesseract"
func preprocessedImageForTesseract(tesseract: G8Tesseract!, sourceImage: UIImage!) -> UIImage! {
var filteredImage = UIImage()
switch threshold_mode {
case ThresholdMode.AdaptiveThreshold :
// Using AdaptiveThreshold
let adaptiveFilter = GPUImageAdaptiveThresholdFilter()
adaptiveFilter.blurRadiusInPixels = 4.0
@atuyosi
atuyosi / check_h1tag.rb
Created June 12, 2016 04:49
対象のはてなブログの各エントリにおいて、見出しにh1タグが使われているURLを見つけ出すやっつけ作業スクリプト
# /usr/bin/env ruby
require 'open-uri'
require 'nokogiri'
baseurl = "対象のはてなブログURL"
year = [ 2015,2016 ] # 必要に応じて追加
month = *1..12
@atuyosi
atuyosi / map_to_arpabet_to_ipa.txt
Last active August 5, 2019 16:13
The mapping table for cmudict symbols ( to spa from arpabet)
AA
AA0 \u0251\u02D0
AA1 \u0251\u0301\u02D0
AA2 \u0251\u0300\u02D0
AE
AE0 \u00E6
AE1 \u00E6\u0301
AE2 \u00E6\u0300
AH
AH0 \u0259
@atuyosi
atuyosi / convert.rb
Created August 24, 2016 12:51
To convert the cmudict from arpabet format to IPA format.
#! /usr/bin/env ruby
require 'csv'
require 'json'
mt = Hash.new
newdict = Hash.new
MAPFILE = "map_to_ipa_from_arpabet.tsv"
@atuyosi
atuyosi / cmake_output_raspbian_opencv3.2.txt
Created December 30, 2016 14:58
CMake configuration for OpenCV 3.2 (with contrib) 2016/12/30 on Raspbian jessie
-- General configuration for OpenCV 3.2.0 =====================================
-- Version control: unknown
--
-- Extra modules:
-- Location (extra): /home/pi/workspace/build_opencv/opencv_contrib-3.2.0/modules
-- Version control (extra): unknown
--
-- Platform:
-- Timestamp: 2016-12-30T12:09:59Z
-- Host: Linux 4.4.38-v7+ armv7l
@atuyosi
atuyosi / make_inkscape_osx_native.md
Last active September 18, 2019 09:25
Procedure for create App bundle and dmg for Inkscape 0.92 on Sierra/Mountain Lion

Buiding macOS Native (Gtk2/Quartz) version package.

  • Inkscape 0.92
  • Gtk 2
  • App bundle
  • Inkscape.dmg

Pre Requirements

  • Xcode
@atuyosi
atuyosi / building_inkscape_for_macOS_ja.md
Last active February 12, 2017 08:29
Inkscapeパッケージ(macOS)作業メモ

macOS Native (Gtk2/Quartz) のパッケージ(Inkscape.dmg)を作成する

  • Inkscape 0.92
  • Gtk 2
  • App bundle
  • Inkscape.dmg

必要なもの

  • Xcode
@atuyosi
atuyosi / do_ocr_ms.py
Created March 15, 2017 17:25
Modified Python Script for MS Computer Vision API (OCR)
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import http.client, urllib.request, urllib.parse, urllib.error, base64
# https://dev.projectoxford.ai/docs/services/56f91f2d778daf23d8ec6739/operations/56f91f2e778daf14a499e1fc
import http.client, urllib.request, urllib.parse, urllib.error, base64
import os, json, argparse