Page 1 of 2

Corner squares coord+size detection

Posted: 2012-06-12T15:34:27-07:00
by vitsin
hi,
I've tried separate Fred's script to detect XY coords(and size) of 3 corner squares:
./separate.sh -v -l -m 5 -b black -g 2 negated.png t5.png

Instead, separate detected 34 objects and created 34 t* files.
3 of 34 t-files are the black background with white suqares - exactly what I need.
So I'm kinda close, but not enough.

Assumptions, all those 3 squares are:
- all equal size
- positioned in 3 different corners
- and they could be only biggest squares if there are any other squares in the image

So how can I get their coords and size please?

Without any offence, but it takes 10-12 seconds for separate to run;
and all I need is to etract details ONLY of those corner squares,
skipping any other objects.


How can I attach example image to the topic please?

Re: Corner squares coord+size detection

Posted: 2012-06-12T16:36:51-07:00
by fmw42
post your image to any free image hosting web site. search google for them. one common one is dropbox. then put a link in this forum to your image on the free server.

separate can be slow if you have not removed small noise assuming your image is binary, since it will look for every single white spot. you can try filtering your image with -morphology open/close or -median. see http://www.imagemagick.org/Usage/morphology/#open

I need to see your image to be able to give better feedback.

Re: Corner squares coord+size detection

Posted: 2012-06-13T07:15:46-07:00
by vitsin
hi,
thank you for reply.
Here is the example image link: https://dl.dropbox.com/u/85152046/negated.png
What I looking for is to extract coords+size of those 3 corner thick white squares please.

regards,
--vs

Re: Corner squares coord+size detection

Posted: 2012-06-13T10:24:25-07:00
by fmw42
Your image has too large white blocks to effectively filter out. And it is a security pattern, so I hope you are not trying to break into some system with it.

Use -separate to get the white areas, which should include the outer white rectangular ring on each of the 3 corners.

However, in trying your image, it does not seem to be working correctly.

Seems to be either some noise in your image or the png format. So I converted it to gif with thresholding. Then it worked to get 34 sections of which 3 were the outer white rectangular rings in the 3 corners. However, the geometry output is messed up and it does not seem to trim. So I will look into that and get back with a correction.


convert negated.png -threshold 0 negated.gif
separate -m 5 negated.gif negated_test.gif


(Odd that it still fails with PNG even after thresholding and saving as PNG. I will have to look into that also)

Re: Corner squares coord+size detection

Posted: 2012-06-13T11:53:48-07:00
by fmw42
I have fixed a few things and uploaded a new script. So you can try either of the following now. The second, with an appropriate -g argument runs faster. However, I am not sure why there are so many frames that are totally white. It appears that they correspond to the small white isolated squares. I need to look into this further.


Code: Select all

separate -m 5 -t -v -l negated.png negatedpng.gif
numimages=34

negatedpng-1.gif: 70x70+50+50
negatedpng-2.gif: 30x30+130+50
negatedpng-3.gif: 10x10+170+50
negatedpng-4.gif: 70x70+190+50
negatedpng-5.gif: 30x30+70+70
negatedpng-6.gif: 30x30+210+70
negatedpng-7.gif: 10x10+130+80
negatedpng-8.gif: 30x30+150+80
negatedpng-9.gif: 10x10+140+100
negatedpng-10.gif: 10x10+130+110
negatedpng-11.gif: 10x10+150+110
negatedpng-12.gif: 10x20+170+110
negatedpng-13.gif: 60x100+120+120
negatedpng-14.gif: 10x10+70+130
negatedpng-15.gif: 70x50+50+130
negatedpng-16.gif: 10x10+180+130
negatedpng-17.gif: 10x10+220+130
negatedpng-18.gif: 40x100+220+130
negatedpng-19.gif: 60x40+160+140
negatedpng-20.gif: 10x10+110+150
negatedpng-21.gif: 20x20+100+160
negatedpng-22.gif: 20x30+210+170
negatedpng-23.gif: 70x70+50+190
negatedpng-24.gif: 10x10+170+200
negatedpng-25.gif: 60x60+170+200
negatedpng-26.gif: 30x30+70+210
negatedpng-27.gif: 20x10+210+210
negatedpng-28.gif: 10x10+140+220
negatedpng-29.gif: 10x10+130+230
negatedpng-30.gif: 10x10+230+230
negatedpng-31.gif: 10x10+250+230
negatedpng-32.gif: 30x20+140+240
negatedpng-33.gif: 30x20+230+240
or much faster is

Code: Select all

separate -m 5 -t -v -l -g 5 negated.gif negatedpng5.gif
45 45 1 1
135 45 1 2
165 45 1 3
195 45 1 4
75 75 1 5
165 75 1 6
210 75 1 7
150 105 1 8
165 105 1 9
135 120 1 10
75 135 1 11
165 135 1 12
240 135 1 13
105 150 1 14
105 165 1 15
45 195 1 16
165 195 1 17
75 210 1 18
210 210 1 19
165 225 1 20
225 225 1 21
135 240 1 22
240 240 1 23
numimages=24

negatedpng5-1.gif: 70x70+50+50
negatedpng5-2.gif: 30x30+130+50
negatedpng5-3.gif: 10x10+170+50
negatedpng5-4.gif: 70x70+190+50
negatedpng5-5.gif: 30x30+70+70
negatedpng5-6.gif: 30x30+150+80
negatedpng5-7.gif: 30x30+210+70
negatedpng5-8.gif: 10x10+150+110
negatedpng5-9.gif: 10x20+170+110
negatedpng5-10.gif: 60x100+120+120
negatedpng5-11.gif: 70x50+50+130
negatedpng5-12.gif: 60x40+160+140
negatedpng5-13.gif: 40x100+220+130
negatedpng5-14.gif: 10x10+110+150
negatedpng5-15.gif: 20x20+100+160
negatedpng5-16.gif: 70x70+50+190
negatedpng5-17.gif: 10x10+170+200
negatedpng5-18.gif: 30x30+70+210
negatedpng5-19.gif: 20x10+210+210
negatedpng5-20.gif: 60x60+170+200
negatedpng5-21.gif: 10x10+230+230
negatedpng5-22.gif: 30x20+140+240
negatedpng5-23.gif: 30x20+230+240

Re: Corner squares coord+size detection

Posted: 2012-06-13T11:57:20-07:00
by vitsin
Thank you for looking into it.
The image is qr code while background and foreground colors are simply reversed. Try to use any qr code scan software to read it.

regards,
--vs

Re: Corner squares coord+size detection

Posted: 2012-06-13T13:14:20-07:00
by fmw42
Here is perhaps a better approach. Cut out one corner square to use as a template. Then use it with the full image in IM compare to located the best match for it. Then use my maxima script to find the 3 locations that are the best match from the match score output image from compare.

template:
Image

identify -format "%wx%h" negated_template.png
70x70

compare -metric rmse -subimage-search negated.png negated_template.png negated_results.png
0 (0) @ 45,45


maxima -r 5 -n 3 negated_results-1.png
45,45 gray=65535,255,100%
185,45 gray=65535,255,100%
45,185 gray=65535,255,100%

For this you would not even have to negate your image. It works with both polarities. The compare can be a little slow, but faster than my separate script.

Re: Corner squares coord+size detection

Posted: 2012-06-13T14:00:37-07:00
by fmw42
Here is another way. Trim the image, then convert the first row and first column to txt format and look at the data to find the locations of the corner boxes. You can also profile the rows and columns with my script, profile or with Anthony's script, im_profile.

convert negated.png -trim +repage negated_trim.gif

identify -format "%wx%h" negated_trim.gif
210x210

convert negated_trim.gif[1x210+0+0] txt:

convert negated_trim.gif[210x1+0+0] txt:

Then look for changes between white and black (gray(255) and gray(0))

Re: Corner squares coord+size detection

Posted: 2012-06-14T10:13:38-07:00
by vitsin
"Cut out one corner square to use as a template" - how?
Also, square could change, its not a static size template.

Re: Corner squares coord+size detection

Posted: 2012-06-14T10:22:42-07:00
by vitsin
Could you please elaborate on 2nd approach?
I did not und at all "Then look for changes between white and black (gray(255) and gray(0))" ...

thank you.

Re: Corner squares coord+size detection

Posted: 2012-06-14T13:13:03-07:00
by fmw42
# trim
convert negated.png -trim +repage negated_trim.gif

# print first row
convert negated_trim.gif[210x1+0+0] txt:

# ImageMagick pixel enumeration: 210,1,255,gray
0,0: (255,255,255) #FFFFFF gray(255,255,255) --- white
1,0: (255,255,255) #FFFFFF gray(255,255,255)
2,0: (255,255,255) #FFFFFF gray(255,255,255)
3,0: (255,255,255) #FFFFFF gray(255,255,255)
4,0: (255,255,255) #FFFFFF gray(255,255,255)
5,0: (255,255,255) #FFFFFF gray(255,255,255)
6,0: (255,255,255) #FFFFFF gray(255,255,255)
7,0: (255,255,255) #FFFFFF gray(255,255,255)
8,0: (255,255,255) #FFFFFF gray(255,255,255)
9,0: (255,255,255) #FFFFFF gray(255,255,255)
10,0: (255,255,255) #FFFFFF gray(255,255,255)
11,0: (255,255,255) #FFFFFF gray(255,255,255)
12,0: (255,255,255) #FFFFFF gray(255,255,255)
13,0: (255,255,255) #FFFFFF gray(255,255,255)
14,0: (255,255,255) #FFFFFF gray(255,255,255)
15,0: (255,255,255) #FFFFFF gray(255,255,255)
16,0: (255,255,255) #FFFFFF gray(255,255,255)
17,0: (255,255,255) #FFFFFF gray(255,255,255)
18,0: (255,255,255) #FFFFFF gray(255,255,255)
19,0: (255,255,255) #FFFFFF gray(255,255,255)
20,0: (255,255,255) #FFFFFF gray(255,255,255)
21,0: (255,255,255) #FFFFFF gray(255,255,255)
22,0: (255,255,255) #FFFFFF gray(255,255,255)
23,0: (255,255,255) #FFFFFF gray(255,255,255)
24,0: (255,255,255) #FFFFFF gray(255,255,255)
25,0: (255,255,255) #FFFFFF gray(255,255,255)
26,0: (255,255,255) #FFFFFF gray(255,255,255)
27,0: (255,255,255) #FFFFFF gray(255,255,255)
28,0: (255,255,255) #FFFFFF gray(255,255,255)
29,0: (255,255,255) #FFFFFF gray(255,255,255)
30,0: (255,255,255) #FFFFFF gray(255,255,255)
31,0: (255,255,255) #FFFFFF gray(255,255,255)
32,0: (255,255,255) #FFFFFF gray(255,255,255)
33,0: (255,255,255) #FFFFFF gray(255,255,255)
34,0: (255,255,255) #FFFFFF gray(255,255,255)
35,0: (255,255,255) #FFFFFF gray(255,255,255)
36,0: (255,255,255) #FFFFFF gray(255,255,255)
37,0: (255,255,255) #FFFFFF gray(255,255,255)
38,0: (255,255,255) #FFFFFF gray(255,255,255)
39,0: (255,255,255) #FFFFFF gray(255,255,255)
40,0: (255,255,255) #FFFFFF gray(255,255,255)
41,0: (255,255,255) #FFFFFF gray(255,255,255)
42,0: (255,255,255) #FFFFFF gray(255,255,255)
43,0: (255,255,255) #FFFFFF gray(255,255,255)
44,0: (255,255,255) #FFFFFF gray(255,255,255)
45,0: (255,255,255) #FFFFFF gray(255,255,255)
46,0: (255,255,255) #FFFFFF gray(255,255,255)
47,0: (255,255,255) #FFFFFF gray(255,255,255)
48,0: (255,255,255) #FFFFFF gray(255,255,255)
49,0: (255,255,255) #FFFFFF gray(255,255,255)
50,0: (255,255,255) #FFFFFF gray(255,255,255)
51,0: (255,255,255) #FFFFFF gray(255,255,255)
52,0: (255,255,255) #FFFFFF gray(255,255,255)
53,0: (255,255,255) #FFFFFF gray(255,255,255)
54,0: (255,255,255) #FFFFFF gray(255,255,255)
55,0: (255,255,255) #FFFFFF gray(255,255,255)
56,0: (255,255,255) #FFFFFF gray(255,255,255)
57,0: (255,255,255) #FFFFFF gray(255,255,255)
58,0: (255,255,255) #FFFFFF gray(255,255,255)
59,0: (255,255,255) #FFFFFF gray(255,255,255)
60,0: (255,255,255) #FFFFFF gray(255,255,255)
61,0: (255,255,255) #FFFFFF gray(255,255,255)
62,0: (255,255,255) #FFFFFF gray(255,255,255)
63,0: (255,255,255) #FFFFFF gray(255,255,255)
64,0: (255,255,255) #FFFFFF gray(255,255,255)
65,0: (255,255,255) #FFFFFF gray(255,255,255)
66,0: (255,255,255) #FFFFFF gray(255,255,255)
67,0: (255,255,255) #FFFFFF gray(255,255,255)
68,0: (255,255,255) #FFFFFF gray(255,255,255)
69,0: (255,255,255) #FFFFFF gray(255,255,255) --- last white before black
70,0: ( 0, 0, 0) #000000 gray(0,0,0) --- black
71,0: ( 0, 0, 0) #000000 gray(0,0,0)
72,0: ( 0, 0, 0) #000000 gray(0,0,0)
73,0: ( 0, 0, 0) #000000 gray(0,0,0)
74,0: ( 0, 0, 0) #000000 gray(0,0,0)
75,0: ( 0, 0, 0) #000000 gray(0,0,0)
76,0: ( 0, 0, 0) #000000 gray(0,0,0)
77,0: ( 0, 0, 0) #000000 gray(0,0,0)
78,0: ( 0, 0, 0) #000000 gray(0,0,0)
79,0: ( 0, 0, 0) #000000 gray(0,0,0)
80,0: (255,255,255) #FFFFFF gray(255,255,255)
81,0: (255,255,255) #FFFFFF gray(255,255,255)
82,0: (255,255,255) #FFFFFF gray(255,255,255)
83,0: (255,255,255) #FFFFFF gray(255,255,255)
84,0: (255,255,255) #FFFFFF gray(255,255,255)
85,0: (255,255,255) #FFFFFF gray(255,255,255)
86,0: (255,255,255) #FFFFFF gray(255,255,255)
87,0: (255,255,255) #FFFFFF gray(255,255,255)
88,0: (255,255,255) #FFFFFF gray(255,255,255)
89,0: (255,255,255) #FFFFFF gray(255,255,255)
90,0: (255,255,255) #FFFFFF gray(255,255,255)
91,0: (255,255,255) #FFFFFF gray(255,255,255)
92,0: (255,255,255) #FFFFFF gray(255,255,255)
93,0: (255,255,255) #FFFFFF gray(255,255,255)
94,0: (255,255,255) #FFFFFF gray(255,255,255)
95,0: (255,255,255) #FFFFFF gray(255,255,255)
96,0: (255,255,255) #FFFFFF gray(255,255,255)
97,0: (255,255,255) #FFFFFF gray(255,255,255)
98,0: (255,255,255) #FFFFFF gray(255,255,255)
99,0: (255,255,255) #FFFFFF gray(255,255,255)
100,0: (255,255,255) #FFFFFF gray(255,255,255)
101,0: (255,255,255) #FFFFFF gray(255,255,255)
102,0: (255,255,255) #FFFFFF gray(255,255,255)
103,0: (255,255,255) #FFFFFF gray(255,255,255)
104,0: (255,255,255) #FFFFFF gray(255,255,255)
105,0: (255,255,255) #FFFFFF gray(255,255,255)
106,0: (255,255,255) #FFFFFF gray(255,255,255)
107,0: (255,255,255) #FFFFFF gray(255,255,255)
108,0: (255,255,255) #FFFFFF gray(255,255,255)
109,0: (255,255,255) #FFFFFF gray(255,255,255)
110,0: ( 0, 0, 0) #000000 gray(0,0,0)
111,0: ( 0, 0, 0) #000000 gray(0,0,0)
112,0: ( 0, 0, 0) #000000 gray(0,0,0)
113,0: ( 0, 0, 0) #000000 gray(0,0,0)
114,0: ( 0, 0, 0) #000000 gray(0,0,0)
115,0: ( 0, 0, 0) #000000 gray(0,0,0)
116,0: ( 0, 0, 0) #000000 gray(0,0,0)
117,0: ( 0, 0, 0) #000000 gray(0,0,0)
118,0: ( 0, 0, 0) #000000 gray(0,0,0)
119,0: ( 0, 0, 0) #000000 gray(0,0,0)
120,0: (255,255,255) #FFFFFF gray(255,255,255)
121,0: (255,255,255) #FFFFFF gray(255,255,255)
122,0: (255,255,255) #FFFFFF gray(255,255,255)
123,0: (255,255,255) #FFFFFF gray(255,255,255)
124,0: (255,255,255) #FFFFFF gray(255,255,255)
125,0: (255,255,255) #FFFFFF gray(255,255,255)
126,0: (255,255,255) #FFFFFF gray(255,255,255)
127,0: (255,255,255) #FFFFFF gray(255,255,255)
128,0: (255,255,255) #FFFFFF gray(255,255,255)
129,0: (255,255,255) #FFFFFF gray(255,255,255)
130,0: ( 0, 0, 0) #000000 gray(0,0,0)
131,0: ( 0, 0, 0) #000000 gray(0,0,0)
132,0: ( 0, 0, 0) #000000 gray(0,0,0)
133,0: ( 0, 0, 0) #000000 gray(0,0,0)
134,0: ( 0, 0, 0) #000000 gray(0,0,0)
135,0: ( 0, 0, 0) #000000 gray(0,0,0)
136,0: ( 0, 0, 0) #000000 gray(0,0,0)
137,0: ( 0, 0, 0) #000000 gray(0,0,0)
138,0: ( 0, 0, 0) #000000 gray(0,0,0)
139,0: ( 0, 0, 0) #000000 gray(0,0,0) --- black
140,0: (255,255,255) #FFFFFF gray(255,255,255) --- first white
141,0: (255,255,255) #FFFFFF gray(255,255,255)
142,0: (255,255,255) #FFFFFF gray(255,255,255)
143,0: (255,255,255) #FFFFFF gray(255,255,255)
144,0: (255,255,255) #FFFFFF gray(255,255,255)
145,0: (255,255,255) #FFFFFF gray(255,255,255)
146,0: (255,255,255) #FFFFFF gray(255,255,255)
147,0: (255,255,255) #FFFFFF gray(255,255,255)
148,0: (255,255,255) #FFFFFF gray(255,255,255)
149,0: (255,255,255) #FFFFFF gray(255,255,255)
150,0: (255,255,255) #FFFFFF gray(255,255,255)
151,0: (255,255,255) #FFFFFF gray(255,255,255)
152,0: (255,255,255) #FFFFFF gray(255,255,255)
153,0: (255,255,255) #FFFFFF gray(255,255,255)
154,0: (255,255,255) #FFFFFF gray(255,255,255)
155,0: (255,255,255) #FFFFFF gray(255,255,255)
156,0: (255,255,255) #FFFFFF gray(255,255,255)
157,0: (255,255,255) #FFFFFF gray(255,255,255)
158,0: (255,255,255) #FFFFFF gray(255,255,255)
159,0: (255,255,255) #FFFFFF gray(255,255,255)
160,0: (255,255,255) #FFFFFF gray(255,255,255)
161,0: (255,255,255) #FFFFFF gray(255,255,255)
162,0: (255,255,255) #FFFFFF gray(255,255,255)
163,0: (255,255,255) #FFFFFF gray(255,255,255)
164,0: (255,255,255) #FFFFFF gray(255,255,255)
165,0: (255,255,255) #FFFFFF gray(255,255,255)
166,0: (255,255,255) #FFFFFF gray(255,255,255)
167,0: (255,255,255) #FFFFFF gray(255,255,255)
168,0: (255,255,255) #FFFFFF gray(255,255,255)
169,0: (255,255,255) #FFFFFF gray(255,255,255)
170,0: (255,255,255) #FFFFFF gray(255,255,255)
171,0: (255,255,255) #FFFFFF gray(255,255,255)
172,0: (255,255,255) #FFFFFF gray(255,255,255)
173,0: (255,255,255) #FFFFFF gray(255,255,255)
174,0: (255,255,255) #FFFFFF gray(255,255,255)
175,0: (255,255,255) #FFFFFF gray(255,255,255)
176,0: (255,255,255) #FFFFFF gray(255,255,255)
177,0: (255,255,255) #FFFFFF gray(255,255,255)
178,0: (255,255,255) #FFFFFF gray(255,255,255)
179,0: (255,255,255) #FFFFFF gray(255,255,255)
180,0: (255,255,255) #FFFFFF gray(255,255,255)
181,0: (255,255,255) #FFFFFF gray(255,255,255)
182,0: (255,255,255) #FFFFFF gray(255,255,255)
183,0: (255,255,255) #FFFFFF gray(255,255,255)
184,0: (255,255,255) #FFFFFF gray(255,255,255)
185,0: (255,255,255) #FFFFFF gray(255,255,255)
186,0: (255,255,255) #FFFFFF gray(255,255,255)
187,0: (255,255,255) #FFFFFF gray(255,255,255)
188,0: (255,255,255) #FFFFFF gray(255,255,255)
189,0: (255,255,255) #FFFFFF gray(255,255,255)
190,0: (255,255,255) #FFFFFF gray(255,255,255)
191,0: (255,255,255) #FFFFFF gray(255,255,255)
192,0: (255,255,255) #FFFFFF gray(255,255,255)
193,0: (255,255,255) #FFFFFF gray(255,255,255)
194,0: (255,255,255) #FFFFFF gray(255,255,255)
195,0: (255,255,255) #FFFFFF gray(255,255,255)
196,0: (255,255,255) #FFFFFF gray(255,255,255)
197,0: (255,255,255) #FFFFFF gray(255,255,255)
198,0: (255,255,255) #FFFFFF gray(255,255,255)
199,0: (255,255,255) #FFFFFF gray(255,255,255)
200,0: (255,255,255) #FFFFFF gray(255,255,255)
201,0: (255,255,255) #FFFFFF gray(255,255,255)
202,0: (255,255,255) #FFFFFF gray(255,255,255)
203,0: (255,255,255) #FFFFFF gray(255,255,255)
204,0: (255,255,255) #FFFFFF gray(255,255,255)
205,0: (255,255,255) #FFFFFF gray(255,255,255)
206,0: (255,255,255) #FFFFFF gray(255,255,255)
207,0: (255,255,255) #FFFFFF gray(255,255,255)
208,0: (255,255,255) #FFFFFF gray(255,255,255)
209,0: (255,255,255) #FFFFFF gray(255,255,255) --- last white


First square is between 0,0 and 69,0 in X coordinate. Second is between 140,0 and 209,0. So those coordinates tell you where to crop in X. Do the same in Y with the first column

Re: Corner squares coord+size detection

Posted: 2012-06-14T14:59:34-07:00
by vitsin
2nd method is definitely faster and clear now, thank you.
One issue with it:
convert negated.png -trim +repage negated_trim.gif -> this one trimmed the black border/margin around image resizing it from 300x300 into 225x225.
And than now the 0,0 coords for corner image are incorrect if I'm searching it in the original image ...

Could you please elaborate on approach with the template extraction?
I und it all except how to extract one template.

thank you,
--vs

Re: Corner squares coord+size detection

Posted: 2012-06-14T15:57:27-07:00
by fmw42
The trimmed image has the offset from the full size.

convert trimmedimage -format "%O" info:

So you can compute the offset to the sections you want.

You have to trim so that you know that the first row and column will show the areas you are interested in.


For a similar type problem see http://studio.imagemagick.org/discourse ... =1&t=21112

Re: Corner squares coord+size detection

Posted: 2012-06-14T16:06:51-07:00
by vitsin
hi again,
althoug the method of using separate new script is slower, but its the most precise to the solution I'm looking for.

I've tried with new_negated.png the following:
./separate2.sh -m 5 -t -v -l -g 5 new_negated tt.gif
Got: for ex one square: tt-28.gif: 56x56+39+215 (and tt-3.gif 56x56+215+39)

Now using 56x56+39+215 writing red rectangle to see if coords match:
convert new_negated.png -fill red -draw "rectangle 56,56 (56+39),(56+215)" new_negated_red.png

Two issues came up:
1. new separate script found only 2 from 3 squares in this example! After more testing: in 6 from 10 use cases it finds 3 squares, in 4 cases - only 2. 40% mistake?
2. 56x56+39+215 - coordinates are wrong by 5 pixels. I've tried 10 more other different examples: always 5 pixels for any square. At least its consistent.
Correct coordinates are: 56X56+34+210

https://dl.dropbox.com/u/85152046/new_negated.png
https://dl.dropbox.com/u/85152046/new_negated_red.png
https://dl.dropbox.com/u/85152046/new_n ... orrect.png

Thank you for your time and effort!
regards,
--vs

Re: Corner squares coord+size detection

Posted: 2012-06-14T16:11:16-07:00
by fmw42
that is because you used the -g option and it must be tuned for each image to capture the 3 squares. If you leave off -g and let it do it automatically, it will find everything and that will ensure you get the 3 squares. It will just take much longer and produce more output images and coordinates.

You can also try making -g smaller until you get more consistent results, presuming that it is not so small that the automatic method becomes faster.


Personally I think that the last method of trimming and getting one row and column and doing some analysis would be much faster. But you have to work out the filtering to find that first and last white sections.