It is not easy to progress to the whole project, but the technical content is not so high. It is too annoying to make a mistake in the middle. No matter what, now it faces the biggest difficulty, image processing algorithm. The algorithm is really not easy to get, although it was done before, but it is not for images.
There are too many image algorithms now. It seems that no one is studying. There is no unified route. It is more and more confused to read the papers. In desperation, I still have to learn well. Fortunately, my teammates have done it before, and everyone is willing to participate. Come in, very happy!
First change the strategy, I have been using the OpenCV library for image processing in QT directly in linux, but the efficiency is too bad, every time you want the result, you must use the board, so now use OpenCV+vs2010 now Test on the PC until you are satisfied and copy it to the board for testing.
Change the tool, you must first configure it. Fortunately, it has been done before, and there are many people using it, so it is quite smooth: reference blog
Write the program yourself, the test result compile error: LINK: fatal error LNK1123: Failed during conversion to COFF: File is invalid or damaged
Baidu, ?mod=viewthread&TId=10226 This post is good, after the patch is installed, the compiler build solution is successful.
Tested the applet and it can be used.
For your own problems, the problem now is that the crescent can not be extracted, so rack your brains and do everything possible to separate this crescent, find a way to try it one by one.
After the addition of OpenCV, there is an error in the compilation:
This method is solved.
First of all, we have already carried out a preliminary segmentation of the image, which can extract the outline of the nail, but the effect is not very satisfactory. It can be seen that the light is obviously affected, and measures need to be taken to solve the lighting problem. As shown below:
Now I want to further process the picture taken by the buckle, that is, extract the feature of the second picture, find the crescent, the ratio of the crescent and the nail bed, the color of the crescent, the color of the nail bed, whether the nail bed is There are spots, horizontal stripes, and vertical stripes, which are used as the basis for the medical diagnosis theory.
Since there is no longer any progress based on grayscale images, it is better to divide them with color images. I have also explored it before and found that it still has a certain effect.
The RGB color space is the most basic, most common, hardware-oriented color space in image processing. The color images we collect are generally stored as components that are divided into R, G, and B. However, fruit images acquired in the natural environment are susceptible to natural light, leaf occlusion, and shadows, that is, sensitive to brightness. The components of the RGB color space are closely related to the brightness, that is, as long as the brightness changes, the three components will change accordingly. Therefore, the RGB color space is suitable for display systems, but it is not suitable for image processing.
HSL and HSV (also known as HSB) are two relational representations of points in the RGB color space that attempt to describe a more accurate perceived color relationship than RGB and remain computationally simple.
H means hue (hue), S means saturaTIon (saturation), L means lightness, V means value, and B means brightness.
Hue (H) is the basic property of color, which is commonly referred to as the color name, such as red, yellow, and so on.
Saturation (S) refers to the purity of the color. The higher the color, the softer the color, the lower the color is gradually grayed out, taking a value of 0-100%.
Brightness (V), brightness (L), take 0-100%.
According to this picture, the HSV space can be well understood. So next, use color images for analysis to see the effect. It seems that you can pick up your nails first. Anyway, try it first.
First check the paper, see a lot of clustering methods, the kmeans method first came, but fortunately OpenCV also has this function, first come to learn.
K-means algorithm is the most classic partition-based clustering method and one of the top ten classical data mining algorithms. The basic idea of ​​the K-means algorithm is to cluster the k points in the space and classify the objects closest to them. The iterative method is used to update the values ​​of each cluster center one by one until the best clustering result is obtained.
The version of my OpenCV is 2.3.1. The implementation of Kmean is in modulescoresrcmatrix.cpp. I want to recommend a blog here, which is quite clear: ?p=8
Examples can be seen:
Double cv::kmeans( InputArray _data, int K, InputOutputArray _bestLabels, TermCriteria criteria, int attempts, int flags, OutputArray _centers )
The following is an analysis of this function.
_data: This is the data you want to process, such as a CvMat data.
K : The number of clusters you need to generate eventually
_bestLabels: When cv::kmeans is executed, _bestLabels stores the index of the cluster where each corresponding data element is located, so you can update your data, which is the markup matrix.
Criteria: This is used to tell cv::kmeans to run with a stop condition, such as criteria.epsilon = 0.01f; criteria.type = CV_TERMCRIT_EPS; this represents the distance difference between the centers after two rounds of cluster operation, if If the distance is less than or equal to criteria.epsilon, it stops returning the currently obtained centers, otherwise it continues.
Attempts: How many times to try, the document says the general setting is 2
Flags: This is mainly to pass some configuration parameters, such as the label -KMEANS_USE_INITIAL_LABELS given by the user code at the beginning, if using kmeans++ initialization algorithm - KMEANS_PP_CENTERS
Al2O3 Aerospace Ceramics, Aerospace Ceramic Part, ceramic for aerospace
Yixing Guangming Special Ceramics Co.,Ltd , https://www.yxgmtc.com