matching

Matching template images with masks using OpenCV and C++

Deadly 提交于 2019-12-25 02:11:56
问题 How can I match a masked image using matchTemplate() in OpenCV with C++? This is my masked template image: And this is my source image: 回答1: Look at opencv example. You gotta call the matchTemplate function: matchTemplate( img, templ, result, match_method ); 回答2: matchTemplate 's fifth argument is a mask array which you can use for this purpose. In your case, you'll want a binary mask. That is, a Mat with: depth CV_8U , and dimensions equal to your template image, and the pixels you want to

Maximum weighted bipartite matching for two sets of vertices of drastically different sizes

邮差的信 提交于 2019-12-25 01:46:04
问题 The abstract problem I want to find the best maximum matching in a complete weighted bipartite graph where the two sets of vertices differ drastically in size, i.e. one set of vertices is very large and the other one very small. The Hungarian algorithm is not a good approach for this problem since it adds dummy vertices to the smaller set such that the two sets have the same size, so I lose all the potential efficiency gains from one of the vertex sets being only very small. More concretely I

Match Three or More Nearest Numbers from arrays

烂漫一生 提交于 2019-12-25 01:45:33
问题 I have four arrays of size 2^N where N = 25. The elements of arrays have been generated by my algorithm. These are sorted but contain numbers. Now I have to take each element of array1 and select elements of array2, array3, array4 such that sum of them should be minimum (when I say sum I can take a1[k] +-a2[j]+-a3[m]+-a4[t]. I think it is similar to K Dimension merge problem. Can some one point to the literature/implementation /heuristic for doing the same. Regards, Allahbaksh 回答1: Step 1 For

how find or match one data frame as a subset(full) into another data frame in R?

ⅰ亾dé卋堺 提交于 2019-12-24 18:21:36
问题 I have two data frames df1 and df2 given below. df1 is c1 c2 c3 c4 B 2.34000 1.00 I A 14.43000 2.10 J D 3.45515 1.00 K B 2.50000 2.09 A 2.44000 1.10 K K 5.00000 1.09 L df2 is: c1 c2 c3 B 2.34 1.00 A 14.43 2.10 D 3.43 1.00 B 2.50 2.09 E 5.00 1.09 A 2.44 1.10 the requirement here is like this: there is matching(or comparison) between these two data frames. if df2 completely found ( that means the content of df2 matched with any subset of df1 irrespective of the order ) in df1 (either exactly

Line matches not showing during File Search in Eclipse 3.5 / Zend 7.2

余生颓废 提交于 2019-12-24 15:18:15
问题 Somehow my Eclipse (Zend 7.2) doesn't show the line matches in the treeview when doing a File Search. It shows the files that match, but I can't unfold it to see what lines the matches are on. On my other computer at work (same software) it does work like it should. Is there any way to reinstall the Search-module or does anybody know what could be wrong with it? 回答1: Solved. Changed the shortcut to include the parameter -clean and now line matches are shown again ! eclipse.exe -clean or

awk matching incorrect hostname in /etc/hosts

≡放荡痞女 提交于 2019-12-24 10:28:55
问题 I am using this awk code to pick out an IP address in the /etc/hosts file and although I can force it to match the correct hostname, awk will select an "almost like" hostname if it see's it first. I have researched this and I cannot figure it out. sUSER=machine_005 ip=$(awk '/^[[:space:]]*($|#)/{next}/'$sUSER'/{print $1; exit}' /etc/hosts) I know the first part looks for $ or # and if found calls the next line. This feature is needed in the final formula. The other feature needed is to stop

showing similar value in x and y-axis in matlab

旧巷老猫 提交于 2019-12-24 09:26:11
问题 i have matrix as below; from the calculation there will be some value that will be have same value to each other when plotting in graph (i used scatter plot), the question here is how to know/identify which calculation is giving the matching data and can it be stored in the table. i have tried used find function in matlab but error occured. A = [2/3 -1/3 -1/3; -1/3 2/3 -1/3; -1/3 -1/3 2/3]; B=[0 0 0; 0 0 1; 0 1 0; 0 1 1; 1 0 0; 1 0 1; 1 1 0; 1 1 1]; d= [2/3 -1/3 -1/3]; q = [0 0.5773 -0.5773];

Matching two data lists in Excel VBA and exporting to New Sheet

▼魔方 西西 提交于 2019-12-24 02:17:11
问题 I receive an excel file monthly and have to export parts of it to a new file. I have a list of identifier numbers and I am trying to match the list of numbers in the selected list to the full file and then export the rows of relevant data to a new sheet. Sub Run_All_Macros() Application.ScreenUpdating = False Sheets.Add.Name = "Output" Call Convert_to_Numbers Call Highlight_Selected_Contractors End Sub 'Original Spreadsheet is formatted incorrectly 'Convert PSD Codes to Numbers Sub Convert_to

Lucene wildcard matching fails on chemical notations(?)

有些话、适合烂在心里 提交于 2019-12-24 01:16:06
问题 Using Hibernate Search Annotations (mostly just @Field(index = Index.TOKENIZED) ) I've indexed a number of fields related to a persisted class of mine called Compound. I've setup text search over all the indexed fields, using the MultiFieldQueryParser, which has so far worked fine. Among the fields indexed and searchable is a field called compoundName, with sample values: 3-Hydroxyflavone 6,4'-Dihydroxyflavone When I search for either of these values in full the related Compound instances are

Java repetitive pattern matching

我怕爱的太早我们不能终老 提交于 2019-12-24 00:17:26
问题 I am trying to get each of the repetitive matches of a simple regular expression in Java: (\\[[^\\[]*\\])* which matches any string enclosed in [], as long as it does not contain the [ character. For example, it would match [a][nice][repetitive][pattern] There is no prior knowledge of how many such groups exist and I cannot find a way of accessing the individual matching groups via a pattern matcher, i.e. can't get [a], [nice], [repetitive], [pattern] (or, even better, the text without the