2017-04-04 16:04:05 -0600 | asked a question | How to create a matrix and make it a copy of the camera matrix? Hello, I have retrieved the calibration parameters for my camera, meaning that I have the camera matrix and the distortion vector. However, now that I have those, I want to undistort my image using the function: I have them all, I just don't know how to create a matrix and fill it with values. I would like to do something like this: Of course, I would do the same for the distortion vector. The problem is that I haven't found any documentation on how to create matrices in OpenCV for Java. I don't mean like Mat mat = new Mat(), but how to create a matrix and fill it with values. I hope that you guys can help. |
2017-02-25 21:45:25 -0600 | commented answer | Create camera calibration project in Visual Studio 2015 I do as this dude does it: https://www.youtube.com/watch?v=l4372... If you watch from maybe 6:40 to 8:00, you will see the errors that I get as well. I'm not entirely sure that I understand what you mean with "source file in folder". What is the source file and in what folder is it? |
2017-02-25 18:09:49 -0600 | commented answer | Create camera calibration project in Visual Studio 2015 I have done what you stated above, but it puts me no where closer. I have a OpenCV.sln file in MyCalibration, but if I want to create a new project, copy some code from a file in F:\opencvfin\samples\cpp\tutorial_code\calib3d\camera_calibration and paste it into my project, I only get erros in the project. My problem is that I don't have a clue on how to solve this. The most ridiculous thing here is that I have a masters degree in computer engineering, and this is the most difficult thing I've ever done. Seems unecessary to be this complex. |
2017-02-25 16:10:08 -0600 | commented answer | Create camera calibration project in Visual Studio 2015 I'm not sure that I understand. I have a OpenCV.sln-file that I can open. It is when I create a new project in Visual Studio, and paste the code from camera_calibration.cpp into the new project that makes it all strange. |
2017-02-25 14:50:57 -0600 | commented question | Create camera calibration project in Visual Studio 2015 I did use CMake. I followed this tutorial. |
2017-02-25 11:50:07 -0600 | asked a question | Create camera calibration project in Visual Studio 2015 Hi, In order to be able to calibrate my camera, I downloaded visual studio and tried to create a camera calibration project. However, when I create a project (I choose Win32 Console Application -> Application Type = Console Application. Then, in the file that is created (called Testing.cpp) I try to paste the code from C:\OpenCV\opencv\samples\cpp\tutorial_code\calib3d\camera_calibration\camera_calibration.cpp into my Testing.cpp-file. When I do that, every line that contains "#include" is red. Since I don't normally work with OpenCV in Visual Studio, I don't know how to resolve this. It would be awesome if anyone could point me in the correct direction. |
2017-02-25 11:42:31 -0600 | received badge | ● Enthusiast |
2017-02-23 17:48:19 -0600 | asked a question | How to use camera calibration in Java Hi, I haven't calibrated my camera as of yet, but I'm planning to just run a C++ program in some way, and grab the necessary matrices. Now, my question is sort of similar to this one. I want to know how (in Java) I should use the information grabbed in C++. I don't seem to be able to find an answer to this question, but I'm sure that some of the OpenCV Java users must have their cameras calibrated. |
2016-10-16 16:20:07 -0600 | commented question | Cannot open some video files in OpenCV 2.4.13 for Java FourCC = 541215044 if I cast it to an integer. What is that value anyway? |
2016-10-16 12:56:38 -0600 | commented question | Cannot open some video files in OpenCV 2.4.13 for Java I already have that piece of code in place, and for the video file that doesn't work, I always enter the else-block in your example.I have also edited the original post, just to notify that I've tried to have both of the files in the same folder, but without luck. |
2016-10-16 12:14:50 -0600 | commented question | Cannot open some video files in OpenCV 2.4.13 for Java Okay, so I did what I thought that you meant and ended up with this: vidCap.get(CV_CAP_PROP_FPS) = 4 vidCap.get(CV_CAP_PROP_FOURCC) = 5.41215044E8 vidCap.get(CV_CAP_PROP_FRAME_WIDTH) = 640 vidCap.get(CV_CAP_PROP_FRAME_HEIGHT) = 480 For the other video that doesn't work, I get 0.0 on all of the values. |
2016-10-16 12:05:09 -0600 | commented question | Cannot open some video files in OpenCV 2.4.13 for Java I guess you mean that I should check those values for one video file that does work, and compare it with another one that doesn't? Have I understood that correctly? |
2016-10-16 10:11:58 -0600 | received badge | ● Editor (source) |
2016-10-16 09:42:39 -0600 | asked a question | Cannot open some video files in OpenCV 2.4.13 for Java Hi, I have a problem regarding opening video files. I recently created an .avi-file from a bunch of images that I had taken from a camera. When I tried to open this using the following line of code, everything worked fine. However, when I try another video file, for instance the example video from this example. The video file in that example is called bouncingBall.avi. This, however, won't work. The program does not open up the video file, and no errors are shown. The same happens with another video file I took from my IP-camera. The program I used to record the file, iSpy, saved the file as .mp4. Since this didn't work, I tried to convert it to .avi with different "codecs". I have so far tried all of the settings that the converter program offers. These are:
Also, please not that I've tried to have both of the files in the same folder, but it still didn't work. So now, I'm out of ideas on how to solve this. I have done some search about an issue regarding FFMPEG, but I do not understand how to resolve that. Thank you. |
2016-10-12 06:46:28 -0600 | commented answer | Use BackgroundSubtractorMOG2 in OpenCV 2.4.13 with Java Yeah, I know that. I simply overlooked the fact due to I looked to much on the old code. Anyway, thanks again. |
2016-10-12 06:45:50 -0600 | received badge | ● Supporter (source) |
2016-10-12 06:45:48 -0600 | received badge | ● Scholar (source) |
2016-10-12 04:31:40 -0600 | commented question | Use BackgroundSubtractorMOG2 in OpenCV 2.4.13 with Java It worked. So all it needed was the "new" added before. Btw, it also seems to work with BackgroundSubtractorMOG2, not just the ordinary MOG. |
2016-10-12 04:05:22 -0600 | asked a question | Use BackgroundSubtractorMOG2 in OpenCV 2.4.13 with Java Hi, I have been running my openCV setup on windows until now, but now I need to change to Ubuntu. Because of this, I was unable to create a .jar file for openCV version 3.x so I ended up with version 2.4.13. This means that some of the lines of code that I had (perfectly working in Windows with openCV 3.1) no longer work. I had the following line: Now, I am trying to change this to work with openCV version 2.4.13, but I'm simply not able to. I have tried the following line but this gives me the following: org.opencv.video cannot be resolved to a type. What can I do to make this run on my current setup? |
2016-09-30 06:57:17 -0600 | commented question | Capture video from d-link DCS-930LB I think that the problem is within my internet settings, maybe the router. Does anybody else think that the settings could matter, making it impossible to see the feed? |
2016-09-23 08:20:44 -0600 | commented question | Improve background segmentation through BackgroundSubtractMOG2 Okay, I can get that to work with this line of Java code (for people that are looking for the syntax): Imgproc.morphologyEx(foreground, foreground, Imgproc.MORPH_CLOSE, Imgproc.getStructuringElement(Imgproc.CV_SHAPE_RECT, new Size(7,7)), new Point(-1, -1), 5); I just want to know; how did you know what parameters to pass to the getStructuringElement method? Also, how did you know what parameters to pass to the Point class? |
2016-09-22 14:55:05 -0600 | commented question | Improve background segmentation through BackgroundSubtractMOG2 Okay, but how do I call for that particular method, and which kernel should I use? |
2016-09-22 08:30:03 -0600 | asked a question | Improve background segmentation through BackgroundSubtractMOG2 Hi, I have created a small program that is supposed to detect changes in the foreground over a background. It works, but not as well as I would like it to. Here is what I have done so far, to try to improve it on my own.
Here are two images. The one to on top is one that is produced by the program (me holding a tube of shave balm). The one below is one that I have created in paint, and it is like that I want the program to be able to produce on its own. Also note that if I were to have my face in the image instead, the program would produce a much worse result than when I used my hand.
Below, you will see my code. Please come up with suggestions on how to improve my segmentation. |
2016-09-07 10:57:04 -0600 | asked a question | Capture video from d-link DCS-930LB Hi, I have a problem when I'm trying to capture video from my IP-camera, mentioned in the topic. I have tried to solve it using the tips and examples displayed here, as well as the advice given here, but nothing seems to work. My code, originally taken from this example, looks as follows. It is worth mentioning that when I try the URL passed to the VideoCapture object in my browser, I get access to the camera feed. My error message looks like this. Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Width (0) and height (0) must be > 0 at java.awt.image.SampleModel.<init>(SampleModel.java:126) at java.awt.image.ComponentSampleModel.<init>(ComponentSampleModel.java:146) at java.awt.image.PixelInterleavedSampleModel.<init>(PixelInterleavedSampleModel.java:87) at java.awt.image.Raster.createInterleavedRaster(Raster.java:641) at java.awt.image.Raster.createInterleavedRaster(Raster.java:278) at java.awt.image.Raster.createInterleavedRaster(Raster.java:212) at java.awt.image.ComponentColorModel.createCompatibleWritableRaster(ComponentColorModel.java:2825) at java.awt.image ... (more) |