<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Volkan Aktaş on Medium]]></title>
        <description><![CDATA[Stories by Volkan Aktaş on Medium]]></description>
        <link>https://medium.com/@volkan_aktas?source=rss-e54c8c89b7c6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*B3BnxQdIoefCAEIApTC9IQ.jpeg</url>
            <title>Stories by Volkan Aktaş on Medium</title>
            <link>https://medium.com/@volkan_aktas?source=rss-e54c8c89b7c6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 23:27:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@volkan_aktas/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Differences Between MicroSui 0.2.2 and 0.3.0]]></title>
            <link>https://medium.com/@volkan_aktas/differences-between-microsui-0-2-2-and-0-3-0-989c05b4cad7?source=rss-e54c8c89b7c6------2</link>
            <guid isPermaLink="false">https://medium.com/p/989c05b4cad7</guid>
            <category><![CDATA[sui]]></category>
            <category><![CDATA[esp32]]></category>
            <category><![CDATA[arduino]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Volkan Aktaş]]></dc:creator>
            <pubDate>Wed, 03 Sep 2025 15:04:57 GMT</pubDate>
            <atom:updated>2025-09-03T15:04:57.656Z</atom:updated>
            <content:encoded><![CDATA[<p>When the MicroSui library was updated from version 0.2.2 to 0.3.0, several important improvements were introduced. The first major update was the simplification of the offline transaction process.</p><p>To compare this improvement, we’ll first walk through how an offline transaction was performed with version 0.2.2.</p><p>The first step is to generate the “txByte” message on the gateway using the Typescript SDK.</p><p>First, install the Sui library inside your application with:</p><p>npm install @mysten/sui</p><p>Our React TypeScript file gwBuildMessage.ts will look like this:</p><pre>import { SuiClient, getFullnodeUrl } from &quot;@mysten/sui/client&quot;;<br>import { Transaction } from &quot;@mysten/sui/transactions&quot;;<br><br>const sender =<br>  &quot;0x09af10310fd0d0c344c03a9eb395de869ee454c598a928d53d312c47c33d9b76&quot;;<br>const recipient =<br>  &quot;0x42880be9c6737fa94c3a87f2f645f55a073ada48da288240a2158c9837641743&quot;;<br>const amountToSend = 0.1 * 1000000000;<br><br>async function main() {<br>  console.log(&quot;\n\n\n\n\t\t\t\t GATEWAY BUILD MESSAGE SCRIPT&quot;);<br><br>  console.log(<br>    &quot;\n\n\t\t Tx Details: Transfer &quot; +<br>      amountToSend +<br>      &quot; SUI from &quot; +<br>      sender +<br>      &quot; to &quot; +<br>      recipient<br>  );<br><br>  // 2. Crear el cliente<br>  const client = new SuiClient({ url: getFullnodeUrl(&quot;testnet&quot;) });<br><br>  // 3. Crear transacción<br>  const tx = new Transaction();<br>  const [coin] = tx.splitCoins(tx.gas, [amountToSend]);<br><br>  tx.transferObjects([coin], recipient);<br>  tx.setSender(sender);<br><br>  // 4. Construir la transacción y obtener los bytes<br>  console.log(&quot;\n\n\t\t Building the Message...&quot;);<br>  const txBytes = await tx.build({ client });<br><br>  console.log(<br>    &quot;\n\n\t\t Message to Sign: txBytes (hex):&quot;,<br>    Buffer.from(txBytes).toString(&quot;hex&quot;)<br>  );<br>  console.log(&quot;\n\n Message must be sended to the offline signer device... \n&quot;);<br>}<br><br>main().catch(console.error);</pre><p>In the code, the <strong>sender </strong>variable contains the address that will send Sui, while the recipient variable contains the receiving address.</p><p>Next, run the following command in the terminal to perform the Offline Signer Message Generator step:<br><strong>node — loader ts-node/esm src/gwBuildMessage.ts</strong><br>This will output a result similar to the one shown below:</p><figure><img alt="Offline Signer Message generator" src="https://cdn-images-1.medium.com/max/875/0*9d0lyvjuahznlGOj.png" /><figcaption>Offline Signer Message generator</figcaption></figure><p>Now we can move on to the ESP32 Arduino code. The code will look like this:</p><pre>#include &lt;MicroSui.h&gt;<br><br>//// Sui Private Keys - Its the same key in two different formats, so in both examples we will obtain the same signature<br>// PrivateKey in Bech32 Sui Compatible format `suiprivkey1...`, This format is used in most web3 Sui wallets.<br>const char* private_key_1_bech32 = &quot;suiprivkey1abc1234567&quot;;<br><br>//// Sui Message to Sign - Generate your TX Build Message in HEX with `await tx.build({ client });` in Mysten Typescript SDK<br>const char* message_hex = &quot;000002000800e1f50500000000002042880be9c6737fa94c3a87f2f645f55a073ada48da288240a2158c9837641743020200010100000101030000000001010009af10310fd0d0c344c03a9eb395de869ee454c598a928d53d312c47c33d9b76015a83cb2a898f66d5cd9b819f0d5af0a59a0e976dad2401a8a73b47a20c2cd7c7c05e1c1700000000206b24a01db10d4d3ba7ca47c6cec75ff0c604b2a0ceb56b9b6f4c44abe10fb45509af10310fd0d0c344c03a9eb395de869ee454c598a928d53d312c47c33d9b76e80300000000000040ab3c000000000000&quot;;<br><br>void setup() {<br>  Serial.begin(9600);<br>  pinMode(LED_BUILTIN, OUTPUT);<br><br>  delay(1000);<br><br>  Serial.println(&quot;\n\t\t\t --- SUI OFFLINE SIGN Examples ---\n&quot;);<br><br>  Serial.println(&quot;\t\t - Example 1: Sign with BECH32 Private Key (Bech32 Sui Compatible)&quot;);<br>  Serial.print(&quot;\n\t Original Message: &quot;);<br>  Serial.write(message_hex);<br><br>  uint8_t private_key_1[32];<br>  // To obtain the signature the PK must be in hexadecimal format, so we will use the Bech32 MicroSui decoder<br>  if (microsui_decode_sui_privkey(private_key_1_bech32, private_key_1) != 0) {<br>    Serial.println(&quot;Invalid Bech32 private key.\n&quot;);<br>    return;<br>  }<br><br>  uint8_t sui_sig_1[97];<br>  // We obtain the signature here<br>  microsui_sign_message(sui_sig_1, message_hex, private_key_1);<br><br>  char sui_sig_hex_1[195];<br>  // This MicroSui function makes an array hexa into a string for a better visualization (not needed if not printed)<br>  bytes_to_hex(sui_sig_1, 97, sui_sig_hex_1);<br><br>  Serial.print(&quot;\n\n\t Sui Signature (Example 1) - (97 bytes): &quot;);<br>  Serial.write(sui_sig_hex_1);<br><br>  Serial.println(&quot;\n\t SIGNATURE must be sended to the Gateway to be broadcasted to the Sui Network...\n&quot;);  <br>}<br><br>void loop() {<br>  digitalWrite(LED_BUILTIN, HIGH);  <br>  delay(700);                      <br>  digitalWrite(LED_BUILTIN, LOW);  <br>  delay(700);                      <br>}</pre><p>A Sui private key can exist in two different formats. Both methods generate the same signature. The Bech32 Sui-compatible format is commonly used in most Web3 Sui wallets. The other method uses a hexadecimal-encoded private key.</p><p><strong>Source:</strong> “<a href="https://sdk.mystenlabs.com/typescript/cryptography/keypairs">Mysten Labs TypeScript SDK Cryptography</a>”</p><p>In the Arduino code, paste the private key generated in React into the line corresponding to <strong>“sui_private_key_bech32”</strong>.</p><pre>const char* sui_private_key_bech32 = &quot;suiprivkey1abc1234567&quot;;</pre><p>Similarly, copy the hex string (“txBytes”) generated in React and paste it into the Arduino code as the value of <strong>“const char* message_string”</strong>.</p><pre>const char* message_string =<br>  &quot;000002000800e1f50500000000002042880be9c6737fa94c3a87f2f645f55a073ada48da288240a2158c9837641743020200010100000101030000000001010009af10310fd0d0c344c03a9eb395de869ee454c598a928d53d312c47c33d9b76015a83cb2a898f66d5cd9b819f0d5af0a59a0e976dad2401a8a73b47a20c2cd7c7c05e1c1700000000206b24a01db10d4d3ba7ca47c6cec75ff0c604b2a0ceb56b9b6f4c44abe10fb45509af10310fd0d0c344c03a9eb395de869ee454c598a928d53d312c47c33d9b76e80300000000000040ab3c000000000000&quot;;</pre><p>When we upload the code to Arduino, the signed message will be printed to the serial port screen as shown:</p><pre>const char* message_string =<br>  &quot;000002000800e1f50500000000002042880be9c6737fa94c3a87f2f645f55a073ada48da288240a2158c9837641743020200010100000101030000000001010009af10310fd0d0c344c03a9eb395de869ee454c598a928d53d312c47c33d9b76015a83cb2a898f66d5cd9b819f0d5af0a59a0e976dad2401a8a73b47a20c2cd7c7c05e1c1700000000206b24a01db10d4d3ba7ca47c6cec75ff0c604b2a0ceb56b9b6f4c44abe10fb45509af10310fd0d0c344c03a9eb395de869ee454c598a928d53d312c47c33d9b76e80300000000000040ab3c000000000000&quot;;</pre><figure><img alt="Signature message" src="https://cdn-images-1.medium.com/max/875/0*7O73k3TfMKMzSL-m.png" /><figcaption>Signature message</figcaption></figure><p>Now copy the generated signature message. Create a new React file called “gwBroadCastTx.ts” with the following code:</p><pre>import { SuiClient, getFullnodeUrl } from &quot;@mysten/sui/client&quot;;<br>import { fromHex } from &quot;@mysten/sui/utils&quot;;<br><br>const message =<br>  &quot;000002000800e1f50500000000002042880be9c6737fa94c3a87f2f645f55a073ada48da288240a2158c9837641743020200010100000101030000000001010009af10310fd0d0c344c03a9eb395de869ee454c598a928d53d312c47c33d9b76015a83cb2a898f66d5cd9b819f0d5af0a59a0e976dad2401a8a73b47a20c2cd7c7c05e1c1700000000206b24a01db10d4d3ba7ca47c6cec75ff0c604b2a0ceb56b9b6f4c44abe10fb45509af10310fd0d0c344c03a9eb395de869ee454c598a928d53d312c47c33d9b76e80300000000000040ab3c000000000000&quot;;<br><br>const cHexSignature =<br>  &quot;000b983a64f59c96666162abb34493de51d77ce7b141b24ea95cb86f0035cf4e805b94b114e0e51885f423ff920f845cb6df1f98a5886f4d9a0818c39e9482fb05685da928806e4290dc924cae091979fc5a94c24c99c00e5c00d389394e6af9fe&quot;;<br><br>async function main() {<br>  console.log(&quot;\n\n\n\n\t\t\t\t GATEWAY BROADCAST SIGNED TX SCRIPT&quot;);<br><br>  console.log(<br>    &quot;\n\n\t\t Broadcasting Tx Details:&quot; +<br>      &quot; \n\t\t\t Message: &quot; +<br>      message +<br>      &quot; \n\t\t\t Device Offline Signature : &quot; +<br>      cHexSignature<br>  );<br><br>  // 1. Creating client<br>  const client = new SuiClient({ url: getFullnodeUrl(&quot;testnet&quot;) });<br>  const cSignature = suiSignatureHexToBase64(cHexSignature);<br><br>  // 2. Send the signed transaction<br>  console.log(&quot;\n\n\t\t Broadcasting the Transaction...\n&quot;);<br>  const result = await client.executeTransactionBlock({<br>    transactionBlock: fromHex(message),<br>    signature: [cSignature],<br>    options: {<br>      showEffects: true,<br>      showEvents: true,<br>    },<br>  });<br><br>  console.log(&quot;\n\t\t TX SENDED TO THE NETWORK!\n\n&quot;);<br><br>  const digest = result.digest;<br><br>  console.log(&quot;\t digest:&quot;, digest);<br>  console.log(&quot;\t https://testnet.suivision.xyz/txblock/&quot; + digest + &quot;\n\n&quot;);<br>}<br><br>main().catch(console.error);<br><br>function suiSignatureHexToBase64(hex: string): string {<br>  if (hex.startsWith(&quot;0x&quot;)) hex = hex.slice(2);<br>  const bytes = new Uint8Array(hex.length / 2);<br>  for (let i = 0; i &lt; bytes.length; i++) {<br>    bytes[i] = parseInt(hex.substr(i * 2, 2), 16);<br>  }<br>  return Buffer.from(bytes).toString(&quot;base64&quot;);<br>}</pre><p>In this code, assign the “txMessage” content to the “message” variable, and the Sui Signature generated by Arduino to the “cHexSignature” variable. Then run the following command in the terminal to perform the Offline Signer Broadcast Transaction:<br><strong>node — loader ts-node/esm src/gwBroadcastTx.ts</strong></p><figure><img alt="Offline Signer Broadcast Transaction" src="https://cdn-images-1.medium.com/max/945/1*-JUzHr9x76WyNRWJ9hQyfQ.png" /><figcaption>Offline Signer Broadcast Transaction</figcaption></figure><figure><img alt="Transaction result MicroSui 0.2.2." src="https://cdn-images-1.medium.com/max/875/0*JvKpzciWKFc0o1UA.png" /><figcaption>Transaction result MicroSui 0.2.2.</figcaption></figure><p>With MicroSui 0.3.0, the same process has been simplified. The final broadcast transaction step that previously required the “<strong>gwBroadCastTx.ts”</strong> React script is now handled directly inside the Arduino code itself, and the transaction link is automatically generated.<br>Update your ESP32 Arduino code for version 0.3.0, inserting the private key and message string values (just as before with <strong>“gwBuildMessage.ts”</strong>).</p><pre>#include &lt;MicroSui.h&gt;<br><br>// --- WiFi credentials (example) ---<br>const char* wifi_ssid = &quot;wi-fi name&quot;;<br>const char* wifi_pass = &quot;pass&quot;;<br><br>// --- Sui RPC URL (Testnet) ---<br>const char* rpc_url = &quot;https://fullnode.testnet.sui.io:443/&quot;;<br><br>// --- PRIVATE KEY (EXAMPLE / DO NOT USE IN PRODUCTION) ---<br>const char* sui_private_key_bech32 =<br>  &quot;suiprivkey1abc1234567&quot;;<br><br>// --- Prebuilt TxBytes (generated externally, for now no BCS building inside MicroSui) ---<br>// --- For now, generate your Tx Build Message in HEX with `await tx.build({ client });` in the Mysten Sui Typescript SDK ---<br>const char* message_string =<br>  &quot;000002000800e1f50500000000002042880be9c6737fa94c3a87f2f645f55a073ada48da288240a2158c9837641743020200010100000101030000000001010009af10310fd0d0c344c03a9eb395de869ee454c598a928d53d312c47c33d9b76015a83cb2a898f66d5cd9b819f0d5af0a59a0e976dad2401a8a73b47a20c2cd7c7c05e1c1700000000206b24a01db10d4d3ba7ca47c6cec75ff0c604b2a0ceb56b9b6f4c44abe10fb45509af10310fd0d0c344c03a9eb395de869ee454c598a928d53d312c47c33d9b76e80300000000000040ab3c000000000000&quot;;<br><br>void setup() {<br>  Serial.begin(115200);<br>  pinMode(LED_BUILTIN, OUTPUT);<br>  delay(500);<br><br>  Serial.println();<br>  Serial.println(F(&quot;=== MicroSui ESP32 — Sign &amp; Execute Transaction ===&quot;));<br><br>  // 1) Connect WiFi<br>  Serial.println(F(&quot;\n [1/5] Connecting WiFi...&quot;));<br>  MicroSuiWiFi wifi = WiFi_connect(wifi_ssid, wifi_pass);<br><br>  // 2) Create RPC client<br>  Serial.println(F(&quot;\n [2/5] Creating RPC client...&quot;));<br>  MicroSuiClient client = SuiClient_newClient(rpc_url);<br>  Serial.print(F(&quot;    DONE! - Created Client with RPC URL: &quot;)); Serial.println(rpc_url);<br><br>  // 3) Load keypair from Bech32 secret key<br>  Serial.println(F(&quot;\n [3/5] Loading keypair from Bech32...&quot;));<br>  MicroSuiEd25519 keypair = SuiKeypair_fromSecretKey(sui_private_key_bech32);<br>  Serial.print(F(&quot;    DONE! - Created KeyPair - userAddress: &quot;)); Serial.println(keypair.toSuiAddress(&amp;keypair));<br><br>  // 4) Load prebuilt TxBytes (generated externally)<br>  Serial.println(F(&quot;\n [4/5] Loading prebuilt TxBytes...&quot;));<br>  MicroSuiTransaction tx = SuiTransaction_setPrebuiltTxBytes(message_string);<br>  Serial.println(F(&quot;    DONE! - Created a Sui Transaction object with prebuilt TxBytes&quot;));<br><br>  // 5) Sign + Execute (simplest way: client handles the signature internally)<br>  Serial.println(F(&quot;\n [5/5] Signing and executing...&quot;));<br>  SuiTransactionBlockResponse res1 = client.signAndExecuteTransaction(&amp;client, keypair, tx);<br>  Serial.print(F(&quot;    DONE! - Signed Transaction sended to Sui Network!!&quot;));<br><br>  Serial.println(F(&quot;\n\n --- RPC Response -  Transaction Result ---&quot;));<br>  if (res1.digest)                  { Serial.print(F(&quot;     Digest (Tx ID): &quot;)); Serial.println(res1.digest); }<br>  if (res1.checkpoint)              { Serial.print(F(&quot;     Checkpoint: &quot;)); Serial.println(res1.checkpoint); }<br>  if (res1.confirmedLocalExecution) { Serial.print(F(&quot;     ConfirmedLocalExecution: &quot;)); Serial.println(res1.confirmedLocalExecution); }<br><br>  Serial.print(F(&quot;     BalanceChanges count: &quot;));<br>  Serial.println(res1.balanceChanges_len);<br><br>  for (int i = 0; i &lt; res1.balanceChanges_len; i++) {<br>    Serial.print(F(&quot;      #&quot;)); Serial.println(i + 1);<br>    if (res1.balanceChanges[i].amount)   { Serial.print(F(&quot;        amount: &quot;));   Serial.println(res1.balanceChanges[i].amount); }<br>    if (res1.balanceChanges[i].coinType) { Serial.print(F(&quot;        coinType: &quot;)); Serial.println(res1.balanceChanges[i].coinType); }<br>    if (res1.balanceChanges[i].owner)    { Serial.print(F(&quot;        owner: &quot;));    Serial.println(res1.balanceChanges[i].owner); }<br>  }<br>  Serial.print(F(&quot;\n&quot;));<br><br>  // Clean transaction (important to avoid memory leaks)<br>  tx.clear(&amp;tx);<br><br>  // Disconnect WiFi<br>  wifi.disconnect(&amp;wifi);<br><br>  Serial.println(F(&quot;  Done.&quot;));<br>}<br><br>void loop() {<br>  digitalWrite(LED_BUILTIN, HIGH);  // turn LED on<br>  delay(700);<br>  digitalWrite(LED_BUILTIN, LOW);   // turn LED off<br>  delay(700);<br>  Serial.println(F(&quot;\n  Done. Reboot the board to run the example again.&quot;));<br>}</pre><p>As shown in the result, you can now perform offline signing directly in Arduino with MicroSui, without needing to add the signature message to “gwBroadCastTx.ts” for broadcasting.</p><figure><img alt="Transaction MicroSui 0.3.0" src="https://cdn-images-1.medium.com/max/875/0*Y-HpTuRPo2IIi7VJ.png" /><figcaption>Transaction MicroSui 0.3.0</figcaption></figure><p>The digest (TX ID), for example:<br>“YTphfRBW74Uip5Vd5aprWnBUDLDpH8DAzeoG4eXYV2b”<br>can be checked in the browser by appending it to the explorer URL:<br>“<a href="https://testnet.suivision.xyz/txblock/YTphfRBW74Uip5Vd5aprWnBUDLDpH8DAzeoG4eXYV2b">https://testnet.suivision.xyz/txblock/YTphfRBW74Uip5Vd5aprWnBUDLDpH8DAzeoG4eXYV2b</a>&quot;</p><figure><img alt="MicroSui 0.3.0 Transaction Result" src="https://cdn-images-1.medium.com/max/875/0*WkxUr_lhNZocZmVP.png" /><figcaption>MicroSui 0.3.0 Transaction Result</figcaption></figure><p>Looking at the ESP32 code, you may notice this line:</p><pre>MicroSuiWiFi wifi = WiFi_connect(wifi_ssid, wifi_pass);</pre><p>Yes, MicroSui now has its own methods for direct WiFi connections. Previously, we used the WiFi.h library for wireless connectivity, but now the entire wireless connection process can be handled only with the MicroSui library.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=989c05b4cad7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MicroSui — Sui Embedded Framework]]></title>
            <link>https://medium.com/@volkan_aktas/microsui-sui-embedded-framework-fc41a4a85c6f?source=rss-e54c8c89b7c6------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc41a4a85c6f</guid>
            <category><![CDATA[sui]]></category>
            <category><![CDATA[esp32]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[blokchain]]></category>
            <category><![CDATA[arduino]]></category>
            <dc:creator><![CDATA[Volkan Aktaş]]></dc:creator>
            <pubDate>Wed, 03 Sep 2025 14:06:28 GMT</pubDate>
            <atom:updated>2025-09-03T14:06:28.491Z</atom:updated>
            <content:encoded><![CDATA[<h3>MicroSui — Sui Embedded Framework</h3><p>MicroSui is a lightweight, modular, and open-source C-based framework that brings Sui Protocol functionality to almost all microcontrollers. It provides all core operations, such as key management, transaction construction, signing, and broadcasting, through a pure C library, without relying on an operating system or dynamic memory allocation. This makes it easy to integrate into microcontroller devices ranging from 8-bit to 32-bit ARM chips.</p><figure><img alt="MicroSui library code example" src="https://cdn-images-1.medium.com/max/875/0*so0mpueJddN7SFZ5.png" /><figcaption>MicroSui library code example</figcaption></figure><p><strong>Some Example Use Cases on Sui:</strong></p><p>- Offline Signature (Blind &amp; Semi-Blind)<br>- Sensor Event-Triggered Transactions<br>- Hardware Wallet<br>- Smart Fee Collection<br>- End-to-End Transaction Flow<br>- Timed Signing<br>- Industrial Event Logging on Blockchain<br>- Multisig Participation</p><p>For powerful development boards like the ESP32 with WiFi capabilities, MicroSui enables a complete end-to-end transaction flow: connecting to Sui RPC endpoints over HTTPS or WebSockets, constructing and signing transactions locally on the device, broadcasting them directly to the network, and querying on-chain data.<br>Resource-constrained devices with limited connectivity (e.g., LoRa, BLE, low-power ARM or AVR chipsets) can also participate via lightweight bridge protocols such as MQTT or CoAP. More basic communication options (such as raw data over NFC or 433MHz transmitters) are also supported. These devices can receive pre-constructed messages, sign them with their embedded private keys, and then send them back to a gateway for broadcasting.</p><figure><img alt="MicroSui components" src="https://cdn-images-1.medium.com/max/875/0*eDy7vUt7XV--gRjR.png" /><figcaption>MicroSui components</figcaption></figure><p><strong>Installing the MicroSui Library</strong><br>To use the MicroSui library, open the Arduino IDE, click on the Library Manager icon, and search for <strong>MicroSui</strong>. Then simply click <strong>Install </strong>to add the MicroSui library to Arduino.</p><figure><img alt="MicroSui Arduino library" src="https://cdn-images-1.medium.com/max/467/0*3gOOygoXsP23M3Pl.png" /><figcaption>MicroSui Arduino kütüphanesi</figcaption></figure><p><strong>Running Examples</strong><br>From the menu <strong>File </strong>→ <strong>Examples </strong>→ <strong>MicroSui </strong>→ <strong>ArduinoExamples</strong>, you can open and run one of the ready-made examples included with the MicroSui library.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*KyLgAlXS0o6FTasD.png" /><figcaption>MicroSui examples</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc41a4a85c6f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MicroSui 0.2.2 ve 0.3.0 Farklılıkları]]></title>
            <link>https://medium.com/@volkan_aktas/microsui-0-2-2-ve-0-3-0-farkl%C4%B1l%C4%B1klar%C4%B1-e73403af9d89?source=rss-e54c8c89b7c6------2</link>
            <guid isPermaLink="false">https://medium.com/p/e73403af9d89</guid>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[esp32]]></category>
            <category><![CDATA[sui]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[arduino]]></category>
            <dc:creator><![CDATA[Volkan Aktaş]]></dc:creator>
            <pubDate>Tue, 02 Sep 2025 11:28:50 GMT</pubDate>
            <atom:updated>2025-09-03T14:57:23.258Z</atom:updated>
            <content:encoded><![CDATA[<p>MicroSui kütüphanesi 0.2.2 sürümünden 0.3.0 sürümüne güncellendiğinde önemli bazı güncellemeler yapıldı. İlk güncelleme offline transaction adımlarının kısaltılması oldu.</p><p>Bu geliştirmeyi karşılaştırmak için öncelikle offline transaction işlemini 0.2.2 sürümü ile yapacağız.</p><p>İlk adımımız Typscript SDK kullanarak mesaja ait txByte’ı gateway üzerinde oluşturmak olacak.</p><p>Öncelikle</p><p>npm install @mysten/sui</p><p>komutuyla sui kütüphanesini uygulama içerisine kuruyoruz.</p><p>gwBuildMessage.ts adlı react typescript kod dosyamızın içeriği aşağıdaki gibi olacak:</p><pre>import { SuiClient, getFullnodeUrl } from &quot;@mysten/sui/client&quot;;<br>import { Transaction } from &quot;@mysten/sui/transactions&quot;;<br><br>const sender =<br>  &quot;0x09af10310fd0d0c344c03a9eb395de869ee454c598a928d53d312c47c33d9b76&quot;;<br>const recipient =<br>  &quot;0x42880be9c6737fa94c3a87f2f645f55a073ada48da288240a2158c9837641743&quot;;<br>const amountToSend = 0.1 * 1000000000;<br><br>async function main() {<br>  console.log(&quot;\n\n\n\n\t\t\t\t GATEWAY BUILD MESSAGE SCRIPT&quot;);<br><br>  console.log(<br>    &quot;\n\n\t\t Tx Details: Transfer &quot; +<br>      amountToSend +<br>      &quot; SUI from &quot; +<br>      sender +<br>      &quot; to &quot; +<br>      recipient<br>  );<br><br>  // 2. Crear el cliente<br>  const client = new SuiClient({ url: getFullnodeUrl(&quot;testnet&quot;) });<br><br>  // 3. Crear transacción<br>  const tx = new Transaction();<br>  const [coin] = tx.splitCoins(tx.gas, [amountToSend]);<br><br>  tx.transferObjects([coin], recipient);<br>  tx.setSender(sender);<br><br>  // 4. Construir la transacción y obtener los bytes<br>  console.log(&quot;\n\n\t\t Building the Message...&quot;);<br>  const txBytes = await tx.build({ client });<br><br>  console.log(<br>    &quot;\n\n\t\t Message to Sign: txBytes (hex):&quot;,<br>    Buffer.from(txBytes).toString(&quot;hex&quot;)<br>  );<br>  console.log(&quot;\n\n Message must be sended to the offline signer device... \n&quot;);<br>}<br><br>main().catch(console.error);</pre><p>Burada sender değişkeninde saklana adres sui gönderecek olan adres iken, recipient ise alıcı adresidir.</p><p>Daha sonra terminal ekranında</p><p>node — loader ts-node/esm src/gwBuildMessage.ts</p><p>komutunu çalıştırarak Offline Signer Message generator işlemini gerçekleştiriyoruz. Karşımıza aşağıdaki gibi bir sonuç çıkacak:</p><figure><img alt="Offline Signer Message generator" src="https://cdn-images-1.medium.com/max/945/1*EKeCRCEj9H_kqwv1AImdCQ.png" /><figcaption>Offline Signer Message generator</figcaption></figure><p>Şimdi ESP32 Arduino kod kısmına geçebiliriz. Kodumuz aşağıdaki gibi olacak:</p><pre>#include &lt;MicroSui.h&gt;<br><br>//// Sui Private Keys - Its the same key in two different formats, so in both examples we will obtain the same signature<br>// PrivateKey in Bech32 Sui Compatible format `suiprivkey1...`, This format is used in most web3 Sui wallets.<br>const char* private_key_1_bech32 = &quot;suiprivkey1abc1234567&quot;;<br><br>//// Sui Message to Sign - Generate your TX Build Message in HEX with `await tx.build({ client });` in Mysten Typescript SDK<br>const char* message_hex = &quot;000002000800e1f50500000000002042880be9c6737fa94c3a87f2f645f55a073ada48da288240a2158c9837641743020200010100000101030000000001010009af10310fd0d0c344c03a9eb395de869ee454c598a928d53d312c47c33d9b76015a83cb2a898f66d5cd9b819f0d5af0a59a0e976dad2401a8a73b47a20c2cd7c7c05e1c1700000000206b24a01db10d4d3ba7ca47c6cec75ff0c604b2a0ceb56b9b6f4c44abe10fb45509af10310fd0d0c344c03a9eb395de869ee454c598a928d53d312c47c33d9b76e80300000000000040ab3c000000000000&quot;;<br><br>void setup() {<br>  Serial.begin(9600);<br>  pinMode(LED_BUILTIN, OUTPUT);<br><br>  delay(1000);<br><br>  Serial.println(&quot;\n\t\t\t --- SUI OFFLINE SIGN Examples ---\n&quot;);<br><br>  Serial.println(&quot;\t\t - Example 1: Sign with BECH32 Private Key (Bech32 Sui Compatible)&quot;);<br>  Serial.print(&quot;\n\t Original Message: &quot;);<br>  Serial.write(message_hex);<br><br>  uint8_t private_key_1[32];<br>  // To obtain the signature the PK must be in hexadecimal format, so we will use the Bech32 MicroSui decoder<br>  if (microsui_decode_sui_privkey(private_key_1_bech32, private_key_1) != 0) {<br>    Serial.println(&quot;Invalid Bech32 private key.\n&quot;);<br>    return;<br>  }<br><br>  uint8_t sui_sig_1[97];<br>  // We obtain the signature here<br>  microsui_sign_message(sui_sig_1, message_hex, private_key_1);<br><br>  char sui_sig_hex_1[195];<br>  // This MicroSui function makes an array hexa into a string for a better visualization (not needed if not printed)<br>  bytes_to_hex(sui_sig_1, 97, sui_sig_hex_1);<br><br>  Serial.print(&quot;\n\n\t Sui Signature (Example 1) - (97 bytes): &quot;);<br>  Serial.write(sui_sig_hex_1);<br><br>  Serial.println(&quot;\n\t SIGNATURE must be sended to the Gateway to be broadcasted to the Sui Network...\n&quot;);  <br>}<br><br>void loop() {<br>  digitalWrite(LED_BUILTIN, HIGH);  <br>  delay(700);                      <br>  digitalWrite(LED_BUILTIN, LOW);  <br>  delay(700);                      <br>}</pre><p>Sui private key iki farklı formatta olabilmektedir. Her iki yöntemle de aynı imzayı elde edilir. Bech32 Sui Uyumlu formattaki private key çoğu web3 Sui cüzdanında kullanılır. Diğer yöntemde ise hexadecimal olarak kodlanmış bir private key kullanılır.</p><p><strong>Kaynak:</strong> <a href="https://sdk.mystenlabs.com/typescript/cryptography/keypairs">https://sdk.mystenlabs.com/typescript/cryptography/keypairs</a></p><p><strong>sui_private_key_bech32</strong> kısmında react kodunda üretilen private key kodunu kopyalayarak ESP32 Arduino kodumuzun içerisinde</p><pre>const char* sui_private_key_bech32 = &quot;suiprivkey1abc1234567&quot;;</pre><p>satırında sui_private_key_bech32 değerine karşılık olarak yapıştırıyoruz.</p><p>Aynı şekilde txtBytes (hex) kısmında da react kodunda üretilen hex kodunu kopyalayarak Arduino kodumuzun içerisinde const char* message_string değerine karşılık olarak yapıştırıyoruz.</p><pre>const char* message_string =<br>  &quot;000002000800e1f50500000000002042880be9c6737fa94c3a87f2f645f55a073ada48da288240a2158c9837641743020200010100000101030000000001010009af10310fd0d0c344c03a9eb395de869ee454c598a928d53d312c47c33d9b76015a83cb2a898f66d5cd9b819f0d5af0a59a0e976dad2401a8a73b47a20c2cd7c7c05e1c1700000000206b24a01db10d4d3ba7ca47c6cec75ff0c604b2a0ceb56b9b6f4c44abe10fb45509af10310fd0d0c344c03a9eb395de869ee454c598a928d53d312c47c33d9b76e80300000000000040ab3c000000000000&quot;;</pre><p>Kodumuzu Arduino içerisine yüklediğimizde seri port ekranında mesaj imzalanarak aşağıdaki gibi yazdırılacaktır.</p><figure><img alt="Signature message" src="https://cdn-images-1.medium.com/max/943/1*Y9aXCwg2j_KWPGsEzO3oJw.png" /><figcaption>Signature message</figcaption></figure><p>Üretilen signature message’ı kopyalayalım. gwBroadCastTx.ts adlı yeni bir react kod dosyası oluşturalım. Kodlarımız aşağıdaki gibi olacak:</p><pre>import { SuiClient, getFullnodeUrl } from &quot;@mysten/sui/client&quot;;<br>import { fromHex } from &quot;@mysten/sui/utils&quot;;<br><br>const message =<br>  &quot;000002000800e1f50500000000002042880be9c6737fa94c3a87f2f645f55a073ada48da288240a2158c9837641743020200010100000101030000000001010009af10310fd0d0c344c03a9eb395de869ee454c598a928d53d312c47c33d9b76015a83cb2a898f66d5cd9b819f0d5af0a59a0e976dad2401a8a73b47a20c2cd7c7c05e1c1700000000206b24a01db10d4d3ba7ca47c6cec75ff0c604b2a0ceb56b9b6f4c44abe10fb45509af10310fd0d0c344c03a9eb395de869ee454c598a928d53d312c47c33d9b76e80300000000000040ab3c000000000000&quot;;<br><br>const cHexSignature =<br>  &quot;000b983a64f59c96666162abb34493de51d77ce7b141b24ea95cb86f0035cf4e805b94b114e0e51885f423ff920f845cb6df1f98a5886f4d9a0818c39e9482fb05685da928806e4290dc924cae091979fc5a94c24c99c00e5c00d389394e6af9fe&quot;;<br><br>async function main() {<br>  console.log(&quot;\n\n\n\n\t\t\t\t GATEWAY BROADCAST SIGNED TX SCRIPT&quot;);<br><br>  console.log(<br>    &quot;\n\n\t\t Broadcasting Tx Details:&quot; +<br>      &quot; \n\t\t\t Message: &quot; +<br>      message +<br>      &quot; \n\t\t\t Device Offline Signature : &quot; +<br>      cHexSignature<br>  );<br><br>  // 1. Creating client<br>  const client = new SuiClient({ url: getFullnodeUrl(&quot;testnet&quot;) });<br>  const cSignature = suiSignatureHexToBase64(cHexSignature);<br><br>  // 2. Send the signed transaction<br>  console.log(&quot;\n\n\t\t Broadcasting the Transaction...\n&quot;);<br>  const result = await client.executeTransactionBlock({<br>    transactionBlock: fromHex(message),<br>    signature: [cSignature],<br>    options: {<br>      showEffects: true,<br>      showEvents: true,<br>    },<br>  });<br><br>  console.log(&quot;\n\t\t TX SENDED TO THE NETWORK!\n\n&quot;);<br><br>  const digest = result.digest;<br><br>  console.log(&quot;\t digest:&quot;, digest);<br>  console.log(&quot;\t https://testnet.suivision.xyz/txblock/&quot; + digest + &quot;\n\n&quot;);<br>}<br><br>main().catch(console.error);<br><br>function suiSignatureHexToBase64(hex: string): string {<br>  if (hex.startsWith(&quot;0x&quot;)) hex = hex.slice(2);<br>  const bytes = new Uint8Array(hex.length / 2);<br>  for (let i = 0; i &lt; bytes.length; i++) {<br>    bytes[i] = parseInt(hex.substr(i * 2, 2), 16);<br>  }<br>  return Buffer.from(bytes).toString(&quot;base64&quot;);<br>}</pre><p>Kodumuzda message değişkeninin içeriğine txMessage değişkeni içeriğini, cHexSignature değişkenine ise Arduino tarafından üretilen Sui Signature değerini yazıyoruz. Daha sonra terminal ekranında</p><p>node — loader ts-node/esm src/gwBroadcastTx.ts</p><p>komutunu yazarak Offline Signer Broadcast Transaction işlemini gerçekleştiriyoruz.</p><figure><img alt="Offline Signer Broadcast Transaction" src="https://cdn-images-1.medium.com/max/945/1*-JUzHr9x76WyNRWJ9hQyfQ.png" /><figcaption>Offline Signer Broadcast Transaction</figcaption></figure><p>Burada</p><p><a href="https://testnet.suivision.xyz/txblock/YTphfRBW74Uip5Vd5aprWnBUDLDpH8DAzeoG4eXYV2b">https://testnet.suivision.xyz/txblock/YTphfRBW74Uip5Vd5aprWnBUDLDpH8DAzeoG4eXYV2b</a></p><p>şeklindeki linke tıklayarak transfer işlemi detaylarını görebiliriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*Eu69Yr2CbOQNyOW7flibrg.png" /><figcaption>Transaction result MicroSui 0.2.2.</figcaption></figure><p>Aynı işlemler MicroSui 0.3.0 ile daha kısalmıştır. gwBroadCastTx.ts adlı react kod dosyası ile son aşamada yaptığımız transaction işlemi artık doğrudan Arduino kod dosyası içerisinde gerçekleşmekte ve transaction linki üretilmektedir. ESP32 Arduino kodlarımızı 0.3.0 sürümüne göre yeniden güncelleyelim. gwBuildMessage.ts adlı kod dosyasındaki private key ve message string değerlerini daha önce yaptığımız gibi Arduino kodlarına ekleyelim.</p><pre>#include &lt;MicroSui.h&gt;<br><br>// --- WiFi credentials (example) ---<br>const char* wifi_ssid = &quot;Wifi name&quot;;<br>const char* wifi_pass = &quot;pass&quot;;<br><br>// --- Sui RPC URL (Testnet) ---<br>const char* rpc_url = &quot;https://fullnode.testnet.sui.io:443/&quot;;<br><br>// --- PRIVATE KEY (EXAMPLE / DO NOT USE IN PRODUCTION) ---<br>const char* sui_private_key_bech32 =<br>  &quot;suiprivkey1abc1234567&quot;;<br><br>// --- Prebuilt TxBytes (generated externally, for now no BCS building inside MicroSui) ---<br>// --- For now, generate your Tx Build Message in HEX with `await tx.build({ client });` in the Mysten Sui Typescript SDK ---<br>const char* message_string =<br>  &quot;000002000800e1f50500000000002042880be9c6737fa94c3a87f2f645f55a073ada48da288240a2158c9837641743020200010100000101030000000001010009af10310fd0d0c344c03a9eb395de869ee454c598a928d53d312c47c33d9b76015a83cb2a898f66d5cd9b819f0d5af0a59a0e976dad2401a8a73b47a20c2cd7c7c05e1c1700000000206b24a01db10d4d3ba7ca47c6cec75ff0c604b2a0ceb56b9b6f4c44abe10fb45509af10310fd0d0c344c03a9eb395de869ee454c598a928d53d312c47c33d9b76e80300000000000040ab3c000000000000&quot;;<br><br>void setup() {<br>  Serial.begin(115200);<br>  pinMode(LED_BUILTIN, OUTPUT);<br>  delay(500);<br><br>  Serial.println();<br>  Serial.println(F(&quot;=== MicroSui ESP32 — Sign &amp; Execute Transaction ===&quot;));<br><br>  // 1) Connect WiFi<br>  Serial.println(F(&quot;\n [1/5] Connecting WiFi...&quot;));<br>  MicroSuiWiFi wifi = WiFi_connect(wifi_ssid, wifi_pass);<br><br>  // 2) Create RPC client<br>  Serial.println(F(&quot;\n [2/5] Creating RPC client...&quot;));<br>  MicroSuiClient client = SuiClient_newClient(rpc_url);<br>  Serial.print(F(&quot;    DONE! - Created Client with RPC URL: &quot;)); Serial.println(rpc_url);<br><br>  // 3) Load keypair from Bech32 secret key<br>  Serial.println(F(&quot;\n [3/5] Loading keypair from Bech32...&quot;));<br>  MicroSuiEd25519 keypair = SuiKeypair_fromSecretKey(sui_private_key_bech32);<br>  Serial.print(F(&quot;    DONE! - Created KeyPair - userAddress: &quot;)); Serial.println(keypair.toSuiAddress(&amp;keypair));<br><br>  // 4) Load prebuilt TxBytes (generated externally)<br>  Serial.println(F(&quot;\n [4/5] Loading prebuilt TxBytes...&quot;));<br>  MicroSuiTransaction tx = SuiTransaction_setPrebuiltTxBytes(message_string);<br>  Serial.println(F(&quot;    DONE! - Created a Sui Transaction object with prebuilt TxBytes&quot;));<br><br>  // 5) Sign + Execute (simplest way: client handles the signature internally)<br>  Serial.println(F(&quot;\n [5/5] Signing and executing...&quot;));<br>  SuiTransactionBlockResponse res1 = client.signAndExecuteTransaction(&amp;client, keypair, tx);<br>  Serial.print(F(&quot;    DONE! - Signed Transaction sended to Sui Network!!&quot;));<br><br>  Serial.println(F(&quot;\n\n --- RPC Response -  Transaction Result ---&quot;));<br>  if (res1.digest)                  { Serial.print(F(&quot;     Digest (Tx ID): &quot;)); Serial.println(res1.digest); }<br>  if (res1.checkpoint)              { Serial.print(F(&quot;     Checkpoint: &quot;)); Serial.println(res1.checkpoint); }<br>  if (res1.confirmedLocalExecution) { Serial.print(F(&quot;     ConfirmedLocalExecution: &quot;)); Serial.println(res1.confirmedLocalExecution); }<br><br>  Serial.print(F(&quot;     BalanceChanges count: &quot;));<br>  Serial.println(res1.balanceChanges_len);<br><br>  for (int i = 0; i &lt; res1.balanceChanges_len; i++) {<br>    Serial.print(F(&quot;      #&quot;)); Serial.println(i + 1);<br>    if (res1.balanceChanges[i].amount)   { Serial.print(F(&quot;        amount: &quot;));   Serial.println(res1.balanceChanges[i].amount); }<br>    if (res1.balanceChanges[i].coinType) { Serial.print(F(&quot;        coinType: &quot;)); Serial.println(res1.balanceChanges[i].coinType); }<br>    if (res1.balanceChanges[i].owner)    { Serial.print(F(&quot;        owner: &quot;));    Serial.println(res1.balanceChanges[i].owner); }<br>  }<br>  Serial.print(F(&quot;\n&quot;));<br><br>  // Clean transaction (important to avoid memory leaks)<br>  tx.clear(&amp;tx);<br><br>  // Disconnect WiFi<br>  wifi.disconnect(&amp;wifi);<br><br>  Serial.println(F(&quot;  Done.&quot;));<br>}<br><br>void loop() {<br>  digitalWrite(LED_BUILTIN, HIGH);  // turn LED on<br>  delay(700);<br>  digitalWrite(LED_BUILTIN, LOW);   // turn LED off<br>  delay(700);<br>  Serial.println(F(&quot;\n  Done. Reboot the board to run the example again.&quot;));<br>}</pre><p>Aşağıdaki sonuçta da görüldüğü gibi artık signature message’ı gwBroadCastTx.ts adlı react kod dosyasına ekleyip Offline Signer Broadcast Transaction işlemini yapmadan doğrudan MicroSui ile Arduino kodları içerisinden offline signing işlemini yapabiliyoruz.</p><figure><img alt="Transaction MicroSui 0.3.0" src="https://cdn-images-1.medium.com/max/944/1*mDPXxNJNfHGs99SYMK2mQA.png" /><figcaption>Transaction MicroSui 0.3.0</figcaption></figure><p>Burada</p><p>YTphfRBW74Uip5Vd5aprWnBUDLDpH8DAzeoG4eXYV2b</p><p>Şeklinde üretilen Digest (TX ID) kodunu</p><p><a href="https://testnet.suivision.xyz/txblock/YTphfRBW74Uip5Vd5aprWnBUDLDpH8DAzeoG4eXYV2b">https://testnet.suivision.xyz/txblock/YTphfRBW74Uip5Vd5aprWnBUDLDpH8DAzeoG4eXYV2b</a></p><p>şeklinde düzenleyip web tarayıcıda kontrol ettiğimizde transaction detaylarını görebiliriz.</p><figure><img alt="MicroSui 0.3.0 Transaction sonucu" src="https://cdn-images-1.medium.com/max/944/1*FEM07I8R857ewN9DkvDu7g.png" /><figcaption>MicroSui 0.3.0 Transaction sonucu</figcaption></figure><p>ESP32 kodlarını incelediğimizde</p><pre>MicroSuiWiFi wifi = WiFi_connect(wifi_ssid, wifi_pass);</pre><p>Satırı dikkatinizi çekmiştir. Evet artık MicroSui’inin doğrudan WiFi bağlantısı için kendi metotları var. Daha önce</p><pre>#include &lt;WiFi.h&gt;<br>WiFi.begin(ssid, password);</pre><p>Şeklinde WiFi.h kütüphanesi ile yaptığımız kablosuz bağlantı işlemi artık yalnızca MicroSui kütüphanesi ile gerçekleştirebiliyoruz.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e73403af9d89" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Micro Sui]]></title>
            <link>https://medium.com/@volkan_aktas/micro-sui-ff97679daeee?source=rss-e54c8c89b7c6------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff97679daeee</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[esp32]]></category>
            <category><![CDATA[sui]]></category>
            <category><![CDATA[arduino]]></category>
            <dc:creator><![CDATA[Volkan Aktaş]]></dc:creator>
            <pubDate>Tue, 02 Sep 2025 10:06:00 GMT</pubDate>
            <atom:updated>2025-09-02T10:45:54.746Z</atom:updated>
            <content:encoded><![CDATA[<h3>Micro Sui Kütüphanesi ve Kurulumu</h3><p>MicroSui — Sui Embedded Framework — neredeyse tüm mikrodenetleyicilerle uyumlu Sui Protokolü işlevselliği getiren hafif, modüler ve açık kaynaklı C dili tabanlı bir framework’tur. Anahtar yönetimi, işlem oluşturma, imzalama ve yayınlama (transaction construction, signing and broadcast) gibi tüm temel işlemleri, işletim sistemi bağımlılığı veya dinamik bellek kullanımı olmadan, saf bir C kütüphanesi ile sunar ve 8 bitten 32 bit ARM yongalarına kadar mikrodenetleyici cihazlara kolayca entegre edilmesini sağlar.</p><figure><img alt="MicroSui Arduino Kütüphane örnek kodları" src="https://cdn-images-1.medium.com/max/944/1*WmFMkP7-KllEGv5ly3e1jw.png" /><figcaption>MicroSui kütüphanesi kodu örneği</figcaption></figure><p><strong>Sui Üzerindeki Bazı Kullanım Örnekleri:</strong></p><p>- Offline Signature — Çevrimdışı İmza (Blind &amp; Semi-Blind)</p><p>- Sensör Olay Tetiklemeli İşlem</p><p>- Donanım Cüzdanı</p><p>- Akıllı Ücret Toplama</p><p>- End-to-End Transaction Flow — Uçtan Uca İşlem Akışı</p><p>- Zamanlı İmzalama</p><p>- Blok Zinciri üzerinde Endüstriyel Olay Kayıtları</p><p>- Çoklu İmza Katılımı — Multisig Participation</p><p>ESP32 gibi yüksek güçlü, WiFi özellikli devre geliştirme kartları için, HTTPS veya WebSockets üzerinden Sui RPC uç noktalarına bağlanma, işlemleri cihazda yerel olarak oluşturma ve imzalama, bunları doğrudan ağa yayınlama ve zincir içi verileri sorgulama gibi eksiksiz bir uçtan uca işlem akışı sağlayabilmektedir.</p><p>Sınırlı bağlantıya sahip kısıtlı cihazlar (örneğin, LoRa, BLE, düşük güçlü ARM veya AVR çipsetleri), MQTT veya CoAP gibi hafif köprü protokolleri aracılığıyla (ve NFC veya 433MHz Vericiler aracılığıyla ham veri gibi daha temel iletişim seçenekleri de mevcuttur) katılabilir; önceden oluşturulmuş mesajları alıp gömülü PK’leriyle(Private Key) imzalayabilir ve ardından işlemi yayınlamak için ağ geçidine geri gönderebilir.</p><figure><img alt="MicroSui bileşenleri" src="https://cdn-images-1.medium.com/max/944/1*PK_Xh2Gy0PVvIF-mFLY4wQ.png" /><figcaption>MicroSui bileşenleri</figcaption></figure><h3>MicroSui Kütüphanesi Kurulumu</h3><p>MicroSui kütüphanesini kullanabilmek için Arduino IDE’sinde Library Manager simgesine tıklayarak arama bölümüne MicroSui yazıyoruz. Ardından Install butonuna tıklayarak MicroSui kütüphanesine Arduino içerisine kuruyoruz.</p><figure><img alt="MicroSui Arduino kütüphanesi" src="https://cdn-images-1.medium.com/max/467/1*ye-oqFloZeIFcNQuJ_xp2g.png" /><figcaption>MicroSui Arduino kütüphanesi</figcaption></figure><p>File/Examples/MicroSui/ArduinoExamples menüsünden MicroSui kütüphanesi ile birlikte gelen hazır örneklerden birini açıp uygulayabilirsiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*m2OY4-kB7zbV-nYvhfeoPQ.png" /><figcaption>MicroSui örnekleri</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff97679daeee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter İçin Ide ve Emülatör Ayarları]]></title>
            <link>https://medium.com/@volkan_aktas/flutter-i%CC%87%C3%A7in-ide-ve-em%C3%BClat%C3%B6r-ayarlar%C4%B1-78f0f3dc089d?source=rss-e54c8c89b7c6------2</link>
            <guid isPermaLink="false">https://medium.com/p/78f0f3dc089d</guid>
            <category><![CDATA[ide]]></category>
            <category><![CDATA[emulator]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Volkan Aktaş]]></dc:creator>
            <pubDate>Wed, 29 Jul 2020 17:28:47 GMT</pubDate>
            <atom:updated>2020-07-29T17:28:47.908Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>IDE AYARLARI</strong></p><p>Flutter uygulamalarınızı Android Studio, Visual Studio Code ve IntelliJ Idea ile geliştirebilirsiniz.</p><p>Android Studio için File / Settings / Plugins menüsünden Flutter plugin’ini yükleyebilirsiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ADC3LYjiDE5qRxibv5GzzQ.png" /></figure><p>Bu işlemin ardından File / New / New Flutter Project seçeneğiyle Flutter uygulaması geliştirmeye başlayabilirsiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P2UvOqIMFZy_uOvXbnEaJQ.png" /></figure><p>Visual Studio Code içinse Extensions bölümünden Flutter Extension’u kurmalısınız.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*actTY90Nx6r1nIO_jGrVbg.png" /></figure><p>JetBrains IntelliJ Idea uygulaması içinse File / Settings seçenekleri ile gelen pencereden Plugins sekmesinde Flutter plugin’i seçerek kuruyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jNQFxUwlfrfKwhtsAJ1TLg.png" /></figure><p>Ayrıca New Project penceresinde bilgisayarımızdaki Flutter SDK Path’ini belirtmeliyiz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*STfGcYKAStMRArjv0RhHeA.png" /></figure><p><strong>EMÜLATÖR AYARLARI</strong></p><p>Android Studio içerisinde emülatör ayarlarını yapmak için açılış penceresinde Configure bölümünden AVD Manager menüsüne tıklıyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SzCvqfzCNjvhHjtMuiN_Wg.png" /></figure><p>Gelen pencerede Create Virtual Device butonuna tıklıyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*McbXHe0yKpDpK1hpV9o4Kw.png" /></figure><p>Gelen emülatör listesinde uygun cihazı seçerek Next butonuna tıklıyoruz. Biz örnek olarak Pixel 2 emülatörünü seçiyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-8j_EmdxrdMSBAqRuaxY-Q.png" /></figure><p>Daha sonra gelen pencerede Android API sürümünü seçiyoruz. Biz örnek olarak Api 28 seçeneğini seçerek Next butonuna tıklıyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YWLXM2s-Co38cCxcAHlevg.png" /></figure><p>Son penceremizde emülatörle ilgili genel ayarları yapıyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gf-WjMHYfPksAV-apiSu3Q.png" /></figure><p>Bu işlemlerin ardından emülatörümüz AVD emülatör penceresine eklenecektir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZKu1otWHgtnWa27fwl_ZKg.png" /></figure><p>Emülatör isminin bulunduğu satırdaki Actions bölümünde play butonuna tıklayarak emülatörümüzü çalıştırıyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*5ku_rE6gE2u7e0tvtRhDyA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78f0f3dc089d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter ve Kurulumu]]></title>
            <link>https://medium.com/@volkan_aktas/flutter-ve-kurulumu-a87e3f4c1a8c?source=rss-e54c8c89b7c6------2</link>
            <guid isPermaLink="false">https://medium.com/p/a87e3f4c1a8c</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <dc:creator><![CDATA[Volkan Aktaş]]></dc:creator>
            <pubDate>Sun, 26 Jul 2020 08:57:44 GMT</pubDate>
            <atom:updated>2020-07-26T08:57:44.789Z</atom:updated>
            <content:encoded><![CDATA[<p>Mobil uygulamalar hybrid, native ve cross olmak üzere 3 biçimde geliştirilebilir. Native uygulamalarda ios tarafında swift veya objective-c ile uygulama geliştirilirken android tarafında java veya kotlin ile uygulama geliştirilir. Hybrid uygulamalarda ise responsive bir web sayfasını bir web view içerisinde görüntüleyerek sanki bir mobil uygulama gibi kullanıcıya gösterilir. Hybrid uygulamalarda gerçek bir mobil uygulama hissi yaşanamaz. Cross platform uygulamalarda ise Flutter, React Native, Angular gibi SDK’larla hem Android hem de IOS tarafında çalışabilecek uygulamalar yazabilirsiniz.</p><p>Flutter kullanımı aşağıdaki ihtiyaçlardan kaynaklanmaktadır.</p><ul><li>Native olmayan uygulamaların dezavantajı olan performans kaybını ortadan kaldırır.</li><li>Tek code base ile iki platform için de uygulama ortaya çıkarma ihtiyacı.</li><li>Hızlı öğrenme süreci. Dart programlama dili kod yapısı C#, C++, Python ile çok benzerlik göstermektedir. Dolayısıyla bu programlama dilleri ile tecrübesi olanlar Dart diline kolayca uyum sağlayabilir.</li><li>Native çıktı alıyor olmak.</li></ul><p><strong>FLUTTER KURULUMU</strong></p><p>Flutter uygulaması geliştirmek için öncelikle Flutter SDK’sını kurmalıyız. Flutter SDK’sını</p><p><a href="https://flutter.dev/docs/get-started/install"><strong>https://flutter.dev/docs/get-started/install</strong></a></p><p>adresinden indirerek kurmalıyız. Burada Windows, MacOS ve Linux sürümleri mevcuttur. İşletim sisteminize uygun versiyonu indirebilirsiniz.</p><p>İndirme işleminin bitmesinin ardından indirdiğimiz zip dosyasını C:\src\flutter gibi bir klasöre açmalıyız. Flutter’ı C:\Program Files\ gibi erişim izni gerektiren bir klasöre açmamaya dikkat etmeliyiz.</p><p>Flutter SDK’sını direkt olarak kurmak istediğiniz klasörde komut satırından</p><p><strong>C:\src&gt;git clone </strong><a href="https://github.com/flutter/flutter.git"><strong>https://github.com/flutter/flutter.git</strong></a><strong> -b stable</strong></p><p>Komutunu yazarak github üzerinden de kurabilirsiniz.</p><p>Flutter uygulaması geliştirmek için sisteminizde Android Studio ile birlikte Android ve iOS SDK’lerinin de kurulu olması gerekiyor.</p><p><a href="https://developer.android.com/studio"><strong>https://developer.android.com/studio</strong></a></p><p>adresinden Android Studio’yu indirip kuruyoruz.</p><p>Daha sonra Java SE Development Kit’i</p><p><a href="https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html"><strong>https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html</strong></a></p><p>adresinden indirerek kurmanız gerekiyor.</p><p>Kurulumlar bittikten sonra path ayarlarını yapmamız gerekiyor. Bilgisayarım simgesine farenin sağ tuşu ile tıklayarak gelen menüden Gelişmiş Sistem Ayarları’nı tıklayalım ve gelen Sistem Özellikleri penceresinden Gelişmiş sekmesini açalım. Bu sekmedeki Ortam Değişkenleri butonunu tıklıyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*I0SfAx-gg0b0bOQ1xMy86A.png" /><figcaption>Sistem Özellikleri Penceresi</figcaption></figure><p>Gelen pencerede Yeni butonuna tıklıyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ENzuj9l-HQuiMSm-9dhYfg.png" /><figcaption>Ortam Değişkenleri Penceresi</figcaption></figure><p>Öncelikle sistem Değişkenlerine “ANDROID_HOME” değişkenimizi ekleyeceğiz.</p><p>Değişken adı olarak “ANDROID_HOME” ifadesini, değişken bölümüne de bilgisayarınızdaki Android SDK yolunu yazıyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zR6ltjB6nq8vrQMr0iZ-Tw.png" /><figcaption>Yeni Sistem Değişkeni Penceresi</figcaption></figure><p>ANDROID_HOME değişkenini ekledikten sonra yine Ortam Değişkenleri penceresinde PATH değişkenini seçerek Düzenle butonuna tıklıyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S-ESrkJNljnjpKFVpEcFHQ.png" /></figure><p>Gelen pencerede Yeni butonuna tıklayarak aşağıdaki satırı kopyalayıp yapıştırıyoruz.</p><p><strong>%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools</strong></p><p><strong>C:\Users\volkan\AppData\Local\Android\Sdk\platform-tools</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*uvXqmGH6lOqaqU9725rNcA.png" /></figure><p>Ayrıca aynı şekilde Flutter SDKS’sı için “C:\src\flutter\bin” yolunu Path değişkenine ekliyoruz.</p><p>Tüm bu işlemlerin ardından editör, emülatör, sdk ayarlarının doğruluğunu kontrol etmek için komut satırından</p><p><strong>flutter doctor</strong></p><p>yazabiliriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iIPdpjL62gp9rVCGD3hZRQ.png" /></figure><p>Bundan sonraki makalemde flutter uygulamalarınızı yazmak için kullanacağınız IDE’leri tanıtarak gerekli ayarlamaların nasıl yapıldığını yazacağım.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a87e3f4c1a8c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Go Dili İle Bir Klasördeki Resimleri Boyutlandırma]]></title>
            <link>https://medium.com/@volkan_aktas/go-dili-i%CC%87le-bir-klas%C3%B6rdeki-resimleri-boyutland%C4%B1rma-38eb815b6e4d?source=rss-e54c8c89b7c6------2</link>
            <guid isPermaLink="false">https://medium.com/p/38eb815b6e4d</guid>
            <category><![CDATA[image-processing]]></category>
            <category><![CDATA[go]]></category>
            <category><![CDATA[turkish]]></category>
            <category><![CDATA[türkçe]]></category>
            <category><![CDATA[golang]]></category>
            <dc:creator><![CDATA[Volkan Aktaş]]></dc:creator>
            <pubDate>Sat, 18 Jul 2020 18:26:04 GMT</pubDate>
            <atom:updated>2020-07-18T18:26:04.062Z</atom:updated>
            <content:encoded><![CDATA[<p>Uygulamamız bir klasörün içerisindeki resimleri belirtilen genişlik ve yükseklik değerlerine göre toplu olarak boyutlandırmaktadır. Kendi ihtiyacıma göre hazırladığım için içerisinde çalıştırıldığı klasör yolunu otomatik olarak almakta ve bu klasördeki resimleri boyutlandırmaktadır. Uygulama go dili ile yaptığım ilk proje olduğu için hatalarım olabilir, kusura bakmayın. Kodumuz aşağıdaki gibi olacak:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a45ee48ba8a044d86d95578bcd027344/href">https://medium.com/media/a45ee48ba8a044d86d95578bcd027344/href</a></iframe><p>Kodumuzda klasör ve dosya işlemleri için</p><blockquote>“os”</blockquote><blockquote>“path/filepath”</blockquote><p>Kütüphanelerini kullandık. <strong>“os”</strong> kütüphanesi dosya ve klasörler üzerinde kopyalama, taşıma, silme vb. gibi işlemler için kullanılırken, <strong>“path/filepath”</strong> kütüphanesini özellikle <strong>Walk</strong> metodu ile recursive olarak yani tüm alt klasörlere kadar inerek resimleri araması amacıyla kullanıyoruz.</p><blockquote>fmt.Println(“Enter Image Width:”)</blockquote><blockquote>var imgWidth int</blockquote><blockquote>fmt.Scanln(&amp;imgWidth)</blockquote><blockquote>fmt.Println(“Enter Image Height:”)</blockquote><blockquote>var imgHeight int</blockquote><blockquote>fmt.Scanln(&amp;imgHeight)</blockquote><p>satırlarında <strong>Println</strong> ekrana yazdırma metodu ve <strong>Scanln</strong> ekrandan değer okuma metodlarını kullanarak resim boyutlandırma işleminde kullanılacak genişlik ve yükseklik değerlerini kullanıcıdan istiyoruz.</p><blockquote>var fileInfo os.FileInfo</blockquote><blockquote>searchDir, _ := os.Getwd()</blockquote><blockquote>fileList := []string{}</blockquote><blockquote>err := filepath.Walk(searchDir, func(path string, f os.FileInfo, err error) error {</blockquote><blockquote>fileList = append(fileList, path)</blockquote><blockquote>return nil</blockquote><blockquote>})</blockquote><p>Satırlarında klasör içerisindeki resim dosyalarını listelemek için gerekli işlemleri gerçekleştiriyoruz. Öncelikle <strong>os.Getwd()</strong> metodu ile uygulamamızın çalıştığı klasör yolunu elde ederek <strong>searchDir</strong> değişkenine aktarıyoruz. Böylelikle kodumuz, çalıştırıldığı klasördeki dosyalar üzerinde işlem gerçekleştirecektir.</p><p>Daha sonra <strong>filepath.Walk()</strong> metoduyla recursive olarak içerisinde bulunulan klasör ve alt klasörleri elde ediyoruz. Filepath.Walk() metodunun kullanım şekli aşağıdaki gibidir:</p><blockquote>func Walk(root string, walkFn WalkFunc) error</blockquote><p><strong>root</strong> parametresi kök dizini belirtirken, <strong>walkFn</strong> parametresi klasörler arasında gezinirken çağrılacak fonksiyonu belirtir.</p><p>Foksiyonumuzu ise</p><blockquote>type WalkFunc func(path string, info os.FileInfo, err error) error</blockquote><p>Şeklinde tanımlıyoruz. <strong>path</strong> parametresi klasör yolunu, <strong>info</strong> parametresi belirtilen yol için <strong>os.FileInfo</strong> bilgilerini verir.</p><p><strong>os.FileInfo</strong> bize aşağıdaki bilgileri geriye döndürür.</p><p><strong>Name() string</strong> : Dosya adı bilgisini içerir</p><p><strong>Size() int64</strong> : Dosya boyutu bilgisini içerir</p><p><strong>Mode() FileMode</strong> : Dosya modu bilgisini içerir.</p><p><strong>ModTime() time.Time :</strong> Son düzenleme zamanı bilgisini içerir.</p><p><strong>IsDir() bool :</strong> Belirtilen yolun klasör olup olmadığı bilgisini verir. Mode().IsDir() ile aynı görevi yapar.</p><p>Konunun daha iyi anlaşılması için <strong>Os.FileInfo</strong> ile belirtilen yolun dosya mı klasör mü olduğu bilgisini veren bir örnek verelim.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ef23460642aab2f79860b1cba5f8d3d0/href">https://medium.com/media/ef23460642aab2f79860b1cba5f8d3d0/href</a></iframe><p>Kodumuzda <strong>os.Stat</strong> ile belirtilen yolla ilgili dosya ya da klasör bilgisini <strong>os.FileInfo</strong> türünden elde ettik. <strong>fileInfo.Mode</strong> arayüzünü kullanarak <strong>IsDir()</strong> ve <strong>IsRegular()</strong> metodları ile belirtilen yolun dosya ya da klasör olup olmadığı bilgisini elde ettik.</p><p>Kodumuzu açıklamaya kaldığımız yerden devam edelim. Kodumuzda</p><blockquote>fileList = append(fileList, path)</blockquote><p>satırında okunan dosya yolu bilgisini fileList isimli dizi değişkene aktarıyoruz.</p><blockquote>for _, file := range fileList {</blockquote><p>satırında fileList dizisi içerisindeki dosya isimlerini okuyacak bir for döngü kuruyoruz. Döngü içerisinde</p><blockquote>fileInfo, err = os.Stat(file)</blockquote><p>satırında belirtilen yolla ilgili dosya ya da klasör bilgisini elde ettik.</p><blockquote>if fileInfo.IsDir() {</blockquote><blockquote>continue</blockquote><blockquote>}</blockquote><p>Satırında eğer belirtilen yol bir klasör ise <strong>continue</strong> metodu ile döngünün sıradaki adımının atlanarak, döngünün bir sonraki adımdan devam etmesi sağlanır.</p><blockquote>src, err := imaging.Open(file)</blockquote><p>satırında eğer belirtilen yol bir dosya ise, dosyanın bir imaj dosyası olarak açılarak <strong>src</strong> değişkenine aktarılması sağlanır.</p><blockquote>dstImage := imaging.Resize(src, imgWidth, imgHeight, imaging.Lanczos)</blockquote><p>satırında <strong>imaging.Resize()</strong> metodu ile resim dosyasının yeniden boyutlandırılması sağlanır.</p><p><strong>imaging.Resize</strong> metodu aşağıdaki gibi kullanılır.</p><blockquote>imaging.Resize(kaynak resim dosyası, genişlik değeri, yükseklik değeri, resim filtresi)</blockquote><p><strong>resim filtresi</strong> parametresinde şu seçenekler kullanılabilir: NearestNeighbor, Box, Linear, Hermite, MitchellNetravali, CatmullRom, BSpline, Gaussian, Lanczos, Hann, Hamming, Blackman, Bartlett, Welch, Cosine.</p><p>Kodumuzda kullandığımız <strong>Lanczos</strong> filtresi fotoğraflar için keskin sonuçlar veren yüksek kaliteli bir filtredir. Filtrelerle ilgili daha detaylı bilgi için imaging kütüphanesini <a href="https://github.com/disintegration/imaging"><strong><em>https://github.com/disintegration/imaging</em></strong></a></p><p>adresinden inceleyebilirsiniz.</p><p>Sonraki aşamada resim dosyalarını yeniden isimlendireceğiz. Öncelikle</p><blockquote>var extension = filepath.Ext(file)</blockquote><p>satırında <strong>filepath.Ext()</strong> metodu ile belirtilen imaj dosyasının uzantısını elde ediyoruz.</p><blockquote>var name = file[0 : len(file)-len(extension)]</blockquote><p>satırında ise dosya ismi bilgisini elde ediyoruz. Bunun için dosya ismi ve uzantısı bilgisinden <strong>(len(file))</strong>, dosya uzantısını <strong>(len(extension))</strong> çıkarıyoruz.</p><blockquote>err = imaging.Save(dstImage, name+”_.”+extension)</blockquote><p>Satırında <strong>imaging.Save()</strong> metoduyla resim dosyasını “dosyaadı_.uzantı” şeklinde kaydediyoruz.</p><p>Kaynak kodlara</p><p><a href="https://github.com/volkanaktas/Image-Resizer"><strong><em>https://github.com/volkanaktas/Image-Resizer</em></strong></a></p><p>adresinden erişebilirsiniz.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38eb815b6e4d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenCV ile Resim Ve Video Üzerine Yazı Ekleme, Türkçe Karakter Kullanımı]]></title>
            <link>https://medium.com/@volkan_aktas/opencv-ile-resim-ve-video-%C3%BCzerine-yaz%C4%B1-ekleme-t%C3%BCrk%C3%A7e-karakter-kullan%C4%B1m%C4%B1-5699c627ae2f?source=rss-e54c8c89b7c6------2</link>
            <guid isPermaLink="false">https://medium.com/p/5699c627ae2f</guid>
            <category><![CDATA[türkçe]]></category>
            <category><![CDATA[image-processing]]></category>
            <category><![CDATA[turkish]]></category>
            <category><![CDATA[opencv]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Volkan Aktaş]]></dc:creator>
            <pubDate>Tue, 14 Jul 2020 10:34:10 GMT</pubDate>
            <atom:updated>2020-07-14T10:34:10.623Z</atom:updated>
            <content:encoded><![CDATA[<p>OpenCV ile putText metodunu kullanarak resim ve video dosyaları üzerine yazı, resim ekleyebilir ya da çeşitli şekiller çizebilirsiniz.</p><p><strong>putText Metodu:</strong></p><p><strong>putText</strong> metodu bir metni çizmek amacıyla kullanılan bir metoddur.</p><p><strong>putText</strong> metodu</p><p><strong>cv.PutText(img, text, org, font, color)</strong></p><p>Şeklinde kullanılır. Bu parametreler aşağıdaki gibidir:</p><p><strong>img :</strong> Resim.</p><p><strong>text :</strong> Resim üzerine çizilecek yazı.</p><p><strong>org :</strong> Resim üzerine çizilecek yazının sol alt köşesi.</p><p><strong>fontFace :</strong> Yazı tipi. FONT_HERSHEY_SIMPLEX, FONT_HERSHEY_PLAIN, FONT_HERSHEY_DUPLEX, FONT_HERSHEY_COMPLEX, FONT_HERSHEY_TRIPLEX, FONT_HERSHEY_COMPLEX_SMALL, FONT_HERSHEY_SCRIPT_SIMPLEX, FONT_HERSHEY_SCRIPT_COMPLEX değerlerini alır.</p><p><strong>fontScale :</strong> Yazı boyutunu belirlemek için kullanılacak ölçeklendirme değeri.</p><p><strong>color :</strong> Yazı rengi.</p><p><strong>thickness :</strong> Resim üzerine eklenecek yazıyı çizmekte kullanılacak çizgilerin kalınlığı.</p><p><strong>lineType :</strong> Çizgi tipi. Aşağıdaki değerleri alır:</p><p>- 8 : (8 bağlantılı çizgi)</p><p>- 4 : (4 bağlantılı çizgi)</p><p>- CV_AA : Kenar yumuşatmalı çizgi.</p><p><strong>bottomLeftOrigin :</strong> true değerini aldığında, resim sol alt köşededir. Aksi takdirde, sol üst köşede olur.</p><p>Örnek olarak disk üzerinde önceden kaydedilmiş bir resmin üzerine belirtilen yazıyı ekleyen bir uygulama yapalım.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3fa4be4fcfb4703aa775661a3dffa6d2/href">https://medium.com/media/3fa4be4fcfb4703aa775661a3dffa6d2/href</a></iframe><p>Kodumuzda parametreler cv2.imread() metodu ile okuduğumuz resim dosyası üzerine putText medodu ile 10,70 koordinatlarında bir yazı ekledik. (255,0,0) RGB renk kodları ile mavi rengi ifade ederken, 3 çizgi kalınlığını ifade ediyor. 1.0 ise yazı fontu büyüklüğünü belirtiyor.</p><p><strong>Not:</strong> OpenCV’de varsayılan renk formatına genellikle RGB denir, ancak aslında BGR’dir (baytlar tersine çevrilir). RGB renk kodları burada BGR sıralamasıyla yer almaktadır. Bu nedenle, standart (24 bit) renk görüntüsündeki ilk bayt 8 bitlik bir mavi bileşen, ikinci bayt yeşil ve üçüncü bayt kırmızı olacaktır. Örneğin (255,0,0) mavi rengi belirtirken, (0,0,255) kırmızı rengi belirtir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i_KeTrNT-48eGqxAGs1Ebg.png" /></figure><p>Programlama dillerinde birden fazla satırdan oluşan bir metin yazdırmak istediğimizde “\n” (newline) karakterini kullanarak yeni satırlar tanımlayabiliyoruz. Ancak putText metodu bu karakteri yeni satır karakteri olarak algılamıyor. Bunun için aşağıdaki gibi döngü yapılarını kullanarak bu sorunun üstesinden gelebiliriz.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6560999ea909fb2d0ba808dcc0db3b8a/href">https://medium.com/media/6560999ea909fb2d0ba808dcc0db3b8a/href</a></iframe><p>Kodumuzda</p><blockquote>for i, txt in enumerate(text.split(‘\n’)):</blockquote><p>satırında for döngüsü içerisinde text değişkeni içerisinde bulunan metnimizi <strong>split()</strong> metodu ile “\n” karakterine göre parçalara ayırarak txt değişkenine aktarıyoruz. Döngünün her adımında txt değişkeni içerisinde saklanan parçalardan her birini yazdırıyoruz.</p><p>Her yazdırmadan sonra satır değerini</p><blockquote>y = y+30</blockquote><p>satırında 30 piksel arttırıyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JzhfAeBIVi23Duvv_MO2Fg.png" /></figure><p><strong>openCV ile Türkçe Karakter Kullanımı</strong></p><p>putText metodu ile Türkçe karakter içeren bir metni maalesef yazdıramıyoruz. Örnek olarak Türkçe karakterler içeren bir metni putText metodu ile yazdırmayı deneyelim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JcPtWea7Z4tk9wSTq4XW0g.png" /></figure><p>Görüldüğü gibi Türkçe karakterler doğru biçimde görüntülenmiyor. Bunun için PIL (Python Image Library) kütüphanesini kullanarak yazdırma işlemini gerçekleştireceğiz. Bu kütüphane unicode, utf-8 ve ascii karakterlere destek vermektedir. Kodumuz aşağıdaki gibi olacak:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ff166e7dbebd603ea5dad6e5c355b62b/href">https://medium.com/media/ff166e7dbebd603ea5dad6e5c355b62b/href</a></iframe><p>Kodumuzda</p><blockquote>pil_im = Image.fromarray(resim)</blockquote><p>satırında Image.fromarray() metodu ile belirtilen resim dosyasından bir imaj bellek dosyası oluşturuyoruz.</p><blockquote>draw = ImageDraw.Draw(pil_im)</blockquote><p>satırında belirtilen resimden çizim yapmak için kullanılacak bir nesne oluşturuyoruz.</p><blockquote>font = ImageFont.truetype(“Hickory Jack.ttf”, 55, encoding=”utf-8&quot;)</blockquote><p>Satırında uygulamamızın çalıştığı klasörde bulunan font dosyasını kullanarak bir font nesnesi tanımlıyoruz.</p><blockquote>draw.text((30, y), txt, (0, 100, 0), font=font)</blockquote><p>satırında txt değişkeni içerisindeki metni resmin üzerine çiziyoruz.</p><blockquote>cv2_text_im = cv2.cvtColor(np.array(pil_im), cv2.COLOR_BGR2BGRA)</blockquote><p>satırında çizimimizi cv2.cvtColor metodu ile openCV resim formatına dönüştürerek</p><blockquote>cv2.imshow(“Resim”,cv2_text_im)</blockquote><p>satırı ile resmimizi bir pencere içerisinde görüntülüyoruz.</p><p>Uygulamamızı çalıştırıp, resmimizi görüntülediğimizde Türkçe karakterlerin doğru biçimde görüntülendiğini görüyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XelHfjQ9_EWdexyv68IOlQ.png" /></figure><p>PIL (Python Image Library) kütüphanesini kullanarak video üzerine yazdırma uygulaması yapalım. Kodumuz aşağıdaki gibi olacak:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7bb6d845747900b6a64a8562905a2884/href">https://medium.com/media/7bb6d845747900b6a64a8562905a2884/href</a></iframe><p>Uygulamamızda</p><blockquote>video = cv2.VideoCapture(‘ D:/video.mp4’);</blockquote><p>Satırında video isimli video isminde bir değişken tanımlayarak VideoCapture metodu ile belirtilen video dosyasını aktarıyoruz.</p><p>Video dosyamızı görüntülemek için sürekli çalışan bir while döngüsü kuruyoruz.</p><blockquote>ret, frame = video.read()</blockquote><p>Satırında ret ve frame isimli değişkenler tanımlıyoruz. ret değişkeni işlem sonucunu tutarken, frame değişkenini videonun her bir frame’ini okumak amacıyla kullanıyoruz.</p><blockquote>pil_im = Image.fromarray(frame)</blockquote><p>satırında Image.fromarray() metodu ile video dosyasından okuduğumuz frame ile bir imaj bellek dosyası oluşturuyoruz.</p><blockquote>draw = ImageDraw.Draw(pil_im)</blockquote><p>satırında belirtilen resimden çizim yapmak için kullanılacak bir nesne oluşturuyoruz.</p><blockquote>draw.text((0, 70), text, (0, 0, 255), font=font)</blockquote><p>satırında <strong>font</strong> değişkeni içerisinde tanımladığımız yazı tipi ile, <strong>text</strong> değişkeni içerisindeki metni kırmızı renkle resmin üzerine çiziyoruz.</p><blockquote>cv2_text_im = cv2.cvtColor(np.array(pil_im), cv2.COLOR_BGR2BGRA)</blockquote><p>satırında çizimimizi cv2.cvtColor metodu ile openCV resim formatına dönüştürerek</p><blockquote>cv2.imshow(“frame”,cv2_text_im)</blockquote><p>satırı ile video dosyasından okuduğumuz frame üzerine yazımızı ekleyerek sırasıyla frame’leri pencere içerisinde görüntülüyor ve video dosyamızı oynatıyoruz.</p><p>Kodumuzu çalıştırdığımızda video üzerinde belirttiğimiz koordinatlarda yazının görüntülendiğini görebiliriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_m9hwjPZvMm4vdfSqKe5rA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5699c627ae2f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenCV İle Resim ve Video Görüntüleme, Yazma, Kaydetme]]></title>
            <link>https://medium.com/@volkan_aktas/opencv-i%CC%87le-resim-ve-video-g%C3%B6r%C3%BCnt%C3%BCleme-yazma-kaydetme-bc894e40f9fd?source=rss-e54c8c89b7c6------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc894e40f9fd</guid>
            <category><![CDATA[image]]></category>
            <category><![CDATA[image-processing]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[opencv]]></category>
            <category><![CDATA[video-processing]]></category>
            <dc:creator><![CDATA[Volkan Aktaş]]></dc:creator>
            <pubDate>Thu, 09 Jul 2020 17:30:13 GMT</pubDate>
            <atom:updated>2020-07-09T17:30:13.046Z</atom:updated>
            <content:encoded><![CDATA[<p>OpenCV resim ve videolar üzerinde işlemler gerçekleştirmek için özel olarak geliştirilmiş metodlara ve özelliklere sahiptir.</p><p><strong>- imread Metodu :</strong></p><p><strong>imread</strong> metodu “opencv2/highgui/highgui.hpp” kütüphanesi içerisinde yer alan ve disk üzerinde yer alan bir resim dosyasını okumak için kullanılan bir metoddur.</p><p><strong>imread</strong> metodu</p><p><strong>imread(DosyaAdı,flag)</strong></p><p>Şeklinde kullanılır.</p><p><strong>flag</strong> parametesi resmin görüntüleme biçimini belirler ve aşağıdaki değerleri alabilir:</p><p><strong>-</strong> <strong>IMREAD_UNCHANGED:</strong> Resim yoğunluğu her bir kanal başına 8 bit olur ve kanal sayısı değiştirilmez.</p><p><strong>-</strong> <strong>IMREAD_GRAYSCALE: </strong>Resim yoğunluğu her bir kanal başına 8 bit olur ve kanal sayısı 1 olur.</p><p><strong>-</strong> <strong>IMREAD_COLOR: </strong>Kanal sayısı 3 olur.</p><p><strong>- IMREAD_ANYDEPTH:</strong> Resim yoğunluğu değiştirilmez.</p><p><strong>- IMREAD_ANYCOLOR:</strong> Kanal sayısı değiştirilmez.</p><p><strong>- IMREAD_LOAD_GDAL:</strong> Resim yüklenirken gdal sürücüsü kullanılır.</p><p>Örnek olarak disk üzerinde önceden kaydedilmiş bir resmi pencere içerisinde görüntüleyen bir uygulama yapalım.</p><p>Kodumuz aşağıdaki gibi olacak:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e31cc65068fec523c89b54286715c67a/href">https://medium.com/media/e31cc65068fec523c89b54286715c67a/href</a></iframe><p>Kodumuzu çalıştırdığımızda resmimiz oluşturulan pencere içerisinde görüntülenecektir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*8O0vE3o6Sc513yEgWzDJcg.png" /><figcaption>imread metodu ile resim görüntüleme</figcaption></figure><p>Kodumuzda <strong>os.path.isfile()</strong> metodu ile belirtilen dosyanın mevcut olup olmadığını belirliyoruz.</p><p><strong>- imshow Metodu :</strong></p><p><strong>cvShowImage</strong> metodu “opencv2/highgui/highgui.hpp” kütüphanesi içerisinde yer alan ve bir resim dosyasını bir pencere içerisinde görüntülemek için kullanılan bir metoddur.</p><p><strong>imshow</strong> metodu</p><p><strong>imshow(DosyaAdı, mat)</strong></p><p>şeklinde kullanılır.</p><p>Örnek olarak disk üzerinde önceden kaydedilmiş bir videoyu bir pencere içerisinde görüntüleyen bir uygulama yapalım. Kodumuz aşağıdaki gibi olacak:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1862719573304c81176b42618ab517df/href">https://medium.com/media/1862719573304c81176b42618ab517df/href</a></iframe><p>Uygulamamızda</p><blockquote>video = cv2.VideoCapture(‘ D:/video.mp4’);</blockquote><p>Satırında video isimli video isminde bir değişken tanımlayarak VideoCapture metodu ile belirtilen video dosyasını aktarıyoruz.</p><p>Video dosyamızı görüntülemek için sürekli çalışan bir while döngüsü kuruyoruz.</p><blockquote>ret, frame = video.read()</blockquote><p>Satırında ret ve frame isimli değişkenler tanımlıyoruz. ret değişkeni işlem sonucunu tutarken, frame değişkenini videonun her bir frame’ini okumak amacıyla kullanıyoruz.</p><blockquote>if ret == True:</blockquote><p>satırında eğer okuma işlemi başarılı ise</p><blockquote>if( !frame ) break;</blockquote><p>satırında eğer okunan frame yoksa döngünün sonlanmasını sağlıyoruz.</p><blockquote>cvShowImage( “Video Görüntüleme”, frame );</blockquote><p>satırında okunan frame’i pencere içerisinde görüntülüyoruz.</p><blockquote>char c = cvWaitKey(50);</blockquote><p>satırında kullanıcının bir tuşa basmasını 50 milisaniye boyunca bekliyoruz.</p><blockquote>if ret == True:</blockquote><blockquote>else:</blockquote><blockquote>break</blockquote><p>Satırlarında okuma işlemi başarılı ise görüntüleme işlemi kodlarının çalışmasını, başarılı değilse döngünün sonlanmasını sağlıyoruz.</p><p>Eğer okuma işlemi başarılı ise</p><blockquote>cv2.imshow(‘frame’,frame)</blockquote><p>satırı ile okunan video dosyasına ait frame’in bir pencere içerisinde görüntülenmesini sağlıyoruz.</p><p>Eğer okuma işlemi esnasında klavyeden “q” tuşuna basılırsa</p><blockquote>if cv2.waitKey(30) &amp; 0xFF == ord(‘q’):</blockquote><p>kod satırı ile video gösterme penceresinin kapatılmasını sağlıyoruz.</p><p><strong>release()</strong> metodu ile içerisinde video saklanan değişken adresi belirtilerek, video dosyasının hafızadan silinmesini sağlıyoruz. <strong>destroyAllWindows()</strong> metoduyla ise açık olan pencereler sonlandırılır.</p><p>Kodumuzu çalıştırdığımızda belirttiğimiz yoldaki video dosyası pencere içerisinde oynatılacaktır. Klavyeden “q” tuşuna basıldığında video sonlandırılacaktır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xRhAGJCpQ2UUppVFJ7-n7A.png" /><figcaption>imshow metodu ile video görüntüleme</figcaption></figure><p><strong>- imwrite Metodu :</strong></p><p><strong>imwrite</strong> metodu “opencv2/highgui/highgui.hpp” kütüphanesi içerisinde yer alan ve disk üzerine bir resim dosyasını kaydetmek için kullanılan bir metoddur.</p><p><strong>imwrite</strong> metodu</p><p><strong>imwrite(DosyaAdı,Resim,</strong> <strong>const std::vector&lt; int &gt; &amp;params=std::vector&lt; int &gt;())</strong></p><p>Şeklinde kullanılır.</p><p><strong>const std::vector&lt; int &gt; &amp;params=std::vector&lt; int &gt;() </strong>şeklinde resmin kaydedilme formatını ve bu formatlar için kullanılacak sıkıştırma yüzdesi gibi parametreleri, parametre dizisi şeklinde tanımlayabiliriz. Bu parametreler aşağıdaki gibidir:</p><p><strong>- IMWRITE_JPEG_QUALITY :</strong> Resmin JPEG formatında kaydedilmesini sağlar. Kalite değeri 0 ile 100 arasında olup varsayılan kayıt kalitesi 95’dir.</p><p><strong>- IMWRITE_JPEG_PROGRESSIVE :</strong> JPEG özelliklerini aktif ya da pasif yapmak için kullanılır. Bu işlem 0 ve 1 ya da True ve False şeklinde gerçekleştirilir. Varsayılan değer False şeklindedir.</p><p><strong>- IMWRITE_JPEG_OPTIMIZE :</strong> JPEG özelliklerini aktif ya da pasif yapmak için kullanılır. Bu işlem 0 ve 1 ya da True ve False şeklinde gerçekleştirilir. Varsayılan değer False şeklindedir.</p><p><strong>- IMWRITE_JPEG_RST_INTERVAL :</strong> JPEG yeniden başlatma aralığını belirler. 0 ile 65535 arasında değer alır. Varsayılan değeri 0 (Yeniden başlatma pasif) şeklindedir.</p><p><strong>IMWRITE_JPEG_LUMA_QUALITY : </strong>JPEG Luma kalite seviyesini belirler. 0 ile 100 arasında değer alır. Varsayılan değeri 0 (JPEG Luma kullanılmayacak) şeklindedir.</p><p><strong>IMWRITE_JPEG_</strong> <strong>CHROMA_QUALITY : </strong>JPEG CHROMA kalite seviyesini belirler. 0 ile 100 arasında değer alır. Varsayılan değeri 0 (JPEG CHROMA kullanılmayacak) şeklindedir.</p><p><strong>IMWRITE_PNG_COMPRESSION :</strong> PNG dosya formatında kayıt için, PNG sıkıştırma seviyesini belirtir. 0 ile 9 arasında değer alır. Daha yüksek değerler daha fazla sıkıştırmayı sağlayarak dosya boyutunu azaltır. Varsayılan değer 3’dür.</p><p><strong>IMWRITE_PNG_STRATEGY :</strong> ImwritePNGFlags parametresine aşağıdaki değerleri alarak PNG sıkıştırma algoritma türlerini belirler. Varsayılan değer IMWRITE_PNG_STRATEGY_DEFAULT şeklindedir.</p><p><strong>- </strong>IMWRITE_PNG_STRATEGY_DEFAULT</p><p>- IMWRITE_PNG_STRATEGY_FILTERED</p><p>- IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY</p><p>- IMWRITE_PNG_STRATEGY_RLE</p><p>- IMWRITE_PNG_STRATEGY_FIXED</p><p><strong>IMWRITE_PNG_BILEVEL :</strong> PNG Binary seviyesini belirler. 0 veya 1 değerini alır. Varsayılan değeri 0’dır.</p><p><strong>IMWRITE_PXM_BINARY :</strong> PPM, PGM veya PBM için binary formatını belirler. 0 veya 1 değerini alır. Varsayılan değeri 1’dir.</p><p><strong>IMWRITE_WEBP_QUALITY :</strong> WEBP kalite seviyesini belirler. 1 ile 100 arasında değer alır. Varsayılan değeri 100 (kayıpsız sıkıştırma) şeklindedir.</p><p>Örnek olarak disk üzerinde önceden kaydedilmiş bir resmi filtre uygulayarak pencere içerisinde görüntüleyen ve kaydeden bir uygulama yapalım.</p><p>Kodumuz aşağıdaki gibi olacak:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cedae09c4d521ba7a8a50811ed407f96/href">https://medium.com/media/cedae09c4d521ba7a8a50811ed407f96/href</a></iframe><p>Kodumuzu çalıştırdığımızda resmimize gri filtre uygulanarak görüntülenecek ve resim bu hali ile farklı bir isimle disk üzerine kaydedilecektir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*f9NXEKN_H3oDfu0NXiD0Qw.png" /></figure><p>JPEG formatındaki bir resmi farklı bir sıkıştırma oranı ile PNG formatında kaydedelim. Kodumuz aşağıdaki gibi olacak:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dccada1148655c1ef63ea460cc8b93f4/href">https://medium.com/media/dccada1148655c1ef63ea460cc8b93f4/href</a></iframe><p>Kodumuzda parametreler isminde bir değişken tanımlayarak bu değişkene PNG sıkıştırma formatı ve sıkıştırma oranı parametrelerini parametre dizisi şeklinde ekledik. imwrite metodunun son parametresinde ise tanımlamış olduğumuz parametre dizisi değişkenini ekledik.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc894e40f9fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python İçin OpenCV Kütüphanesini Kurmak]]></title>
            <link>https://medium.com/@volkan_aktas/python-i%CC%87%C3%A7in-opencv-k%C3%BCt%C3%BCphanesini-kurmak-44c65756c027?source=rss-e54c8c89b7c6------2</link>
            <guid isPermaLink="false">https://medium.com/p/44c65756c027</guid>
            <category><![CDATA[opencv]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[image-recognition]]></category>
            <category><![CDATA[image-processing]]></category>
            <dc:creator><![CDATA[Volkan Aktaş]]></dc:creator>
            <pubDate>Thu, 09 Jul 2020 16:54:46 GMT</pubDate>
            <atom:updated>2020-07-09T16:54:46.451Z</atom:updated>
            <content:encoded><![CDATA[<p>Windows işletim sisteminde Python 3 için OpenCV kurulumunda aşağıdaki işlemleri gerçekleştirmek gerekiyor.</p><p>Ben, OpenCV’yi kurmadan önce, numpy ve matplotlib kütüphanelerini python üzerine kurmayı tercih ediyorum. OpenCV için bu kütüphaneler şart değil ancak yapacağınız ileri seviye görüntü işleme uygulamaları için bu kütüphaneler gerekli olacaktır.</p><p>numpy kütüphanesi matematiksel, bilimsel hesaplamalar için kullanabileceğiniz bir kütüphanedir. Bu kütüphaneyi python üzerine kurmak için windows komut satırında</p><p><strong>pip3 install numpy</strong></p><p>komutunu yazıyoruz.</p><p>matplotlib kütüphanesi ise verileri görselleştirmek için kullanacağınız bir kütüphanedir. Bu kütüphaneyi python üzerine kurmak için windows komut satırında</p><p><strong>pip3 install matplotlib</strong></p><p>komutunu yazıyoruz.</p><p>Opencv kurulumu içinse</p><p><a href="https://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv"><strong>https://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv</strong></a></p><p>adresinden kullandığımız python sürümüne göre whl uzantılı opencv dosyasını indiriyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/1*obyWWwq3MBWcUB2vYhYBxg.png" /><figcaption>Python İçin OpenCV Kütüphaneleri</figcaption></figure><p>Burada iki çeşit whl uzantılı dosya mevcuttur. Eğer opencv’yi standart kütüphanesi ile yüklemek istiyorsanız</p><p><strong>opencv_python‑3.3.1‑cp35‑cp35m‑win_amd64.whl</strong></p><p>şeklindeki dosyayı,</p><p>Text ve OCR kütüphaneleri gibi ek kütüphanelerle birlikte kurmak isterseniz</p><p><strong>opencv_python-3.3.1+contrib-cp36-cp36m-win_amd64.whl</strong></p><p>şeklindeki dosyayı indirmeniz gerekiyor. Bu dosyayı bilgisayarınızdaki python klasörüne kaydediyoruz. Komut istemini yönetici modunda açıyor ve python klasörü içerisinde komut satırında</p><p><strong>pip3 install opencv_python-3.3.1+contrib-cp36-cp36m-win_amd64.whl</strong></p><p>satırını yazarak python 3 için opencv kurulumunu tamamlıyoruz.</p><p>OpenCV’yi test etmek için ilk python kodu olarak aşağıdaki kodları yazalım:</p><blockquote>import cv2</blockquote><blockquote>print cv2.__version__</blockquote><p>Kodumuz doğru çalışıyorsa bize openCV versiyonunu yazacaktır.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44c65756c027" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>