Material Setup for AR Game

Currently I am developing an AR game using ARToolKit v6.

I am able to supply image and get it detected using camera and able to spawn the appropriate character as per my project needs.

But my next biggest hurdle is color detection and use the same color to set the material on the character.

My approach is to use the camera frame byte data and convert it to texture(by FColor) and use the prefixed masking texture sample for masking.

I m able to convert the camera frame to the texture and use it in dynamic material and set it on the character, but the masking is not accurate (I am not pro in setting up the materials)

Below I m attaching the camera frame texture.

This is my opacity masking texture(will be changed in future, but will be same)

The result which I am getting is this.

I definately need to do some processing in my material, but I am a hardcore programmer and lack knowledge of materials.

As per what I think I need to crop the camera texture to match the size of the masking texture.
My camera texture needs to aligned properly, because camera texture can have any rotation and scale.
There is a way to crop the texture but the coordinates need to be supplied there, but in this scenario I m certain about the coordinates because its AR application and image detection can take place at any distance from camera and thus so camera texture will change every time I need to detect colors.

I can use OpenCV as well for processing camera frames directly from camera and then bring it in material, but I don’t want to do that way because after I release this product I am planning to release this AR Plugin of mine with texture detection.

Any help is really appriciated.
Regards.