<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>粗製濫造プログラマ</title>
<link>https://ameblo.jp/yurabox/</link>
<atom:link href="https://rssblog.ameba.jp/yurabox/rss20.xml" rel="self" type="application/rss+xml" />
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com" />
<description>ブログの説明を入力します。</description>
<language>ja</language>
<item>
<title>画像変換トレンド</title>
<description>
<![CDATA[ <p>by chatgpt deep research</p><p><br></p><p></p><p><a href="https://chatgpt.com/share/685ce42c-346c-800f-bfe1-38a357e9ea4f" id="link-1750918229958">https://chatgpt.com/share/685ce42c-346c-800f-bfe1-38a357e9ea4f</a></p><p></p><div class="ogpCard_root"><br></div>
]]>
</description>
<link>https://ameblo.jp/yurabox/entry-12912145743.html</link>
<pubDate>Mon, 23 Jun 2025 08:34:52 +0900</pubDate>
</item>
<item>
<title>GPS時刻修正アプリ</title>
<description>
<![CDATA[ <p></p><p><br></p><p></p><div class="ogpCard_root"><article class="ogpCard_wrap" style="display:inline-block;max-width:100%" contenteditable="false"><a class="ogpCard_link" href="https://www.dropbox.com/scl/fi/kmj6d7nkn22whuw1t4syq/BktTimeSync_1.14.0.exe?rlkey=5prgnzt9szyv6dfsysylfopeh&amp;st=fj9yslbk&amp;dl=0" target="_blank" rel="noopener noreferrer" data-ogp-card-log="" style="display:flex;justify-content:space-between;overflow:hidden;box-sizing:border-box;width:620px;max-width:100%;height:120px;border:1px solid #e2e2e2;border-radius:4px;background-color:#fff;text-decoration:none" contenteditable="false"><span class="ogpCard_content" style="display:flex;flex-direction:column;overflow:hidden;width:100%;padding:16px"><span class="ogpCard_title" style="-webkit-box-orient:vertical;display:-webkit-box;-webkit-line-clamp:2;max-height:48px;line-height:1.4;font-size:16px;color:#333;text-align:left;font-weight:bold;overflow:hidden">BktTimeSync_1.14.0.exe</span><span class="ogpCard_description" style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.6;margin-top:4px;color:#757575;text-align:left;font-size:12px">Shared with Dropbox</span><span class="ogpCard_url" style="display:flex;align-items:center;margin-top:auto"><span class="ogpCard_iconWrap" style="position:relative;width:20px;height:20px;flex-shrink:0"><img class="ogpCard_icon" alt="リンク" loading="lazy" src="https://c.stat100.ameba.jp/ameblo/symbols/v3.20.0/svg/gray/editor_link.svg" width="20" height="20" style="position:absolute;top:0;bottom:0;right:0;left:0;height:100%;max-height:100%"></span><span class="ogpCard_urlText" style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#757575;font-size:12px;text-align:left">www.dropbox.com</span></span></span><span class="ogpCard_imageWrap" style="position:relative;width:120px;height:120px;flex-shrink:0"><img class="ogpCard_image" loading="lazy" src="https://www.dropbox.com/static/metaserver/static/images/opengraph/opengraph-content-icon-file-exe-landscape.png" alt="" data-ogp-card-image="" width="120" height="120" style="position:absolute;top:50%;left:50%;object-fit:cover;min-height:100%;min-width:100%;transform:translate(-50%,-50%)"></span></a></article></div><p></p><p><br></p>
]]>
</description>
<link>https://ameblo.jp/yurabox/entry-12888668935.html</link>
<pubDate>Tue, 04 Mar 2025 18:23:05 +0900</pubDate>
</item>
<item>
<title>コントラスト向上</title>
<description>
<![CDATA[ <div>from PIL import Image, ImageEnhance, ImageOps, ImageFilter</div><div><br></div><div># 画像の読み込み</div><div>input_image_path = "input_image.jpg"</div><div>image = Image.open(input_image_path)</div><div><br></div><div># 1. ヒストグラム均等化</div><div>equalized_image = ImageOps.equalize(image)</div><div>equalized_image.save("equalized_image.jpg")</div><div><br></div><div># 2. コントラスト調整</div><div>contrast_factor = 1.5 &nbsp;# コントラスト調整の係数（調整してください）</div><div>enhancer = ImageEnhance.Contrast(image)</div><div>contrast_adjusted_image = enhancer.enhance(contrast_factor)</div><div>contrast_adjusted_image.save("contrast_adjusted_image.jpg")</div><div><br></div><div># 3. カーブ調整（例として赤チャンネルのみ）</div><div>r, g, b = image.split()</div><div>r_curve = r.point(lambda x: x * 1.5) &nbsp;# カーブを調整（調整してください）</div><div>adjusted_image = Image.merge("RGB", (r_curve, g, b))</div><div>adjusted_image.save("adjusted_image.jpg")</div><div><br></div><div># 4. 局所的な調整（例としてアンシャープマスク）</div><div>sharpened_image = image.filter(ImageFilter.UnsharpMask(radius=2, percent=150)) &nbsp;# 調整可能</div><div>sharpened_image.save("sharpened_image.jpg")</div><div><br></div><div># 5. フィルタの使用（例としてシャープネスフィルタ）</div><div>sharpen_filter = ImageFilter.SHARPEN</div><div>sharpened_image_2 = image.filter(sharpen_filter)</div><div>sharpened_image_2.save("sharpened_image_2.jpg")</div>
]]>
</description>
<link>https://ameblo.jp/yurabox/entry-12817561346.html</link>
<pubDate>Thu, 24 Aug 2023 15:58:43 +0900</pubDate>
</item>
<item>
<title>2023/06/19</title>
<description>
<![CDATA[ <p><br></p><div><a href="https://stat.ameba.jp/user_images/20230619/15/yurabox/7f/8b/j/o0512051215301195460.jpg"><img src="https://stat.ameba.jp/user_images/20230619/15/yurabox/7f/8b/j/o0512051215301195460.jpg" border="0" width="400" height="400" alt=""></a></div><p><br></p>
]]>
</description>
<link>https://ameblo.jp/yurabox/entry-12808429078.html</link>
<pubDate>Mon, 19 Jun 2023 15:05:00 +0900</pubDate>
</item>
<item>
<title>Lenna</title>
<description>
<![CDATA[ <p><br></p><div><a href="https://stat.ameba.jp/user_images/20230619/10/yurabox/1c/a8/j/o0512051215301099873.jpg"><img src="https://stat.ameba.jp/user_images/20230619/10/yurabox/1c/a8/j/o0512051215301099873.jpg" border="0" width="400" height="400" alt=""></a></div><p><br></p>
]]>
</description>
<link>https://ameblo.jp/yurabox/entry-12808397884.html</link>
<pubDate>Mon, 19 Jun 2023 10:26:09 +0900</pubDate>
</item>
<item>
<title>lenna</title>
<description>
<![CDATA[ <p><br></p><div><a href="https://stat.ameba.jp/user_images/20230619/10/yurabox/1b/44/j/o0512051215301095655.jpg"><img src="https://stat.ameba.jp/user_images/20230619/10/yurabox/1b/44/j/o0512051215301095655.jpg" border="0" width="400" height="400" alt=""></a></div><p><br></p><p><br></p><div><a href="https://stat.ameba.jp/user_images/20230619/10/yurabox/e0/88/j/o0512051215301095662.jpg"><img src="https://stat.ameba.jp/user_images/20230619/10/yurabox/e0/88/j/o0512051215301095662.jpg" border="0" width="400" height="400" alt=""></a></div><p><br></p><p><br></p><div><a href="https://stat.ameba.jp/user_images/20230619/10/yurabox/42/4a/j/o0512051215301095681.jpg"><img src="https://stat.ameba.jp/user_images/20230619/10/yurabox/42/4a/j/o0512051215301095681.jpg" border="0" width="400" height="400" alt=""></a></div><p><br></p>
]]>
</description>
<link>https://ameblo.jp/yurabox/entry-12808396430.html</link>
<pubDate>Mon, 19 Jun 2023 10:13:57 +0900</pubDate>
</item>
<item>
<title>2023/06/16</title>
<description>
<![CDATA[ <div>import cv2</div><div>import numpy as np</div><div><br></div><div># 画像の読み込み</div><div>image1 = cv2.imread("image1.jpg", 0)</div><div>image2 = cv2.imread("image2.jpg", 0)</div><div><br></div><div># 窓関数の適用</div><div>window = np.hamming(image1.shape[0])[:, np.newaxis] @ np.hamming(image1.shape[1])[np.newaxis, :]</div><div>image1_windowed = window * image1</div><div>image2_windowed = window * image2</div><div><br></div><div># フーリエ変換</div><div>fft1 = np.fft.fftshift(np.fft.fft2(image1_windowed))</div><div>fft2 = np.fft.fftshift(np.fft.fft2(image2_windowed))</div><div><br></div><div># 対数極座標変換</div><div>magnitude1, angle1 = cv2.cartToPolar(np.real(fft1), np.imag(fft1))</div><div>magnitude2, angle2 = cv2.cartToPolar(np.real(fft2), np.imag(fft2))</div><div><br></div><div># 位相限定相関法</div><div>correlation = np.fft.ifft2(np.fft.fft2(magnitude1) * np.fft.fft2(magnitude2).conj())</div><div>correlation = np.real(np.fft.fftshift(correlation))</div><div><br></div><div># スペクトルの重みづけ</div><div>y, x = np.unravel_index(correlation.argmax(), correlation.shape)</div><div>weight = correlation[y, x] / (magnitude1.shape[0] * magnitude1.shape[1])</div><div>weight_map = np.abs(fft1) * weight</div><div><br></div><div># 相関ピークモデルのフィッティング</div><div>model = np.array([[1, 0, x - magnitude1.shape[1] // 2],</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [0, 1, y - magnitude1.shape[0] // 2]])</div><div>model, _ = cv2.estimateAffine2D(model, np.array([[0, 0], [x, y], [0, magnitude1.shape[0]]]))</div><div><br></div><div># アフィン変換による平行移動</div><div>image1_aligned = cv2.warpAffine(image1, model, (image1.shape[1], image1.shape[0]))</div><div><br></div><div># 平行移動した画像を保存</div><div>cv2.imwrite("image1_aligned.jpg", image1_aligned)</div><div><br></div>
]]>
</description>
<link>https://ameblo.jp/yurabox/entry-12807981189.html</link>
<pubDate>Fri, 16 Jun 2023 09:47:30 +0900</pubDate>
</item>
<item>
<title>2023/06/16</title>
<description>
<![CDATA[ <div>import cv2</div><div>import numpy as np</div><div>from matplotlib import pyplot as plt</div><div><br></div><div># 画像読み込み</div><div>img1 = cv2.imread('image1.jpg', 0)</div><div>img2 = cv2.imread('image2.jpg', 0)</div><div><br></div><div># BLPOCの計算</div><div>result = cv2.phaseCorrelate(img1, img2)</div><div><br></div><div># 移動量を取得</div><div>x_offset = result[0][0]</div><div>y_offset = result[0][1]</div><div><br></div><div># img2を移動</div><div>rows,cols = img2.shape</div><div>M = np.float32([[1,0,x_offset],[0,1,y_offset]])</div><div>img2 = cv2.warpAffine(img2,M,(cols,rows))</div><div><br></div><div># 2つの画像を重ねて表示</div><div>result_img = cv2.addWeighted(img1, 0.5, img2, 0.5, 0)</div><div><br></div><div># 画像を表示</div><div>fig = plt.figure(figsize=(16, 8))</div><div>ax1 = fig.add_subplot(131)</div><div>ax2 = fig.add_subplot(132)</div><div>ax3 = fig.add_subplot(133)</div><div><br></div><div>ax1.set_title('Image1')</div><div>ax1.imshow(img1, cmap='gray')</div><div><br></div><div>ax2.set_title('Image2')</div><div>ax2.imshow(img2, cmap='gray')</div><div><br></div><div>ax3.set_title('Merged Image')</div><div>ax3.imshow(result_img, cmap='gray')</div><div><br></div><div>plt.show()</div><div><br></div>
]]>
</description>
<link>https://ameblo.jp/yurabox/entry-12807976654.html</link>
<pubDate>Fri, 16 Jun 2023 09:09:17 +0900</pubDate>
</item>
<item>
<title>2023/06/15</title>
<description>
<![CDATA[ <div>import numpy as np</div><div>import cv2</div><div>from PIL import Image</div><div><br></div><div># 画像1の読み込み</div><div>img1 = Image.open("img1.jpg")</div><div><br></div><div># グレースケール化</div><div>f1 = np.asarray(img1)</div><div>f1 = np.dot(f1[...,:3], [0.2989, 0.5870, 0.1140])</div><div><br></div><div># 2次元FFT</div><div>F1 = np.fft.fft2(f1)</div><div><br></div><div># 周波数領域の複素共役をとって正規化</div><div>R1 = F1 / np.abs(F1)</div><div><br></div><div># 逆2次元FFT</div><div>POC1 = np.real(np.fft.ifft2(R1))</div><div><br></div><div># 画像2の読み込み</div><div>img2 = Image.open("img2.jpg")</div><div><br></div><div># グレースケール化</div><div>f2 = np.asarray(img2)</div><div>f2 = np.dot(f2[...,:3], [0.2989, 0.5870, 0.1140])</div><div><br></div><div># 2次元FFT</div><div>F2 = np.fft.fft2(f2)</div><div><br></div><div># 周波数領域の複素共役をとって正規化</div><div>R2 = F2 / np.abs(F2)</div><div><br></div><div># 逆2次元FFT</div><div>POC2 = np.real(np.fft.ifft2(R2))</div><div><br></div><div># 中央100ピクセル×100ピクセルの移送情報を削除</div><div>h, w = POC1.shape</div><div>POC1[h//2-50:h//2+50, w//2-50:w//2+50] = POC2[h//2-50:h//2+50, w//2-50:w//2+50]</div><div><br></div><div># 画像1を保存</div><div>img_ripoc = Image.fromarray(np.uint8(POC1))</div><div>img_ripoc.save("img_ripoc.jpg")</div><div><br></div><div># フーリエ変換</div><div>F_ripoc = np.fft.fft2(POC1)</div><div><br></div><div># 位置合わせでの移動量を取得</div><div>x, y = cv2.phaseCorrelate(f1.astype(np.float32), POC1.astype(np.float32))</div><div><br></div><div># 最初に読み込んだ画像に移動量を足して位置合わせ</div><div>img1_ripoc = np.roll(img1, (int(round(y)), int(round(x))), axis=(0,1))</div><div><br></div><div># 画像を保存</div><div>Image.fromarray(np.uint8(img1_ripoc)).save("img1_ripoc.jpg")</div><div><br></div>
]]>
</description>
<link>https://ameblo.jp/yurabox/entry-12807845177.html</link>
<pubDate>Thu, 15 Jun 2023 11:43:11 +0900</pubDate>
</item>
<item>
<title>2023/06/15</title>
<description>
<![CDATA[ <div>import cv2</div><div>import numpy as np</div><div><br></div><div># 2枚の画像を読み込む</div><div>img1 = cv2.imread('image1.png',0)</div><div>img2 = cv2.imread('image2.png',0)</div><div><br></div><div># フーリエ変換する</div><div>f1 = np.fft.fft2(img1)</div><div>f1shift = np.fft.fftshift(f1)</div><div>f2 = np.fft.fft2(img2)</div><div>f2shift = np.fft.fftshift(f2)</div><div><br></div><div># 正規化する</div><div>magnitude_spectrum1 = 20*np.log(np.abs(f1shift))</div><div>magnitude_spectrum2 = 20*np.log(np.abs(f2shift))</div><div>min1 = np.min(magnitude_spectrum1)</div><div>max1 = np.max(magnitude_spectrum1)</div><div>min2 = np.min(magnitude_spectrum2)</div><div>max2 = np.max(magnitude_spectrum2)</div><div>magnitude_spectrum1 = (magnitude_spectrum1-min1)/(max1-min1)</div><div>magnitude_spectrum2 = (magnitude_spectrum2-min2)/(max2-min2)</div><div><br></div><div># 逆フーリエ変換して位相限定画像を作成する</div><div>phase_limit1 = np.real(np.fft.ifft2(np.exp(1j * np.angle(f1))))</div><div>phase_limit2 = np.real(np.fft.ifft2(np.exp(1j * np.angle(f2))))</div><div><br></div><div># 画像を保存する</div><div>cv2.imwrite('phase_limit1.png', phase_limit1)</div><div>cv2.imwrite('phase_limit2.png', phase_limit2)</div><div><br></div><div># 位相限定画像の中央から100×100ピクセルの位相を消す</div><div>row, col = img1.shape</div><div>crow, ccol = row//2 , col//2</div><div>phase_limit1[crow-50:crow+50, :] = 0</div><div>row, col = img2.shape</div><div>crow, ccol = row//2 , col//2</div><div>phase_limit2[crow-50:crow+50, :] = 0</div><div><br></div><div># 画像を保存する</div><div>cv2.imwrite('phase_limit1_modified.png', phase_limit1)</div><div>cv2.imwrite('phase_limit2_modified.png', phase_limit2)</div><div><br></div><div># フーリエ変換する</div><div>f1 = np.fft.fft2(phase_limit1)</div><div>f1shift = np.fft.fftshift(f1)</div><div>f2 = np.fft.fft2(phase_limit2)</div><div>f2shift = np.fft.fftshift(f2)</div><div><br></div><div># RIPOCで位置合わせをする</div><div>R, mask = cv2.estimateRigidTransform(f1shift, f2shift, False)</div><div><br></div><div># RIPOCの返り値を最初に読み込んだ画像に適用する</div><div>rows,cols = img1.shape</div><div>img2_transformed = cv2.warpAffine(img2, R, (cols,rows))</div><div><br></div><div># 画像を保存する</div><div>cv2.imwrite('img2_transformed.png',img2_transformed)</div><div><br></div>
]]>
</description>
<link>https://ameblo.jp/yurabox/entry-12807842135.html</link>
<pubDate>Thu, 15 Jun 2023 11:15:29 +0900</pubDate>
</item>
</channel>
</rss>
