opencv3.0

Java programming, opencv unsatisfied link error

岁酱吖の 提交于 2019-12-02 08:53:34
问题 OpenCV libraries gives unsatisfied link error in capturing a video stream. Where should be the opencv 3.2.0 libraries? What is the correct path for packages of opencv classes? Code where to generate this error: package opencv; import org.opencv.core.*; import org.opencv.imgcodecs.Imgcodecs; import org.opencv.videoio.VideoCapture; public class VideoCap { public static void main (String args[]){ System.loadLibrary(Core.NATIVE_LIBRARY_NAME); // error VideoCapture camera = new VideoCapture(0); if

Converting opencv remap code from c++ to python

匆匆过客 提交于 2019-12-02 08:11:22
I am trying to convert c++ opencv cv2.remap code to python. I am not getting any error but result is not as expected.I am getting zoomed image c++ code int main() { Mat img = imread("captcha1.jpg"); float phase = -0.8 * CV_PI; float omega = 2.0 * CV_PI / img.cols; float amp = 15; Mat_<Vec2f> proj(img.size()); for (int y=0; y<img.rows; y++) { for (int x=0; x<img.cols; x++) { float u = 0; float v = sin(phase + float(x) * omega) * amp; proj(y,x) = Vec2f(float(x) + u, float(y) + v); } } Mat corr; cv::remap(img, corr, proj, cv::Mat(), INTER_LINEAR); imshow("in",img); imshow("out",corr); waitKey();

How to save dpi info in py-opencv?

北战南征 提交于 2019-12-02 07:53:08
import cv2 def clear(img): back = cv2.imread("back.png", cv2.IMREAD_GRAYSCALE) img = cv2.bitwise_xor(img, back) ret, img = cv2.threshold(img, 120, 255, cv2.THRESH_BINARY_INV) return img def threshold(img): ret, img = cv2.threshold(img, 120, 255, cv2.THRESH_BINARY_INV) img = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY) ret, img = cv2.threshold(img, 248, 255, cv2.THRESH_BINARY) return img def fomatImage(img): img = threshold(img) img = clear(img) return img img = fomatImage(cv2.imread("1566135246468.png",cv2.IMREAD_COLOR)) cv2.imwrite("aa.png",img) This is my code. But when I tried to identify it with

Upload ndarray(image in OpenCV) on to google cloud storage as a .jpg or .png

北城以北 提交于 2019-12-02 06:10:45
问题 I have a similar issues like How to upload a bytes image on Google Cloud Storage from a Python script. I tried this from google.cloud import storage import cv2 from tempfile import TemporaryFile import google.auth credentials, project = google.auth.default() client = storage.Client() # https://console.cloud.google.com/storage/browser/[bucket-id]/ bucket = client.get_bucket('document') # Then do other things... image=cv2.imread('/Users/santhoshdc/Documents/Realtest/15.jpg') with TemporaryFile(

Java programming, opencv unsatisfied link error

自作多情 提交于 2019-12-02 04:26:13
OpenCV libraries gives unsatisfied link error in capturing a video stream. Where should be the opencv 3.2.0 libraries? What is the correct path for packages of opencv classes? Code where to generate this error: package opencv; import org.opencv.core.*; import org.opencv.imgcodecs.Imgcodecs; import org.opencv.videoio.VideoCapture; public class VideoCap { public static void main (String args[]){ System.loadLibrary(Core.NATIVE_LIBRARY_NAME); // error VideoCapture camera = new VideoCapture(0); if(!camera.isOpened()){ System.out.println("Error"); } else { Mat frame = new Mat(); while(true){ if

opencv creat an input text box in a GUI and read it

淺唱寂寞╮ 提交于 2019-12-02 03:39:48
Just wondering if there is any command in OpenCV to create an input "Text box" or"Edit text box" for a GUI in C++? Like name box (to enter a name) PS: I'm using Linux (Ubuntu) As Miki says, there is no such facility in OpenCV itself, but there is nothing to stop you using Zenity or any of the alternatives, which work like this at the command line: zenity --title "Gimme some text!" --entry --text "Enter your text here" If it does what you want, you can integrate it into your C++ program by calling it through popen() . No. From the doc : While OpenCV was designed for use in full-scale

How to get well-defined edges regardless of the color

*爱你&永不变心* 提交于 2019-12-02 01:02:59
问题 I am trying to develop an App that detects cards "master cards, visa, cutomer cards, etc" using Android Camera, for that purpose i used OpenCV4Android version 3.0.0. To achieve this task, i did the following: 1- converted the frame taken from the camera to gray scale using Imgproc.cvtColor(this.mMatInputFrame, this.mMatGray, Imgproc.COLOR_BGR2GRAY); 2- blurring the frame using Imgproc.blur(this.mMatGray, this.mMatEdges, new Size(7, 7)); 3- apply Canny edge detector as follows Imgproc.Canny

Upload ndarray(image in OpenCV) on to google cloud storage as a .jpg or .png

↘锁芯ラ 提交于 2019-12-01 23:21:30
I have a similar issues like How to upload a bytes image on Google Cloud Storage from a Python script . I tried this from google.cloud import storage import cv2 from tempfile import TemporaryFile import google.auth credentials, project = google.auth.default() client = storage.Client() # https://console.cloud.google.com/storage/browser/[bucket-id]/ bucket = client.get_bucket('document') # Then do other things... image=cv2.imread('/Users/santhoshdc/Documents/Realtest/15.jpg') with TemporaryFile() as gcs_image: image.tofile(gcs_image) blob = bucket.get_blob(gcs_image) print(blob.download_as

OpenCV 3.0 VideoCapture doesn't open video file in Java

倾然丶 夕夏残阳落幕 提交于 2019-12-01 11:26:56
OpenCV 3.0 with Java cannot open video file, but it woks with camera. Before I was using OpenCV 3.0-beta it was working well in both, but in OpenCV 3.0 which is released on 2015-04-24 doesn't work with video file. If anyone know about this problem of OpenCV 3, please tell me the reason and how to solve this. I solved my problem like this: Copy the C:\opencv\build\x64\vc12\bin to the system path and restart the Eclipse. Hope this help someone that may has this problem with OpenCV 3.0. Even after adding C:\opencv\build\x64\vc12\bin to SYSTEM path, if you cannot open VideoCapture then you could

OpenCV3: where has cv::cuda::Stream::enqueueUpload() gone?

微笑、不失礼 提交于 2019-12-01 11:23:06
In former versions of OpenCV there was the function Stream::enqueueUpload that could be used to upload data to the GPU asynchronously together with CudaMem (compare: how to use gpu::Stream in OpenCV? ). However, this function does no longer exist in OpenCV 3. The CudaMem class is also gone but seems to have been replaced by the HostMem class. Can anyone tell me how to perform an asynchronous upload in OpenCV 3? It can be done now via void GpuMat::upload(InputArray arr, Stream& stream) method: cv::cuda::GpuMat d_mat; cv::cuda::HostMem h_mat; cv::cuda::Stream stream; d_mat.upload(h_mat, stream);