This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Data; | |
using System.Drawing; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows.Forms; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tkinter as tk # ウィンドウ作成用 | |
from tkinter import filedialog # ファイルを開くダイアログ用 | |
from PIL import Image, ImageTk # 画像データ用 | |
import numpy as np # アフィン変換行列演算用 | |
import os # ディレクトリ操作用 | |
class Application(tk.Frame): | |
def __init__(self, master=None): | |
super().__init__(master) | |
self.pack() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pictureBox1.SizeMode = PictureBoxSizeMode.Zoom; | |
var bmp = new Bitmap(@"C:\Temp\syurijou.JPG"); // 6000 x 4000 x 24bit | |
pictureBox1.Image = bmp; | |
var sw = new System.Diagnostics.Stopwatch(); | |
MessageBox.Show("開始"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// usafeのポインタを使って輝度値の取得設定の並列処理 | |
/// </summary> | |
/// <param name="bmp"></param> | |
private void NegativeImage5(Bitmap bmp) | |
{ | |
var width = bmp.Width; | |
var height = bmp.Height; | |
// Bitmapをロック |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// usafeのポインタを使って輝度値の取得設定 | |
/// </summary> | |
/// <param name="bmp"></param> | |
private void NegativeImage4(Bitmap bmp) | |
{ | |
var width = bmp.Width; | |
var height = bmp.Height; | |
// Bitmapをロック |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// MarshalクラスのReadByte、WriteByteで輝度値の取得設定 | |
/// </summary> | |
/// <param name="bmp"></param> | |
private void NegativeImage3(Bitmap bmp) | |
{ | |
var width = bmp.Width; | |
var height = bmp.Height; | |
// Bitmapをロック |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// LockBits、UnlockBitsで画像データのポインタを取得し、配列を介して処理を行う | |
/// </summary> | |
/// <param name="bmp"></param> | |
private void NegativeImage2(Bitmap bmp) | |
{ | |
var width = bmp.Width; | |
var height = bmp.Height; | |
// Bitmapをロック |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// GetPixel、SetPixelで輝度値の取得設定 | |
/// </summary> | |
/// <param name="bmp"></param> | |
private void NegativeImage1(Bitmap bmp) | |
{ | |
var width = bmp.Width; | |
var height = bmp.Height; | |
Color col; |