image-processing

Edit text in frame android

主宰稳场 提交于 2020-06-13 09:19:19
问题 How to make it "Bold" and change color ? somebody can help me ? I try many times but still not working. Core.putText(mRgba, "Result : " + contours.size(), new org.opencv.core.Point(0, 300), Core.FONT_HERSHEY_SIMPLEX, 2.6f, new Scalar(255, 255, 0)) 回答1: Read the documentation: you have parameters for both of them. public static void putText(Mat img, java.lang.String text, Point org, int fontFace, double fontScale, Scalar color, int thickness) Parameters: img - Image. text - Text string to be

Edit text in frame android

杀马特。学长 韩版系。学妹 提交于 2020-06-13 09:19:05
问题 How to make it "Bold" and change color ? somebody can help me ? I try many times but still not working. Core.putText(mRgba, "Result : " + contours.size(), new org.opencv.core.Point(0, 300), Core.FONT_HERSHEY_SIMPLEX, 2.6f, new Scalar(255, 255, 0)) 回答1: Read the documentation: you have parameters for both of them. public static void putText(Mat img, java.lang.String text, Point org, int fontFace, double fontScale, Scalar color, int thickness) Parameters: img - Image. text - Text string to be

Keras Realtime Augmentation adding Noise and Contrast

帅比萌擦擦* 提交于 2020-06-12 07:10:02
问题 Keras provides an ImageDataGenerator class for realtime augmentation, but it does not include contrast adjustment and addition of noise. How can we apply a random level of noise and a random contrast adjustment during training? Could these functions be added to the 'preprocessing_function' parameter in the datagen? Thank you. 回答1: From the Keras docs: preprocessing_function: function that will be implied on each input. The function will run before any other modification on it. The function

Python Image Processing - How to remove certain contour and blend the value with surrounding pixels?

☆樱花仙子☆ 提交于 2020-06-11 16:42:08
问题 I'm doing a project with depth image. But I have problems with noise and failed pixel reading with my depth camera. There are some spots and contours (especially edges) that have zero value. How to just ignore this zero value and blend it with surrounding values? I have tried dilation and erosion (morph image processing), but I still can't get the right combination. It indeed removed some of the noise, but I just need to get rid of zeros at all points Image Example: The zero value is the

How to join nearby bounding boxes in OpenCV Python

♀尐吖头ヾ 提交于 2020-06-11 05:23:06
问题 I am doing a college class project on image processing. This is my original image: I want to join nearby/overlapping bounding boxes on individual text line images, but I don't know how. My code looks like this so far (thanks to @HansHirse for the help): import os import cv2 import numpy as np from scipy import stats image = cv2.imread('example.png') gray = cv2.cvtColor(image,cv2.COLOR_BGR2GRAY) ret,thresh = cv2.threshold(gray,127,255,cv2.THRESH_BINARY_INV+cv2.THRESH_OTSU) #dilation kernel =

Error level analysis in Image

馋奶兔 提交于 2020-06-09 14:35:32
问题 How do I compute ELA for an image? I would like to get similar ELA image using opencv http://fotoforensics.com/tutorial-ela.php As per this tutorial, I resaved the image at 95% quality jpeg image and using absDiff method to compute the difference between the source image and the resaved image but all I am getting is zero difference. Any help on how to compute the difference between two images so as to obtain the error level just like sample images in the tutorial? 回答1: The key to achieve a

Error level analysis in Image

六眼飞鱼酱① 提交于 2020-06-09 14:34:08
问题 How do I compute ELA for an image? I would like to get similar ELA image using opencv http://fotoforensics.com/tutorial-ela.php As per this tutorial, I resaved the image at 95% quality jpeg image and using absDiff method to compute the difference between the source image and the resaved image but all I am getting is zero difference. Any help on how to compute the difference between two images so as to obtain the error level just like sample images in the tutorial? 回答1: The key to achieve a

What is the difference between cropping an image and applying an ROI (region of interest) on the image

老子叫甜甜 提交于 2020-06-01 05:14:06
问题 I'm using opencv . Having a base image ( 640x640 ) I want to know if applying a rectangular white shape mask of (100x100), in another words, a ROI is more time consuming compared to cropping the image in the same rectangular shape (100x100). What I consider as being a ROI mask = np.zeros_like(original_image) shape = np.array([[a,b,c,d]]) cv2.fillPoly(mask, shape, (255,255,255)) cv2.bitwise_and(original_image, mask) The way of cropping cropped = original_image[x:y, z:t] I want to apply a

Extract table structure from image containing Tables with borders

家住魔仙堡 提交于 2020-06-01 04:12:52
问题 I am trying to extract the cell locations in the table below. I was able to get the contours around the cell positions after applying adaptive thresholding and HoughLines get vertical and horizontal structuring elements. Here's my code : img = cv2.imread(os.path.join(img_path, file)) img1 = img.copy() gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) bw = cv2.adaptiveThreshold(gray, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY, 17, 1) bw = cv2.bitwise_not(bw) #detect horizontal lines

Extract table structure from image containing Tables with borders

回眸只為那壹抹淺笑 提交于 2020-06-01 04:09:06
问题 I am trying to extract the cell locations in the table below. I was able to get the contours around the cell positions after applying adaptive thresholding and HoughLines get vertical and horizontal structuring elements. Here's my code : img = cv2.imread(os.path.join(img_path, file)) img1 = img.copy() gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) bw = cv2.adaptiveThreshold(gray, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY, 17, 1) bw = cv2.bitwise_not(bw) #detect horizontal lines