Ask Your Question

images's profile - activity

2019-06-24 00:09:24 -0600 received badge  Popular Question (source)
2013-07-09 05:01:28 -0600 commented answer Swap Histogram of two different images..

http://shrib.com/c8kXPbFC this is what i am doing... i have separated hsv values for both the image...but how can i swap hue components and convert back to BGR format.. ??

2013-07-09 04:54:59 -0600 received badge  Supporter (source)
2013-07-09 03:10:12 -0600 commented answer Swap Histogram of two different images..

i have already extracted the skin from the face image...this is to ignore the hair/beard color

2013-07-09 03:07:43 -0600 commented answer Swap Histogram of two different images..

hey thanks for the reply,
http://answers.opencv.org/question/15455/how-to-perform-skin-tone-matching/

this is what i actually want to achieve... basically i have two images 1) image of a face 2) image of a body.. i want to change the contrast/saturation/whatever of the body image with respect to the face image so that it matches the skin tone

2013-07-09 02:34:00 -0600 received badge  Editor (source)
2013-07-09 02:30:11 -0600 asked a question Swap Histogram of two different images..

Hi, I have two different images (Image A and Image B), whose histograms (histImage and histImage1) i have already computed..
Now I want that the histogram of Image A becomes the histogram of Image B.. so that the Image B gets the colors similar to Image A... code is as follow:

#include "stdafx.h"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
#include <stdio.h>

using namespace std;
using namespace cv;
int main( )
{
  Mat src, dst, src1;

  /// Load image
  src = imread("C:/Users/Waqas/Desktop/19juneexp/4.jpg", 1 );   // Image A
  src1 = imread("C:/Users/Waqas/Desktop/19juneexp/body.jpg", 1 ); // Image B

  if( !src.data )
    { return -1; }

  /// Separate the image in 3 places ( B, G and R )
  vector<Mat> bgr_planes;
   vector<Mat> bgr_planes1;
  split( src, bgr_planes );
  split( src1, bgr_planes1 );

  /// Establish the number of bins
  int histSize = 256;

  /// Set the ranges ( for B,G,R) )
  float range[] = { 0, 256 } ;
  const float* histRange = { range };

  bool uniform = true; bool accumulate = false;

  Mat b_hist, g_hist, r_hist;  //ImageA
  Mat b_hist1, g_hist1, r_hist1; //ImageB

  /// Compute the histograms of Image A
  calcHist( &bgr_planes[0], 1, 0, Mat(), b_hist, 1, &histSize, &histRange, uniform, accumulate );
  calcHist( &bgr_planes[1], 1, 0, Mat(), g_hist, 1, &histSize, &histRange, uniform, accumulate );
  calcHist( &bgr_planes[2], 1, 0, Mat(), r_hist, 1, &histSize, &histRange, uniform, accumulate );
   /// Compute the histograms of Image B
    calcHist( &bgr_planes1[0], 1, 0, Mat(), b_hist1, 1, &histSize, &histRange, uniform, accumulate );
  calcHist( &bgr_planes1[1], 1, 0, Mat(), g_hist1, 1, &histSize, &histRange, uniform, accumulate );
  calcHist( &bgr_planes1[2], 1, 0, Mat(), r_hist1, 1, &histSize, &histRange, uniform, accumulate );


  // Draw the histograms for B, G and R
  int hist_w = 512; int hist_h = 400;   //Image A
  int bin_w = cvRound( (double) hist_w/histSize ); //Image A
   int hist_w1 = 512; int hist_h1 = 400;  //Image B
    int bin_w1 = cvRound( (double) hist_w1/histSize );//Image B

  Mat histImage( hist_h, hist_w, CV_8UC3, Scalar( 0,0,0) );  //ImageA
    Mat histImage1( hist_h1, hist_w1, CV_8UC3, Scalar( 0,0,0) ); //ImageB

  /// Normalize the result to [ 0, histImage.rows ] ImageA
  normalize(b_hist, b_hist, 0, histImage.rows, NORM_MINMAX, -1, Mat() );
  normalize(g_hist, g_hist, 0, histImage.rows, NORM_MINMAX, -1, Mat() );
  normalize(r_hist, r_hist, 0, histImage.rows, NORM_MINMAX, -1, Mat() );
    /// Normalize the result to [ 0, histImage.rows ] ImageB
    normalize(b_hist1, b_hist1, 0, histImage.rows, NORM_MINMAX, -1, Mat() );
  normalize(g_hist1, g_hist1, 0, histImage.rows, NORM_MINMAX, -1, Mat() );
  normalize(r_hist1, r_hist1, 0, histImage.rows, NORM_MINMAX, -1, Mat() );


  /// Draw for each channel  ImageA
  for( int i = 1; i < histSize; i++ )
  {
      line( histImage, Point( bin_w*(i-1), hist_h - cvRound(b_hist.at<float>(i-1)) ) ,
                       Point( bin_w*(i), hist_h - cvRound(b_hist.at<float>(i)) ),
                       Scalar( 255, 0, 0), 2, 8, 0  );
      line( histImage, Point( bin_w*(i-1), hist_h - cvRound(g_hist.at<float>(i-1)) ) ,
                       Point( bin_w*(i), hist_h - cvRound(g_hist.at<float>(i)) ),
                       Scalar( 0, 255, 0), 2, 8, 0  );
      line( histImage, Point( bin_w*(i-1), hist_h - cvRound(r_hist.at<float>(i-1)) ) ,
                       Point( bin_w*(i), hist_h - cvRound(r_hist.at<float>(i)) ),
                       Scalar( 0, 0, 255), 2, 8, 0  );
  }
  ////////////////////////////////////////////////////
  /// Draw for each channel  ImageB
  for( int i = 1; i < histSize; i++ )
  {
      line( histImage1, Point( bin_w1*(i-1), hist_h1 - cvRound(b_hist1 ...
(more)
2013-06-26 01:00:16 -0600 commented question How to perform skin tone matching

need help :(

2013-06-21 00:15:22 -0600 commented answer How to perform skin tone matching

i got the histogram of the face image...now is it possible that program set the histogram of the body image with respect to the histogram of the face image ?

2013-06-20 05:37:59 -0600 received badge  Student (source)
2013-06-20 04:41:15 -0600 commented answer How to perform skin tone matching

i have already detected the face.... i am facing problem with the histogram matching

2013-06-20 02:49:58 -0600 asked a question How to perform skin tone matching

http://oi44.tinypic.com/2s7771l.jpg ( face )

http://oi40.tinypic.com/15wewpw.jpg ( body )

Hi, i am new to image processing and openCV C/C++. I am wondering that is it possible to extract skin tone from the first image (face). And then applied to the second image (body).

In other words, user upload his face image and the program extract the skin tone from that image and apply it to the body.

Thanks,

Aisha