Sub images and their position

Discuss digital image processing techniques and algorithms. We encourage its application to ImageMagick but you can discuss any software solutions here.
Post Reply
rananaskar
Posts: 4
Joined: 2015-06-17T07:03:45-07:00
Authentication code: 6789

Sub images and their position

Post by rananaskar »

Hello guys i am generating mug with Freds imagemagick cylinder script.

Left view in transparent image
Image

Middle view in transparent image
Image

I want to find the NEW and ANOTHER both elements position in the left image.

I also want to find the positions of images in middle view.

Any help would be appreciated.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Sub images and their position

Post by fmw42 »

Sorry, I do not know what you are asking. Can you explain a bit further? What does your question have to do with the cylinderize script?
rananaskar
Posts: 4
Joined: 2015-06-17T07:03:45-07:00
Authentication code: 6789

Re: Sub images and their position

Post by rananaskar »

If i have an big transparent image with few texts and images at different position.

How can i find position and size of those texts and images in the main image.

Any help would be appreciated.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Sub images and their position

Post by snibgo »

With "-trim" or "-format %@".

Code: Select all

convert in.png -format %@ info:
snibgo's IM pages: im.snibgo.com
rananaskar
Posts: 4
Joined: 2015-06-17T07:03:45-07:00
Authentication code: 6789

Re: Sub images and their position

Post by rananaskar »

snibgo wrote:With "-trim" or "-format %@".

Code: Select all

convert in.png -format %@ info:
With trim i can not get the position of the individual elements like this. I am getting whole elemnts position after trimming
Image


But i want to get it like this
Image

I want to get the position and size of individual elements in the main image

Any help would be appreciated
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Sub images and their position

Post by snibgo »

Then you first need to crop to the individual elements. What defines the separation? Perhaps one element is always in the top half, and the other is in the bottom half. Or perhaps they are always separated by horizontal white.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Sub images and their position

Post by fmw42 »

If you can assume that there are rows of text separate by white space between, then you can average the image down to one column, then search to find white between areas of gray. Then crop horizontally on the white spaces and trim to remove excess white.
Post Reply