Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all 19555 articles
Browse latest View live

4 Proven wholesome excess Weight reduction suggestions

$
0
0
The bruises would never completely heal because before they did I would rap my hand again several times. It was not only when I was working in the yard but when I would be walking through the kitchen and rap my hand on the edge of the cabinet with the same result.



You need to get enough of the right foods including colourful fruits and vegetables, protein, good carbohydrates and just enough good fats for the taste you want. You also need vitamins, minerals and fiber from nutritional supplements to provide the nutrition missing from your diet that your cells need for good health.

Also, add cold-water fish to your diet. Opt for baked salmon patties instead of beef burgers. Eat tuna sandwiches for lunch a couple of days per week. Or make a tuna, rice and cheese casserole with cream of chicken! Kids often love these foods, and they are healthy for them too.

Unfortunately, high fructose corn syrup is not just found in soda but in many foods you may not be aware of. It is found in many salad dressings, condiments, sauces, frozen foods, and even foods that you may think of as really healthy like yogurt and fruit juices.

First of all, there is no such thing as a fat gene, so you cannot use that excuse anymore. You can say that you are fat or over weight because it runs in your family, but the hard truth is there is no such thing as a fat gene. You can't be fat just because your mom or dad is overweight; it is not part of the DNA structure. It is in the food you eat and your life style, it is more of nature versus nurture and in this case it is nurture. If your family likes to eat unhealthy healthy food then chances are, you tend to eat the same thing. If your family likes to just sit down and not move about, there is a possibility that like them, you spend your time doing the same thing. So remember, it is not genetic.

The best exercises for biceps training. There are a lot of ways to train biceps, but some work better some - not so good. I will try to state the best of best exercises and tips just for you. Stick with the basics and you will succeed faster than you think.

health living We can get the Nutritional Supplements Online for a reasonable rate. The nutrition supplements will help the body to have the necessary vitamins to keep the body healthy. These days the transactions and purchases take place online. The products online are reliable and are direct from the manufacturer to the consumer. There is no wasting of the time as everything is done online. By just click of a mouse we can order the products and get it to our door step. All over the world products is found on the net. The action is quicker and we get the products quickly. There are different nutritional supplements meant for different kinds of ailments. For health, fitness, joint care, skin care and anti aging formulas and etc, there are many brands and products available online.

Water - Water is the most magical liquid in the universe. It is the only substance in the world that your body does not have to "process" before allowing into your system. Having 8 to 10 glasses of clear water is essential not only for weight loss, but for good health.

cv::findContours crash with release dlls

$
0
0
Hi, I'm building a VS application linking opencv 2.4.13 release dlls even for RELEASE and DEBUG configuration. In DEBUG configuration it crashes on cv::findContours. I have already checked that using opencv debug dlls it doesn't happen, but it **let my application slow down due to opencv debugging**. My question is, if I don't need to debug opencv code, there is a way to link anyway release dlls? Or am I bounded to use debug dlls? thank you for the attention, regards Andrea

Kalman Filter - Assertion failed - Matrix types

$
0
0
Hey, I try to build a kalman filter and get runtime errors at the step `Mat prediction = KF.predict(control);` in regards to the matrix types. I checked all the types of the input matrices and they are of type `5 == CV_32FC1`, which should be the correct one. But I assume I make some CV related mistake that I am unaware of. Any help is appreciated, even if you dont want to dig into the code. **Relevant code:** #include #include #include #include "localizer_mm/localizer_mm_lib.h" using namespace cv; using namespace localizer_mm; cv::KalmanFilter KF; cv::Mat measurement(3,1,CV_32FC1); cv::Mat state(3,1,CV_32FC1); // (x, y, psi) cv::Mat pred(3,1,CV_32FC1); cv::Mat corr(3,1,CV_32FC1); cv::Mat control(3,1,CV_32FC1); bool init = true; Pose adma_pose, adma_pose_last, odom_pose, mama_pose,result; void initKalman(float x, float y, float psi) { // Initialize Kalman Filter KF.init(3, 3, 0); // initialize measurement, prior and posterior state measurement = Mat::zeros(3,1,CV_32FC1); measurement.at(0,0) = x; measurement.at(1,0) = y; measurement.at(2,0) = psi; KF.statePre.setTo(0); KF.statePre.at(0,0) = x; KF.statePre.at(1,0) = y; KF.statePre.at(2,0) = psi; KF.statePost.setTo(0); KF.statePost.at(0,0) = x; KF.statePost.at(1,0) = y; KF.statePost.at(2,0) = psi; // initialize A, H, Q, R, P setIdentity(KF.transitionMatrix); // A setIdentity(KF.measurementMatrix); // H setIdentity(KF.processNoiseCov, Scalar::all(.005)); // Q setIdentity(KF.measurementNoiseCov, Scalar::all(.1)); // R setIdentity(KF.errorCovPost, Scalar::all(.1)); // P posterior } Mat kalmanPredict(float x, float y, float psi) { std::cout << "measurement = \n"; std::cout << measurement << "\n"; std::cout << "statePre = \n"; std::cout << KF.statePre << "\n"; std::cout << "statePost = \n"; std::cout << KF.statePost << "\n"; std::cout << "transitionMatrix = \n"; std::cout << KF.transitionMatrix << "\n"; std::cout << "measurementMatrix = \n"; std::cout << KF.measurementMatrix << "\n"; std::cout << "processNoiseCov = \n"; std::cout << KF.processNoiseCov << "\n"; std::cout << "measurementNoiseCov = \n"; std::cout << KF.measurementNoiseCov << "\n"; std::cout << "errorCovPost = \n"; std::cout << KF.errorCovPost << "\n"; control = Mat::zeros(3,1,CV_32FC1); control.at(0,0) = x; control.at(1,0) = y; control.at(2,0) = psi; std::cout << "control = \n"; std::cout << control << "\n"; Mat prediction = KF.predict(control); //ERROR std::cout << "finished prediction step\n"; return prediction; } Mat kalmanCorrect(float x, float y, float psi) { measurement.at(0,0) = x; measurement.at(1,0) = y; measurement.at(2,0) = psi; Mat correction = KF.correct(measurement); return correction; } void localizerCallback(const localization_msgs::Pose2DWithCovarianceStampedConstPtr &matcher_pose) { ROS_INFO("entering localizerCallback callback"); // initialize Kalman Filter if (init == true) initKalman((float)adma_pose.x,(float)adma_pose.y,(float)adma_pose.psi); init = false; // convert messages, [x y psi] are double values odom_pose.x = adma_pose.x - adma_pose_last.x; odom_pose.y = adma_pose.y - adma_pose_last.y; odom_pose.psi = adma_pose.psi - adma_pose_last.psi; msg2Pose(matcher_pose, mama_pose); // apply prediction and correction step pred = kalmanPredict((float)odom_pose.x,(float)odom_pose.y,(float)odom_pose.psi); corr = kalmanCorrect((float)mama_pose.x,(float)mama_pose.y,(float)mama_pose.psi); // write result result.x = (double) corr.at(0,0); result.y = (double) corr.at(1,0); result.psi = (double) corr.at(2,0); std::cout << "final psi = " << 180*result.psi/3.14159265 << std::endl; std::cout << "final [x_trans, y_trans] = " << "[" << result.x << ", " << result.y << "]" <

OpenCV Environment variable changed

$
0
0
I had my standalone installation of OpenCV on my Linux machine and it was running OK. I installed ROS (comes with its OpenCV) and today I cannot run my CMakeLists.txt in any of my OpenCV projects, getting the error of : CMake Error at CMakeLists.txt:20 (find_package): By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "OpenCV", but CMake did not find one. Could not find a package configuration file provided by "OpenCV" with any of the following names: OpenCVConfig.cmake opencv-config.cmake Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set "OpenCV_DIR" to a directory containing one of the above files. If "OpenCV" provides a separate development package or SDK, be sure it has been installed. I am kinda sure this happened because some environment variable got changed however I don't know where to look at. Could someone walk me through this?

Opencv Java MatOfFloat4 object cannot be created via constructor

$
0
0
I've a class which has the following variable: private MatOfFloat4 horizonLine = new MatOfFloat4(); which I later on pass into a function as follows: Imgproc.fitLine(tmpPoints, horizonLine, Imgproc.CV_DIST_L1, 0, 0.01, 0.01); However, I get an error saying that: Exception in thread "main" java.lang.UnsatisfiedLinkError: org.opencv.core.Mat.n_Mat()J at org.opencv.core.Mat.n_Mat(Native Method) at org.opencv.core.Mat.(Mat.java:24) at org.opencv.core.MatOfFloat4.(MatOfFloat4.java:12) at obstacleDetector.HorizonDetector.(HorizonDetector.java:327) at obstacleDetector.HorizonDetector.getInstance(HorizonDetector.java:59) at obstacleDetector.Detector.(Detector.java:28) which directs me to the initialization of the variable. Why can't OpenCV intialize this variable? What is wrong? **P.S:** If it matters, the class which I place this variable, is a Singleton class: public static HorizonDetector getInstance() { if (_instance == null) { _instance = new HorizonDetector(); } else { System.out.println("Same instance of the Horizon Detector-Singleton class already exists."); } return _instance; } Any thoughts?

How to Crop and save separately the bounded region?

$
0
0
![result_a.jpg](/upfiles/14793681749186702.jpg) here is my processed Image. I want to crop the bounded region and save the cropped area. Specially I want to crop the the Numbers for Digit Recognition Process. Please suggest how to do with OpenCv and C++.

Access violation reading location - when I am trying to do a clone(). The exception is in opencv_world300.dll

$
0
0
When I am trying to make a clone on a matrix an exception is thrown randomly for clone and for flip too. These exceptions are from opencv_world300.dll.![image description](/upfiles/14793894688227886.png) cv::Mat matrixDecoded = imdecode(cv::Mat(vectorImageDecoded), cv::IMREAD_UNCHANGED); imageMatrix = matrixDecoded.clone(); cv::flip(imageMatrix, imageMatrix, 0); Somebody knows why is happening? Thank you.

Using the opencv_contrib dnn module (too slow)

$
0
0
I am using a caffemodel (trained for gender classification) with the dnn module of the opencv_contrib library. The issue I am having is that it is running pretty well but it is extremly slow, it takes up to 10 seconds (sometimes) for a face to be processed. I believe the issue is that there is a bottleneck present in the `cv::gemm()` function - highlighted in this issue https://github.com/opencv/opencv_contrib/issues/490. According to the issue all you need to do is install OpenBLAS or MKL and the performance will increase, I have never used any of those libraries before, hence I am quite unsure how to approach this. Any guidance in regards to increasing the performance or how to setup a solution with OpenBLAS + opencv_contrib will be greatly appreciated. This is my setup: - C++ VS 2015 - OpenCV 3.1.0 - Windows 10

cvFindContours is faster than cv::findcontours

$
0
0
Hi, I'm using 2.4.8 opencv in a VS application and I have just updated source code changing old C functions with new C++ functions. In particular I have verified that cv::findcontours is slower than cvFindContours. Is it possible? Is this gap solved with newer versions? regards Andrea

UUsing filter2D causes crash in some Android based devices

$
0
0
Hi, I am writing c++ Native code for Android using JNI interface. I am doing some image processing and among others using the function filter2D. I have noticed that in new Android devices this works good but in older ones such as Samsung Galaxy 4 I am getting crashes of dlfree. I have looked at the crash summary and found that the reason was heap corruption caused by opencv 3.0, that is the version I am using. I did many tests and proved it was filter2D that was causing the problem. Is there an alternative function? can you think of a reason why this is happening and only on older devices? (I have checked numerous newer devices such as Samsung Galaxy 6 and OnePlus2 and they work fine). I also made sure it is not OS related by updating the Android version to 5 in the older devices and downgrading it in the newer devices. The problem still occurs only in the older devices.

Error: Sizes of input arguments do not match, why?

$
0
0
I have the following code and it produces the error **"Sizes of input arguments do not match"** at the line where I try to add two cv::Mat objs together. Why? std::vector depths; for (int i = 0; i<102; ++i) depths.push_back(cv::imread(img_path + std::to_string(i) + img_suffix)); cv::Mat mean_depth = cv::Mat::zeros(depths.at(0).size(), CV_64F); for (std::vector::size_type i = 0; i != depths.size(); i++) { mean_depth = mean_depth + depths[i]; }

Why findFundamentalMat gives different results for same but different orientation of points?

$
0
0
Sorry if the title is kind of weird. It is quite hard to express the question of my problem. So, I am in the middle of a 3D reconstruction project. The pipeline is more or less the same with the standard pipeline where 1. Undistort image 2. Detect points with keypoint detector 3. Track the points across frames (optical flow) 4. Calculate the fundamental matrix and so on. The only different part is at step 2 where I use a Line Segment Detector and track it across frames. So, if I am using a keypoint detector, giving two frame of images, I will get two set of keypoints (each set corresponds to each frame). But as for my situation, I have four set of keypoints (each two set correspond to each frame since a line has a start point and an end point). In order to calculate the Fundamental matrix, I need to concatenate the two sets of point of each frame. One way is by just vertically concatenate it: `np.vstack([start_point, end_point])`. The other way is by :`np.hstack([start_point, end_point]).reshape(-1, 2)`. Means, it is concatenated 'alternately', i.e. [[start_point[0], end_point[0], start_point[1], end_point[1], ...]] Both will end up with a same shape. But fair enough, they produce a quite different results. From my observation, the `vstack` produced a more '3D-like' result while the `hstack` produced a more 'planar-like' result for the reconstruction. The question is why is this? And which one supposed to be better? Below is sample code to give a view of this question: import numpy as np import cv2 np.random.seed(0) def prepare_points(pts_frame1, pts_frame2): # Prepare the four sets of points (p1_f1, p2_f1) = pts_frame1 (p1_f2, p2_f2) = pts_frame2 v_stacked_f1f2 = (np.vstack([p1_f1, p2_f1]), np.vstack([p1_f2, p2_f2])) h_stacked_f1f2 = (np.hstack([p1_f1, p2_f1]).reshape(-1, 2), np.hstack([p1_f2, p2_f2]).reshape(-1, 2)) return (v_stacked_f1f2, h_stacked_f1f2) pts_frame1 = np.random.random_sample((60, 2)).astype("float32") pts_frame2 = np.random.random_sample((60, 2)).astype("float32") # Emulate the two sets of points for each frame where # the first set is the start point, while # the second set is the end point of a line pts_frame1 = (pts_frame1[::2], pts_frame1[1::2]) pts_frame2 = (pts_frame2[::2], pts_frame2[1::2]) (v_stacked_f1f2, h_stacked_f1f2) = prepare_points(pts_frame1, pts_frame2) F_vstacked = cv2.findFundamentalMat(v_stacked_f1f2[0], v_stacked_f1f2[1], cv2.FM_RANSAC, 3, 0.99)[0] F_hstacked = cv2.findFundamentalMat(h_stacked_f1f2[0], h_stacked_f1f2[1], cv2.FM_RANSAC, 3, 0.99)[0] print("F_vstacked:\n", F_vstacked, "\n") print("F_hstacked:\n", F_hstacked, "\n") # The output: # F_vstacked: # [[ 3.31788127 -2.24336615 -0.77866782] # [ 0.83418839 -1.4066019 -0.92088302] # [-2.75413748 2.27311637 1. ]] # F_hstacked: # [[ 7.70558741 25.29966782 -16.20835082] # [-12.95357284 -0.54474384 14.95490469] # [ 1.79050172 -10.40077071 1. ]]

How to crop digits automatically in sequence for recognition?

$
0
0
I am trying to implement Automatic Digit Recognition. For this I am using C++ with OpenCv. I have successfully trained SVM classifier ,successfully can able to crop the digits from the group of digits. Manually it works fine. But my problem is when i am trying to extract the individual digits the output is coming in random manner , not maintaining the sequence. The below attached image is the output in which bounding box successfully drawn on individual digits and while extracting the individual digits the sequences should be i.e. for the number 0240408:-1st Position= 0, 2nd Position=2, 3rd Position=4, 4th Position=0, 5th Position=4, 6th Position= 0, 7th Position=8. But I am not getting the same, rather i am getting 1st Position= 8, 2nd Position= 0, 3rd Position= 4, 4th Position= 0, 5th Position= 0, 6th Position= 4, 7th Position= 2. Due to which the output number becomes= 8040042. Please suggest any techniques to overcome this problem. ![image description](/upfiles/14794451857638604.jpg)

How to crop a certain portion of image?

TW6864 support for opencv?

$
0
0
Hello everyone. I am using TW6864 frame grabber . I would like to know whether given frame grabber will support opencv based applications ? Thank you in advance.

Probability of two images matching?

$
0
0
Hello everyone. I have tons of binary images and want to sort them according to their similarities of a template. So i load a template and one of the test images. then i want to compare both of them (they are all of same size) and as result have a value in percentage that the image is matching the template. Once i get this percentage value, i am already able to sort the test images, i just need a way to calculate the similarities. the opencv matching method (http://docs.opencv.org/2.4/doc/tutorials/imgproc/histograms/template_matching/template_matching.html) doesnt seem to do the trick as far as i can see. anyone suggestions?

Modifing source code

$
0
0
Hi, I want to modify some part of openCV code. My purpose is to implement convolvution function with CUDA. I'm using ubuntu os, so was built by cmake and make commands. However, I'm new to cmake and makefile process. Thus, I doon't know how to include my file, which is .cu for cuda file, to source code. Could you give me suggestion?

Convert Mat to 16 bit int

$
0
0
Hi, I want to convert my 16 bit images from format cv::Mat to 16 bit. Currently, I am using this function int size = image.total() * image.elemSize(); // number of elements * size of elements float * bytes = new float[size]; std::memcpy(bytes, &image.data, size * sizeof(float)); return bytes; which only allows me to use 8 bit images (format bytes). Do you know a function call to convert cv::Mat to my desired bit format? Best ManuKlause

Scale iterative closest Point

$
0
0
Hello! I am looking for a method to find the correspondance between 2 points clouds. I already tried some Iterative closest point algorithm but they only allowed to find the rotation and translation. But I need the scale too. Thank you for any advices

Windows: VideoWriter compression dialog and codec number x264vfw

$
0
0
I want to encode some videos with h264 on windows using cv::VideoWriter in version 2.4.11 I downloaded and installed x264vfw https://sourceforge.net/projects/x264vfw/ and I can select x264vfw in the compression dialog if I choose `VideoWriter(filename, -1, parameters...)` Is it possible to select the same codec by choosing the right `fourcc integer` parameter and/or by choosing the right `CV_FOURCC(a,b,c,d)` characters a,b,c and d? Or is the compression dialog independent from those codes? using `CV_FOURCC('X', '2', '6', '4')` gives me `Could not find encoder for id 28: Encoder not found` same for `CV_FOURCC('H', '2', '6', '4')` (and `h264` / `x264`) So how to find the right integer value or fourcc code? Another possibility for me would be to open the compression dialog only once and later on release and open the VideoWriter again multiple times using the same parameters (or at least the same codec), but as far as I see, I always have to choose each parameter on `.open()` so I would have to click through the compression dialog again and again? Any other advice?
Viewing all 19555 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>