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
#include <opencv2/opencv.hpp> | |
int main() { | |
// 画像の入力 | |
cv::Mat input_image = cv::imread("input.jpg", 0); | |
cv::Mat sobel_image, output_image; | |
/* Sobelフィルタ (3×3) | |
-1 0 1 |
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
#include <iostream> | |
#include <opencv2/opencv.hpp> | |
int main(int argc, char* argv[]) { | |
if (argc < 2) { | |
std::cerr << "引数不足(入力画像名, 閾値)" << std::endl; | |
return -1; | |
} |
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 numpy as np | |
import matplotlib.pyplot as plt | |
import cv2 | |
# Loading image data (GreyScale) | |
image = cv2.imread('data/lenna.png', cv2.IMREAD_GRAYSCALE) | |
# Generating noise | |
mean = 0; | |
sigma = 10; |
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 numpy as np | |
import cv2 | |
print(cv2.__version__) | |
def AddGaussianNoise(image, mean, sigma): | |
noise = np.random.normal(mean, sigma, np.shape(image)) | |
noisy_image = image + noise | |
noisy_image[noisy_image > 255] = 255 | |
noisy_image[noisy_image < 0] = 0 |
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 numpy as np | |
import cv2 | |
print("OpenCV Version: " + str(cv2.__version__)) | |
def AddGaussianNoise(image, mean, sigma): | |
noise = np.random.normal(mean, sigma, np.shape(image)) | |
noisy_image = image + noise | |
noisy_image[noisy_image > 255] = 255 | |
noisy_image[noisy_image < 0] = 0 |
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 numpy as np | |
import cv2 | |
import math | |
print("OpenCV Version: " + str(cv2.__version__)) | |
def AddGaussianNoise(image, mean, sigma): | |
noise = np.random.normal(mean, sigma, np.shape(image)) | |
noisy_image = image + noise | |
noisy_image[noisy_image > 255] = 255 |
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 numpy as np | |
import cv2 | |
print("OpenCV Version: " + str(cv2.__version__)) | |
def AddGaussianNoise(image, mean, sigma): | |
noise = np.random.normal(mean, sigma, np.shape(image)) | |
noisy_image = image + noise | |
noisy_image[noisy_image > 255] = 255 | |
noisy_image[noisy_image < 0] = 0 |
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 cv2 | |
import sys | |
def main(): | |
print("OpenCV Version: " + str(cv2.__version__)) | |
# Loading image data (COLOR) | |
filename1 = "data/lenna.png" | |
filename2 = "data/lenna.png" |
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 numpy as np | |
import cv2 | |
import sys | |
def main(): | |
print("OpenCV Version: " + str(cv2.__version__)) | |
# Loading image data (COLOR) | |
filename = "data/lenna.png" |
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 numpy as np | |
import cv2 | |
import sys | |
def main(): | |
print("OpenCV Version: " + str(cv2.__version__) + "\n") | |
# Loading image data (COLOR) | |
filename = "data/lenna.png" |