« first day (2351 days earlier)      last day (990 days later) » 

11:21 AM
How to crop images based on mask threshold?
 
My magic 8 ball has no idea what "crop images based on mask threshold" means.
Can you try to explain what you want to do?
 
@MisterMiyagi :)))
 
● Outlook not so good.
 
i want to detect the main object in the picture...which is this model...and crop it where the shoes end
i can detect the shape...but i have no idea how to obtain the pixels coordinates
any ideas ?
 
"i can detect the shape..." <- what is this shape you speak of?
 
11:30 AM
the model
or how do u call this
 
I was expecting something like "the result of calling opencv2 method X" or somesuch.
 
hmmm
 
● Most likely.
 
so drawing a bounding box
and getting that bottom line
coordinates from that bounding box i mean
 
@MisterMiyagi Looks like a magic 8 ball bot could come in handy.
 
11:32 AM
:D :D :D guyyyyys
 
@AlexandreMarcq ● Signs point to yes.
@Andie31 Do you have that bounding box?
 
not yet
would that help ?
 
I think there are people here who could help you, me included, but I'm just as stranded as mistermiyagi in guessing what you want
 
ok, so I am photographer...and I have to crop the pictures manually in photoshop. Boring and time consuming too.
i thought i'd use python to detect the main subject, the model, and crop based on this mask, or shape or call it how you want....
 
So you already have a black/white mask and all you need to do is find the y of the bottom-most white pixel?
 
11:38 AM
@Aran-Fey yes !
 
And presumably the mask is a boolean numpy array?
 
the only issue i see is that, it might be some other super small white pixels around....
see, there's a lot of small white pixels lower than the shoe...
 
I guess you could blur the image and then apply another threshold to get rid of small white areas
 
@Aran-Fey how am I doing this ? using opencv ? how am i getting the coordinates later ? in pixel format if possible ?
 
my answers are "google" and numpy.nonzero
 
11:48 AM
ok
 
Is the image actually B/W?
 
no, it's rgb
this is the original
 
Right. So you are applying a filter to get the B/W picture in the first place.
 
so i can detect the eyes and crop based on those points...which is super nice ! but have nothing to detect the foot + shoes
yes
i'm doing this
import cv2

img = cv2.imread('image5.jpg')
h, w = img.shape[:2]

gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)


thr = cv2.threshold(gray, 192, 255, cv2.THRESH_BINARY_INV)[1]
cv2.imwrite('result5.png', thr)
 
12:00 PM
Hm, I'd probably throw edge detection at this, not B/W filtering.
 
48 messages moved from Python
 

« first day (2351 days earlier)      last day (990 days later) »