Ask Your Question

kyejay's profile - activity

2015-09-10 00:46:29 -0600 asked a question Object outline and color analysis best approach

I am new to OpenCV and looking for some general guidance on how to proceed from the point I am at.

I am trying to make a program that can tell me what kind of weapon a video game character is holding. The weapons can be inspected in inventory to produce a standardized viewpoint, and color is an important differentiating factor. I know which color ranges correspond to which weapons and which shapes correspond to which weapon types.

My approach so far has been:

cvtColor RGB to GRAY then use canny edge detection with the following arguments [java]: (mat2, mat1, 5000, 5000, 7, true) - perhaps findContours or morphologyEx GRADIENT function is better for this?

get the RGB pixel colors of the whole image using a brute force approach and simply iterating through every pixel

my goal was to somehow get to the point where i have an outline of the weapon itself, then searching for the colors within just that outline to save time while still using the naive approach. I need to know the exact proportions of the colors for this analysis to be valuable, so I was thinking of implementing some sort of data structure (hash map?) to be able to quickly find the number of pixels for any given RGB range.

can anyone give me some guidance on the best way to proceed? I simply do not have the experience to decide how to proceed from here. What is the best way to accomplish my goal?

Thanks!