Search found 42 matches

by cgkas
2018-10-18T13:53:00-07:00
Forum: Users
Topic: Replace color but only in some regions
Replies: 18
Views: 8279

Replace color but only in some regions

Hi, as part of another project I ask if is possible the following. In this image below you see a green arc. Well, the 2 black rectangles and the small red rectangle have a red line across them. The lines and the arc have the same type of green. https://bi8fqg.ch.files.1drv.com/y4mTOEAP_VBWIYm-i8rheu...
by cgkas
2018-10-17T17:08:43-07:00
Forum: Users
Topic: Get coordinates Top, Left, size of some areas
Replies: 46
Views: 15143

Re: Get coordinates Top, Left, size of some areas

Thanks so much fmw42.

I'll follow you suggestions and links shared.
by cgkas
2018-10-17T16:13:27-07:00
Forum: Users
Topic: Get coordinates Top, Left, size of some areas
Replies: 46
Views: 15143

Re: Get coordinates Top, Left, size of some areas

1) No, not directly. You would need to extract the area fields and filter on them 2) Again, you would have to filter on Y coordinate of the extracted bounding boxes, then crop the original image for those boxes, one crop command per box. I am not sure I know what you mean by merge? Do you mean incl...
by cgkas
2018-10-17T13:55:02-07:00
Forum: Users
Topic: Get coordinates Top, Left, size of some areas
Replies: 46
Views: 15143

Re: Get coordinates Top, Left, size of some areas

Your awk command is nice and compact, but it still prints the second field of the header line. (id: 423x355+530+589 422x355+70+589 423x205+530+379 422x205+70+379 423x145+530+203 423x145+70+203 264x40+680+109 You need to skip the first line and the line starting with 0: So use awk 'NR!=1 && !/ 0:/{p...
by cgkas
2018-10-17T11:53:01-07:00
Forum: Users
Topic: Get coordinates Top, Left, size of some areas
Replies: 46
Views: 15143

Re: Get coordinates Top, Left, size of some areas

Thanks so much both fmw42 and snibgo. With the second option is not needed to make temp images and the area threshold is great. The sample image is very close to the original. Now I hope this logic works in original image. convert input.png -transparent '#39D6AE' \ -transparent '#9EB629' \ -transpar...
by cgkas
2018-10-17T10:13:11-07:00
Forum: Users
Topic: Get coordinates Top, Left, size of some areas
Replies: 46
Views: 15143

Re: Get coordinates Top, Left, size of some areas

Excellent snibgo, I see your code it works pretty fine taking the Black and White image as input. So, I think there is no strigth forward way, is need to make black and white first and then apply your code that prints the white reactangles too. Is there a way to mix in a single command the 2 steps b...
by cgkas
2018-10-16T20:29:55-07:00
Forum: Users
Topic: Get coordinates Top, Left, size of some areas
Replies: 46
Views: 15143

Re: Get coordinates Top, Left, size of some areas

You got the coordinates of white rectangles fine. I still would like to get the coordinates and size of black rectangles surrounded by the white line. In the image below I show those rectangles I want in red. https://ci8fqg.ch.files.1drv.com/y4mm9FCx4OR1-U_5ujp09CbAFUV3Oc6g-yQ6mf9LdcVEBLBMp8Hp8E-Xez...
by cgkas
2018-10-16T15:22:05-07:00
Forum: Users
Topic: Get coordinates Top, Left, size of some areas
Replies: 46
Views: 15143

Re: Get coordinates Top, Left, size of some areas

Thanks fmw42. It seems to work pretty fine for white reactangles! Now how can I get the same coordinates and size for the rectangles that are surrounded by the one pixel white line? Those 4 rectangles in black are below. Left, Top, Width X Height 71, 425, 420x458 531, 425, 421x158 71, 635, 420x308 5...
by cgkas
2018-10-16T14:06:26-07:00
Forum: Users
Topic: Get coordinates Top, Left, size of some areas
Replies: 46
Views: 15143

Get coordinates Top, Left, size of some areas

Hello. I have this input image, for which I want to get the coordinates Top, Left, W, H of the resulting white rectangles and Top, Left, W, H of resulting black rectangles that are surrouned by 1 pixel white line. input.png https://c4p6cg.ch.files.1drv.com/y4mg9HtoVZSW_nPWwV23nvEy7PWYlrDbkMFNzNAOHXC...
by cgkas
2018-10-11T10:10:31-07:00
Forum: Users
Topic: Change color of some regions
Replies: 5
Views: 2835

Re: Change color of some regions

Excellent snibgo. Thanks so much. Actually I tested in real image that have several colors (not only black and white) and it seems to print the info for the squares I want to isolate. It seems your code sees only white and black, having this I don't need 2 extra commands I sent previously to convert...
by cgkas
2018-10-11T07:42:04-07:00
Forum: Users
Topic: Change color of some regions
Replies: 5
Views: 2835

Re: Change color of some regions

Hello snibgo,

Thanks for answer.

IM version is 6.9.10-11 Q16 x86_64.

I didn't say in my original post but I'd like to change to red those regions automatically, if possible, without say the x,y position, because my final goal is to be able to get the coordinates of the red regions.

Thanks again.
by cgkas
2018-10-11T00:04:13-07:00
Forum: Users
Topic: Change color of some regions
Replies: 5
Views: 2835

Change color of some regions

Hello to all, I have an image like this (I get this image applying convert input.png -alpha extract -negate out.png): https://cyp6cg.bl.files.1drv.com/y4m0LVPYRRy8w4COAkwQSjLnRkaplb5ts0fR4jwM-fzumhD8Ctu0y1rfkiQ0QEVXQtE2pZhguB0dWo5792vAkkPXnYH_A74fpIeBGgQRwM4pnxRP9YxZnzV4GGtgdiR_79vM1-HskaFsat6X8R4E7...