เจอกระแต เอม แนน
ไปถ่ายรูปกับว่าที่บัณทิต บราวน์
แล้วปิดท้ายด้วยบังเอิญไปเจอ แฝดปวีณา นัยนา ไม่ได้เจอนานแยกไม่ออกเลยว่าใครเป็นใคร เสื้อม่วงนัยนา
เสื้อเทาปวีณา
เนมินทร์ ไลฟ์สไตล์ ทุกอย่างสนใจ เช่น การเขียนโปรแกรมคอมพิวเตอร์ ข่าววงการไอที กิจกรรมยามว่าง ฯลฯ
I = imread('rice.png'); imshow(I) |
background = imopen(I,strel('disk',15)); |
figure, surf(double(background(1:8:end,1:8:end))),zlim([0 255]); set(gca,'ydir','reverse'); |
I2 = I - background; imshow(I2) |
I3 = imadjust(I2); imshow(I3); |
level = graythresh(I3); bw = im2bw(I3,level); |
bw = bwareaopen(bw, 50); imshow(bw) |
cc = bwconncomp(bw, 4); ??? Undefined function or method 'bwconncomp' for input arguments of type 'double'. |
[CC,NUM] = bwlabel(BW,4) >> num num = 95 |
cc = bwconncomp(bw, 4); grain = false(size(bw)); |
labeled = labelmatrix(cc); RGB_label = label2rgb(labeled,'jet', 'k', 'shuffle'); figure, imshow(RGB_label) |
graindata = regionprops(cc,'basic'); |
grain_areas = [graindata.Area]; [max_area,idx] = max(grain_areas) grain(cc.PixelIdxList{idx}) = true; imshow(grain); |
nbins =20; figure, hist(grain_areas,nbins) title('Histogram of Rice Grain Area'); |
I = imread('rice.png'); imshow(I) |
background = imopen(I,strel('disk',15)); |
figure, surf(double(background(1:8:end,1:8:end))),zlim([0 255]); set(gca,'ydir','reverse'); |
I2 = I - background; imshow(I2) |
I3 = imadjust(I2); imshow(I3); |
level = graythresh(I3); bw = im2bw(I3,level); |
bw = bwareaopen(bw, 50); imshow(bw) |
BW = zeros(9,10); BW(4:6,4:7) = 1 BW = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 SE = strel('square',3) SE = Flat STREL object containing 3 neighbors. Neighborhood: 1 1 1 1 1 1 1 1 1 BW2 = imdilate(BW,SE) |
BW1 = imread('circbw.tif'); SE = strel('arbitrary',eye(5)); SE= Flat STREL object containing 5 neighbors. Neighborhood: 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 BW2 = imerode(BW1,SE); imshow(BW1) figure, imshow(BW2) |
ภาษา | ชื่อ socket library |
VB,C#, VC++ | winsock control |
Python | socket |
# Time server program from socket import * import time s = socket(AF_INET, SOCK_STREAM) # Create TCP Socket s.bind(("",8888)) # Bind to port 8888 s.listen(5) # Start listening while 1: client, addr = s.accept() # Wait for connection print "Got a connection from ", addr client.send(time.ctime(time.time())) # Sent time back client.close() |
if (nxt.Connect("COM7")) { int power; nxt.GetBatteryPower(out power); System.Diagnostics.Debug.WriteLine(power); System.Diagnostics.Debug.WriteLine("Connected successfully "); } else { MessageBox.Show("Failed connecting to NXT device", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } |
wm.WiimoteChanged += new WiimoteChangedEventHandler(wm_WiimoteChanged); wm.WiimoteExtensionChanged += new WiimoteExtensionChangedEventHandler(wm_WiimoteExtensionChanged); wm.Connect(); |
NXTBrick.MotorState motorStateGo = new NXTBrick.MotorState(); WiimoteState ws = args.WiimoteState; //set motorState Go motorStateGo.Power = (sbyte)127; motorStateGo.TurnRatio = (sbyte)50; motorStateGo.Mode = NXTBrick.MotorMode.On;// NXTBrick.MotorMode.Brake, NXTBrick.MotorMode.None, NXTBrick.MotorMode.Regulated motorStateGo.RunState = runStates[2]; //0:Idle, 1:RampUp, 2:Running, 3:RampDown |
NXTBrick.MotorState motorStateStop = new NXTBrick.MotorState(); //set motorState Stop motorStateStop.Power = (sbyte)0; motorStateStop.TurnRatio = (sbyte)0; motorStateStop.Mode = NXTBrick.MotorMode.None;// NXTBrick.MotorMode.Brake, NXTBrick.MotorMode.None, NXTBrick.MotorMode.Regulated motorStateStop.RunState = runStates[0]; //0:Idle, 1:RampUp, 2:Running, 3:RampDown |
if (ws.ButtonState.Left) { // set motor's state if (nxt.SetMotorState(NXTBrick.Motor.C, motorStateGo) != true ) { System.Diagnostics.Debug.WriteLine("Failed setting motor state"); } } |