* Image Acquisition 01: Code generated by Image Acquisition 01
list_files ('D:/Study/鐵片方型尋找', ['files','follow_links'], ImageFiles)
tuple_regexp_select (ImageFiles, ['\\.(tif|tiff|gif|bmp|jpg|jpeg|jp2|png|pcx|pgm|ppm|pbm|xwd|ima|hobj)$','ignore_case'], ImageFiles)
for Index := 0 to |ImageFiles| - 1 by 1
read_image (Image, ImageFiles[Index])
- Dec 02 Tue 2014 23:46
型態學 方型尋找
- Nov 26 Wed 2014 21:54
同步網路硬碟資料夾 與 Hardlink 運用
Hard link 就是 建立A目錄 連接到 B目錄
例:
D:\ 沒有temp 的資料夾
mklink /j D:\temp C:\temp
如此 D:\下會自動建立一個 temp 連接到 C:\temp
- Nov 26 Wed 2014 19:07
Halcon 尋找細線
Paste your text here.read_image (Image, 'CutImage.png')
rgb1_to_gray (Image, GrayImage)
get_image_size (GrayImage, Width, Height)
dev_close_window ()
dev_open_window (0, 0, Width, Height, 'black', WindowHandle)
dev_display (Image)
dev_set_draw ('margin')
*排除塗黑的區塊
mean_image (GrayImage, ImageMean, 50, 50)
threshold (ImageMean, RegionBlacked, 20, 255)
erosion_circle (RegionBlacked, RegionBlackedDilation, 20.5)
median_rect (GrayImage, ImageMedian, 1, 5)
*方法:提取線
lines_gauss (ImageMedian, Lines, 1, 2, 6, 'dark', 'true', 'bar-shaped', 'true')
union_collinear_contours_xld (Lines, UnionContours, 10, 1, 5, 0.4, 'attr_keep')
select_shape_xld (UnionContours, SelectedXLD, 'contlength', 'and', 40, 99999)
select_shape_xld (SelectedXLD, SelectedXLD1, 'anisometry_points', 'and', 10, 99999)
gen_region_contour_xld (SelectedXLD1, RegionLines, 'filled')
intersection (RegionLines, RegionBlackedDilation, RegionIntersection)
union1 (RegionIntersection, RegionUnion1)
closing_circle (RegionUnion1, RegionClosing, 3.5)
connection (RegionClosing, ConnectedRegions)
select_shape (ConnectedRegions, SelectedRegionsFinal, 'area', 'and', 75, 9999999)
union1 (SelectedRegionsFinal, RegionUnionFinal)
*方法:邊緣檢測後提取線
derivate_gauss (ImageMedian, DerivGauss, 1, 'gradient')
sobel_amp (ImageMedian, EdgeAmplitude, 'sum_abs', 5)
lines_gauss (EdgeAmplitude, Lines1, 1, 6, 15, 'light', 'true', 'bar-shaped', 'true')
union_collinear_contours_xld (Lines1, UnionContours1, 10, 1, 5, 0.4, 'attr_keep')
select_shape_xld (UnionContours1, SelectedXLD2, 'contlength', 'and', 40, 99999)
select_shape_xld (SelectedXLD2, SelectedXLD3, 'anisometry_points', 'and', 10, 99999)
gen_region_contour_xld (SelectedXLD3, RegionLines1, 'filled')
intersection (RegionLines1, RegionBlackedDilation, RegionIntersection1)
union1 (RegionIntersection1, RegionUnion2)
closing_circle (RegionUnion2, RegionClosing1, 3.5)
connection (RegionClosing1, ConnectedRegions1)
select_shape (ConnectedRegions1, SelectedRegionsFinal1, 'area', 'and', 75, 9999999)
union1 (SelectedRegionsFinal1, RegionUnionFinal1)
*結合兩種方法
union2 (RegionUnionFinal, RegionUnionFinal1, AllRegions)
dilation_circle (AllRegions, Defects, 6.5)
*可視化
dev_set_color ('red')
dev_display (Image)
dev_display (Defects)
- Sep 20 Sat 2014 22:33
如何雙開 VM 還可以很順暢
一直以來 進到一個誤區,為了讓VM可以跑得很順利 升級電腦 加大記憶體 到最近換了 SSD
的確,花了錢 開 VM的確順很多
但雙開 VM 還是會卡卡的。
最後發現 給予VM適當的RAM 大小很重要
- Sep 17 Wed 2014 09:07
Datagridview Row Heade 設定文字 與 消除 選擇三角
如果只是要消除 顯示的 三角形
padding的參數中 設個數值就好
datagridview1.RowHeadersDefaultCellStyle.Padding = New Padding(50)
單純 設定 RowHeade 的文字
- Aug 11 Mon 2014 14:49
.net 自定義物件 解構 觸發事件
在自定義物件的操作,當要在物件被回收時 同時啟用 某個相關 操作
可複寫 該物件的 Finalize
Protected Overrides Sub Finalize()
..............
- Jul 20 Sun 2014 12:11
台灣房價開始起跌 (青壯年人口與結婚人數會影響買房的需求)
這張圖是今天抽空把過去的一個想法 用成圖來表示
- Jul 16 Wed 2014 16:52
.net Bitmap 圖檔放大 出現格子
一般來說 將圖檔放大時,影像會被做插值處理
當把圖檔放大,如果想看到 Pixel 呈現格狀,需要調整參數才有辦法
(系統內定是有做插值處理的)
做法就是修改 插值處理的參數 改成 Drawing2D.InterpolationMode.NearestNeighbor
- Jun 17 Tue 2014 23:29
Color 的 XML序列化
當要把 Color 的物件 XML 序列化的時候 會發現會失敗
有個比較方便的方法 將原先的物件 設上 <XmlIgnore()> 標籤
另外加入一個 Property 設上 <XmlElement("PointColor")> 標籤
取代原先被忽略的物件 即可以順利 將 Color 做 XML 序列化
- Mar 30 Sun 2014 08:19
Halcon 學習(二)