Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Training data extension #1

Open
bcizmeci opened this issue Jul 18, 2018 · 7 comments
Open

Training data extension #1

bcizmeci opened this issue Jul 18, 2018 · 7 comments

Comments

@bcizmeci
Copy link

Hi Yuan,

Thanks for the great work! Could you give some instructions about extending the training data?
The pretrained model is not really optimized for my image sensor. I would like to train the system specifically for the images captured by my image sensor.

Thanks!
Burak

@MinShang
Copy link

Hi bcizmeci,

 Have you run the code successfully? Did you meet AutoWhiteBalance.Apply() is not found problem?

Thanks!

@bcizmeci
Copy link
Author

Hi Min,
Yes, I am able to apply the white balancing but with some minor modifications. However, it is not working properly on my camera. At the beginning it converges to correct colors but then diverges to wrong parameters. May be a retraining specifically to the sensor of my camera and environment is needed.
Do you know how to prepare the training data if I want to capture my own pictures?

Best regards,
Burak

@MinShang
Copy link

Hi, bciameci,
I was stuck in applying the white balancing -the first step, so I haven't studied training the model on other dataset very clearly. As far as I'm concerned, maybe you can find some cues of the original matlab code here : https://github.com/yuanxy92/AutoWhiteBalance/tree/master/ffcc. I noticed that there is some dataset format definition in the instruction.
Hope it can help you.
And how do you modify the code to make it run successfully?

Thanks,
Min

@bcizmeci
Copy link
Author

loadModel();
  
    // convert your image to small format here
    // The following functions compute the white balancing gains on the small version of image

calcHistFeature();
computeResponse();
predictKalman();

     // Now gains are computed globally

    // Run the following function on the full resolution image

int applyWhiteBalance(cv::cuda::GpuMat & img_d, float _gain_r, float _gain_g, float _gain_b) {

// white balance color twist
Npp32f wbTwist[3][4] = {
	{ 1.0, 0.0, 0.0, 0.0 },
	{ 0.0, 1.0, 0.0, 0.0 },
	{ 0.0, 0.0, 1.0, 0.0 }
};
wbTwist[0][0] = _gain_r;
wbTwist[1][1] = _gain_g;
wbTwist[2][2] = _gain_b;
NppiSize osize;
osize.width = img_d.cols;
osize.height = img_d.rows;

nppiColorTwist32f_8u_C3IR(img_d.data, img_d.step, osize, wbTwist);


return 0;

}

@MinShang
Copy link

MinShang commented Aug 15, 2018

Hi, bciameci,

  Thanks for your sharing. Did you noticed that  #2 https://github.com/yuanxy92/AutoWhiteBalance/issues/2  showed in code?

  Best regards,

  Min

@bcizmeci
Copy link
Author

No it is not there but if you check the code that I send it is not a big deal to modify it.

@MinShang
Copy link

OK. Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants