SlideShare a Scribd company logo
1 of 11
Download to read offline
7 เมษายน 2559 (Week 3)
1. ทําภาพขาวดํา
a = imread('1.jpg') เป็นฟังก์ชั่นที่มีไว้อ่านไฟล์ภาพ จากนั้นกด Enter
ตัวเลขทั้งหมดก็จะ Run เต็มหน้าจอ ตัวเลขนี้คือตัวเลขจากไฟล์ภาพที่เรา Download มาจาก
Internet ตัวเลขจะ Run เยอะแค่ไหนขึ้นอยู่กับขนาดรูปภาพที่เราดาวน์โหลด
Imshow(a) เป็นฟังก์ชั่นแสดงไฟล์รูปขึ้นมา
g = rgb2gray(a) การกําหนดภาพให้แสดงจากภาพสีให้เป็นสีเทา
figure, imshow(g) คําสั่งการแสดงภาพที่เรา Download มาในตอนแรกที่เป็นภาพสี พอเรากด
Enter ไฟล์ภาพจะแสดงเป็นสีเทา
imhist คําสั่งที่ทําให้ภาพแสดงเป็นกราฟ Histogram เป็นคําสั่งที่ใช้แสดงค่าช่วงสี
Whos เป็นคําสั่งที่แสดงคุณสมบัติของภาพ ดูลักษณะของไฟล์ภาพ
figure,imshow(bw) เป็นคําสั่งแสดงภาพขาวดํา
bw = im2bw(a) เป็นคําสั่งที่แปลงจากภาพสีเป็นภาพขาวดํา
กด CLC เพื่อเคลียร์หน้าจอให้สะอาด
2.ลิง
b = imread('2.jpg') เป็นฟังก์ชั่นที่มีไว้อ่านไฟล์ภาพ จากนั้นกด Enter
imshow(b) เป็นคําสั่งแสดงภาพ
Imhist(b) คําสั่งที่ทําให้ภาพแสดงเป็นกราฟ Histogram เป็นคําสั่งที่ใช้แสดงค่าช่วงสี
ad = imadjust(b) คําสั่งการปรับแก้สีภาพให้มันมีความชัดมากขึ้น
พอกด ad = imadjust(b) ภาพจะมีความคมชัดมากขึ้นกว่ารูปแรก หลังจากนั้นเรากด
figure,imshow(ab) เป็นคําสั่งแสดงภาพ
Imhist(ad) คําสั่งที่ทําให้ภาพแสดงเป็นกราฟ Histogramเป็นคําสั่งที่ใช้แสดงค่าช่วงสี
3.ทําตัวเลขให้เป็นสี
image เป็นคําสั่งที่แสดงค่าออกมาเป็นสี และมีการไล่ลําดับเฉดสีให้ด้วย
4. Web cam
Imaqtoot เป็นคําสั่งที่ตรวจสอบ driver ของกล้อง webcam
จะได้กล้องออกมาแล้วเลือก MJPG 1280*720 แล้ว start preview
เข้า New Scrip เอา code ที่ copy มาจาก face book วาง
vid = videoinput('winvideo', 1, 'MJPG_1280x720');
เข้า New Scrip เอา code ที่ copy มาจาก face book วาง
preview(vid) for i=1:10
img=getsnapshot(vid);
fname=['Image',num2str(i)];
imwrite(img,fname,'jpg');
pause(2);
end
แล้วกด run หลังจากเรากด run ภาพจะถ่ายให้ทันที 10 ภาพ แล้วเราเข้าไปดูภาพที่ถ่านได้ที่
Drive D ซึ่งมันจะบันทึกไว้อัตโนมัติ

More Related Content

Viewers also liked

Sociedad de la información actividad n. tec.
Sociedad de la información actividad n. tec.Sociedad de la información actividad n. tec.
Sociedad de la información actividad n. tec.alumnaly
 
Move as Fast as Your Users with Mobile Test Automation
Move as Fast as Your Users with Mobile Test AutomationMove as Fast as Your Users with Mobile Test Automation
Move as Fast as Your Users with Mobile Test AutomationCA Technologies
 
Valerie Wagner Resume 2016
Valerie Wagner Resume 2016Valerie Wagner Resume 2016
Valerie Wagner Resume 2016Valerie Wagner
 
Sistema de monitoreo y evaluación de la educación ambiental en la gestión esc...
Sistema de monitoreo y evaluación de la educación ambiental en la gestión esc...Sistema de monitoreo y evaluación de la educación ambiental en la gestión esc...
Sistema de monitoreo y evaluación de la educación ambiental en la gestión esc...Danny Roy Abanto Cachy
 
Term Project Paper on Design of Shallow and Deep Foundation for a cement plan...
Term Project Paper on Design of Shallow and Deep Foundation for a cement plan...Term Project Paper on Design of Shallow and Deep Foundation for a cement plan...
Term Project Paper on Design of Shallow and Deep Foundation for a cement plan...Rakibul Hasan,MEng,EIT
 
Etapa de la respuesta educativa: Soporte socioemocional
Etapa de la respuesta educativa:  Soporte socioemocionalEtapa de la respuesta educativa:  Soporte socioemocional
Etapa de la respuesta educativa: Soporte socioemocionalTeresa Clotilde Ojeda Sánchez
 
Fueling DevOps with a Testing Trifecta: How the New World of Testing is Driv...
Fueling DevOps with a Testing Trifecta:  How the New World of Testing is Driv...Fueling DevOps with a Testing Trifecta:  How the New World of Testing is Driv...
Fueling DevOps with a Testing Trifecta: How the New World of Testing is Driv...CA Technologies
 

Viewers also liked (14)

Sociedad de la información actividad n. tec.
Sociedad de la información actividad n. tec.Sociedad de la información actividad n. tec.
Sociedad de la información actividad n. tec.
 
Move as Fast as Your Users with Mobile Test Automation
Move as Fast as Your Users with Mobile Test AutomationMove as Fast as Your Users with Mobile Test Automation
Move as Fast as Your Users with Mobile Test Automation
 
PEC 2015
PEC 2015 PEC 2015
PEC 2015
 
Valerie Wagner Resume 2016
Valerie Wagner Resume 2016Valerie Wagner Resume 2016
Valerie Wagner Resume 2016
 
AskEricColumn3
AskEricColumn3AskEricColumn3
AskEricColumn3
 
Lectura n43
Lectura n43Lectura n43
Lectura n43
 
Artificials2
Artificials2Artificials2
Artificials2
 
Sistema de monitoreo y evaluación de la educación ambiental en la gestión esc...
Sistema de monitoreo y evaluación de la educación ambiental en la gestión esc...Sistema de monitoreo y evaluación de la educación ambiental en la gestión esc...
Sistema de monitoreo y evaluación de la educación ambiental en la gestión esc...
 
Term Project Paper on Design of Shallow and Deep Foundation for a cement plan...
Term Project Paper on Design of Shallow and Deep Foundation for a cement plan...Term Project Paper on Design of Shallow and Deep Foundation for a cement plan...
Term Project Paper on Design of Shallow and Deep Foundation for a cement plan...
 
Etapa de la respuesta educativa: Soporte socioemocional
Etapa de la respuesta educativa:  Soporte socioemocionalEtapa de la respuesta educativa:  Soporte socioemocional
Etapa de la respuesta educativa: Soporte socioemocional
 
Social Media
Social MediaSocial Media
Social Media
 
Design presentation
Design presentation Design presentation
Design presentation
 
Treball minerals
Treball mineralsTreball minerals
Treball minerals
 
Fueling DevOps with a Testing Trifecta: How the New World of Testing is Driv...
Fueling DevOps with a Testing Trifecta:  How the New World of Testing is Driv...Fueling DevOps with a Testing Trifecta:  How the New World of Testing is Driv...
Fueling DevOps with a Testing Trifecta: How the New World of Testing is Driv...
 

More from Beer Srisudaporn

นางสาวรัตน์ชนก นาทองลาย
นางสาวรัตน์ชนก   นาทองลายนางสาวรัตน์ชนก   นาทองลาย
นางสาวรัตน์ชนก นาทองลายBeer Srisudaporn
 
นางสาวศรีสุดาพร คำอ้าย
นางสาวศรีสุดาพร   คำอ้ายนางสาวศรีสุดาพร   คำอ้าย
นางสาวศรีสุดาพร คำอ้ายBeer Srisudaporn
 
นางสาวสุดารัตน์ เนตรวงค์
นางสาวสุดารัตน์   เนตรวงค์นางสาวสุดารัตน์   เนตรวงค์
นางสาวสุดารัตน์ เนตรวงค์Beer Srisudaporn
 
นางสาวฐิติมาพร ขจรฟุ้ง
นางสาวฐิติมาพร ขจรฟุ้งนางสาวฐิติมาพร ขจรฟุ้ง
นางสาวฐิติมาพร ขจรฟุ้งBeer Srisudaporn
 

More from Beer Srisudaporn (14)

นางสาวรัตน์ชนก นาทองลาย
นางสาวรัตน์ชนก   นาทองลายนางสาวรัตน์ชนก   นาทองลาย
นางสาวรัตน์ชนก นาทองลาย
 
นางสาวศรีสุดาพร คำอ้าย
นางสาวศรีสุดาพร   คำอ้ายนางสาวศรีสุดาพร   คำอ้าย
นางสาวศรีสุดาพร คำอ้าย
 
นางสาวสุดารัตน์ เนตรวงค์
นางสาวสุดารัตน์   เนตรวงค์นางสาวสุดารัตน์   เนตรวงค์
นางสาวสุดารัตน์ เนตรวงค์
 
นางสาวฐิติมาพร ขจรฟุ้ง
นางสาวฐิติมาพร ขจรฟุ้งนางสาวฐิติมาพร ขจรฟุ้ง
นางสาวฐิติมาพร ขจรฟุ้ง
 
Merged document 4
Merged document 4Merged document 4
Merged document 4
 
Merged document 3
Merged document 3Merged document 3
Merged document 3
 
Matlab 58170042 (1)
Matlab 58170042 (1)Matlab 58170042 (1)
Matlab 58170042 (1)
 
Merged document
Merged documentMerged document
Merged document
 
Lab5
Lab5Lab5
Lab5
 
Lab4
Lab4Lab4
Lab4
 
Lab2
Lab2Lab2
Lab2
 
Lab1
Lab1Lab1
Lab1
 
Lab1
Lab1Lab1
Lab1
 
Matrabเจน
MatrabเจนMatrabเจน
Matrabเจน
 

Lab3