Click here to Skip to main content
Click here to Skip to main content

Virtual Try On Jewellery and Place order

, 4 Sep 2013
Rate this:
Please Sign up or sign in to vote.
With the help of Face recognition concept added in the app Customer can try the Jewellaries like products virtually and according to their like they will place order.

Please note

This article is an entry in our AppInnovation Contest. Articles in this sub-section are not required to be full articles so care should be taken when voting.

This article is of Windows 8 application for Intel® App Innovation Contest 2013.

Contest Credentials

  • Target Platform: Tablet
  • Category: Retail
  • Overview of the application: In today's Generation, many go for E-Commerce applications such as Online Shopping in other words, E-Marketing. Flipkart, Amazon, ebay are few Online Shopping portals. Many Portals created their own app too for Windows 8 Tablet users so people can place order through the app itself no need to go on portal. 
    My idea concept is for Jewellery section of these Online Shopping Portals Apps. If my concept implemented in that app then the user can virtually try the Jeweleries on their face and check whether those looking great on their face or not.  And By trying different different Jeweleries whichever Jewellery they will like they will select that one & place the order. So there will not be any problem of returning Jewellery and purchase another one instead of previous purchased order. 

    In Future Enhancement, Going to recognize Body parts, using Object Detection and then they can virtual try on cloths and other things too those are mostly were on body same as virtual try of Jewelleries on face.
    eg. If hand is detected using object detection then while purchasing watch one can virtually try how watch is looking on his hand or while purchasing Shoes after detecting legs he can virtually try which pant & which shoes are suits the person. a

    As there are many applications of this application in corporate level as well in home.
    In home how app will be beneficial, we will store records of all cloths & shoes in app and when any person want to go for any occasion then he will virtually try all cloths & shoes and Jewelleries on his body and selected one are choosen for occasion.
    As well in corporate shops, rather than showing all cloths, Shoes to customer and again put them at proper place, they can show virtually try on cloths top customers using this app, so Corporate shops also get beneficial. as well on their E-Shopping Portal apps this concept will be helpful.
    Even if we load this app on Robots with help of Tablet, the selected cloths are given to person by robot as per seletion done of cloths in the tablet app.
  • Intended uses for the Application:
    Many users purchase Jewellery from Online shopping portals and also for users simplicity those portals created their own apps for Tablet users to purchase products from their portals online from anywhere in the world. Those are interested to purchase different Jeweleries online they can test jeweleries on their face with the help of the front camera and which Jewellery suits them they can order those Jewellery product.
    So no need to replace purchased Jewellery because at first only they are selecting the proper Jewellery which suits them.
  • Application Development approach: Proposed application concept is best for tablet Online Jewellery Shopping Portal apps which utilize all novel UI features of tablet and capability of Windows 8 platform. In particular, for developing Windows 8 platform De apps we need .NET framework avail in Visual Studio 2012 and also we can make app using C++ Language. And for implementing this concept need to implement face recognition & Body Recognition in the app so that when the user will select the earrings then those automatically set to ears of the users face showing on Tablets screen with the help of camera. When User will select Necklace then it directly shown on the neck of the user. And we can implement this Face & Body recognition concept with the help of Intel's OpenCV Library written in C++ language. 
  • Coding Languages and Frameworks: Core application small part code base will be developed using C++ and core .NET framework libraries. As well Intel providing OpenCV Library for recognition purpose which help to detect the face parts & user can virtually try Jeweleries.

Introduction  

In today's Generation, many go for E-Commerce applications such as Online Shopping in other words, E-Marketing. Flipkart, Amazon, ebay are few Online Shopping portals. Many Portals created their own app too for Windows 8 Tablet users so people can place order through the app itself no need to go on portal. 
My idea concept is for Jewellery section of these Online Shopping Portals Apps. If my concept implemented in that app then the user can virtually try the Jeweleries on their face and check whether those looking great on their face or not.  And By trying different different Jeweleries whichever Jewellery they will like they will select that one & place the order. So there will not be any problem of returning Jewellery and purchase another one instead of previous purchased order. For implementing this concept need to implement face recognition & Body Recognition in the app so that when the user will select the earrings then those automatically set to ears of the users face showing on Tablets screen with the help of camera. When User will select Necklace then it directly shown on the neck of the user.

Many users purchase Jewellery from Online shopping portals and also for users simplicity those portals created their own apps for Tablet users to purchase products from their portals online from anywhere in the world. Those are interested to purchase different Jeweleries online they can test jeweleries on their face with the help of the front camera and which Jewellery suits them they can order those Jewellery product.
So no need to replace purchased Jewellery because at first only they are selecting the proper Jewellery which suits them.

Using the code

Here I am giving you the code for main part of only for showing how I detected the Human face, for that I used Intel's OpenCV Library with Eigenface Algorithm (Principal Component Algorithm Analysis) Algorithm.

How to detect a face using OpenCV's Face Detector 

The function "cvHaarDetectObjects" in OpenCV performs the actual face detection, but the function is a bit tedious to use directly, so it is easiest to use this wrapper function:  

<dfn>// Perform face detection on the input image, using the given Haar Cascade.
// Returns a rectangle for the detected region in the given image.
CvRect detectFaceInImage(IplImage *inputImg, CvHaarClassifierCascade* cascade)
{
	// Smallest face size.
	CvSize minFeatureSize = cvSize(20, 20);
	// Only search for 1 face.
	int flags = CV_HAAR_FIND_BIGGEST_OBJECT | CV_HAAR_DO_ROUGH_SEARCH;
	// How detailed should the search be.
	float search_scale_factor = 1.1f;
	IplImage *detectImg;
	IplImage *greyImg = 0;
	CvMemStorage* storage;
	CvRect rc;
	double t;
	CvSeq* rects;
	CvSize size;
	int i, ms, nFaces;

	storage = cvCreateMemStorage(0);
	cvClearMemStorage( storage );


	// If the image is color, use a greyscale copy of the image.
	detectImg = (IplImage*)inputImg;
	if (inputImg->nChannels > 1) {
		size = cvSize(inputImg->width, inputImg->height);
		greyImg = cvCreateImage(size, IPL_DEPTH_8U, 1 );
		cvCvtColor( inputImg, greyImg, CV_BGR2GRAY );
		detectImg = greyImg;	// Use the greyscale image.
	}

	// Detect all the faces in the greyscale image.
	t = (double)cvGetTickCount();
	rects = cvHaarDetectObjects( detectImg, cascade, storage,
			search_scale_factor, 3, flags, minFeatureSize);
	t = (double)cvGetTickCount() - t;
	ms = cvRound( t / ((double)cvGetTickFrequency() * 1000.0) );
	nFaces = rects->total;
	printf("Face Detection took %d ms and found %d objects\n", ms, nFaces);

	// Get the first detected face (the biggest).
	if (nFaces > 0)
		rc = *(CvRect*)cvGetSeqElem( rects, 0 );
	else
		rc = cvRect(-1,-1,-1,-1);	// Couldn't find the face.

	if (greyImg)
		cvReleaseImage( &greyImg );
	cvReleaseMemStorage( &storage );
	//cvReleaseHaarClassifierCascade( &cascade );

	return rc;	// Return the biggest face found, or (-1,-1,-1,-1).
}
</dfn>

this important code for face detection 

// Haar Cascade file, used for Face Detection.
char *faceCascadeFilename = "haarcascade_frontalface_alt.xml";
// Load the HaarCascade classifier for face detection.
CvHaarClassifierCascade* faceCascade;
faceCascade = (CvHaarClassifierCascade*)cvLoad(faceCascadeFilename, 0, 0, 0);
if( !faceCascade ) {
	printf("Couldnt load Face detector '%s'\n", faceCascadeFilename);
	exit(1);
}

// Grab the next frame from the camera.
IplImage *inputImg = cvQueryFrame(camera);

// Perform face detection on the input image, using the given Haar classifier
CvRect faceRect = detectFaceInImage(inputImg, faceCascade);

// Make sure a valid face was detected.
if (faceRect.width > 0) {
	printf("Detected a face at (%d,%d)!\n", faceRect.x, faceRect.y);
}

.... Use 'faceRect' and 'inputImg' ....

// Free the Face Detector resources when the program is finished
cvReleaseHaarClassifierCascade( &cascade );

Preprocess facial images for Face Recognition: 

Here is some basic code to convert from a RGB or greyscale input image to a greyscale image, resize to a consistent dimension, then apply Histogram Equalization for consistent brightness and contrast:

<dfn>// Either convert the image to greyscale, or use the existing greyscale image.
IplImage *imageGrey;
if (imageSrc->nChannels == 3) {
	imageGrey = cvCreateImage( cvGetSize(imageSrc), IPL_DEPTH_8U, 1 );
	// Convert from RGB (actually it is BGR) to Greyscale.
	cvCvtColor( imageSrc, imageGrey, CV_BGR2GRAY );
}
else {
	// Just use the input image, since it is already Greyscale.
	imageGrey = imageSrc;
}

// Resize the image to be a consistent size, even if the aspect ratio changes.
IplImage *imageProcessed;
imageProcessed = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 1);
// Make the image a fixed size.
// CV_INTER_CUBIC or CV_INTER_LINEAR is good for enlarging, and
// CV_INTER_AREA is good for shrinking / decimation, but bad at enlarging.
cvResize(imageGrey, imageProcessed, CV_INTER_LINEAR);

// Give the image a standard brightness and contrast.
cvEqualizeHist(imageProcessed, imageProcessed);

.....  Use 'imageProcessed' for Face Recognition ....

if (imageGrey)
	cvReleaseImage(&imageGrey);
if (imageProcessed)
	cvReleaseImage(&imageProcessed);</dfn>

Concept Screenshot

Video of currently done App with CUI

First step towards developing app. completed with implementation of Face Recognition & detection at CUI level I am showing you video of my CUI project for now developed using OpenCV Library.
Have a look on video on given Link.
 

Features    

  • Face Detection
  • Virtual try of Jeweleries and Makeup materials on face 
  • Try as many as Jeweleries you want to select perfect one virtually
  • after selecting perfect Jewellery place order for that Jewellery from app
  • No need of replacement of Jewellery because you selected perfect Jewellery only which suits your face after trying virtually

History  

 As its first step towards Virtual Try opf Jewelleries & Place Order I tried To detect Face & recognize face in Command UI (CUI) Aftre Getting Complete success in it will move towards port that CUI app with some UI in Tablet app UI as concept Image given above. 

Future Enhancement

As soon as I will go with updates with project let yyou know here in this article so stay tuned with it. Soon you will get Windows 8 Tablet app which uses face recognition developing using Intel's OpenCV Library and purchase jewellery. As well After Completing Jewellery part will go for whole Body detection as now this concept not implemented till now as Body detection for any tablet system in which Body part are get recognized & according to that while online purchasing of cloths they can test those too on their own body & purchase Smile | :)

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Aditya Rajendra Patil
Student Konkan Gyanpeeth College of Engineering
India India
I am the Engineering Student from Konkan Gyanpeeth College of Engineering, Karjat, As well I am the Microsoft Student partner from my college campus. I like to develop windows 8 & Windows Phone Apps. I am Microsoft techenthuz. I like to work on technology of Microsoft as well of Intel.

Comments and Discussions

 
QuestionWhere is the source code? PinmemberKarstenK30-Jun-14 4:08 
QuestionGood idea PinprofessionalLearnerFromIndia21-Jan-14 2:12 
QuestionGood idea PinprofessionalLearnerFromIndia21-Jan-14 2:11 
QuestionI would like to speak to you about your app PinmemberMember 1051981512-Jan-14 16:18 
GeneralMy vote of 2 PinmemberSanjay Raichura19-Nov-13 5:44 
QuestionHow's app development going? Will you be submitting on time? PinstaffKevin Priddle22-Oct-13 10:02 
GeneralNot new but good PinmemberSmith#16-Sep-13 21:22 
GeneralRe: Not new but good PinmemberMember 1051981512-Jan-14 16:20 
GeneralMy vote of 3 PinmemberNagarjun55822-Aug-13 22:48 
QuestionExcellent PinmemberYannicSt22-Aug-13 7:19 
AnswerRe: Excellent PinprofessionalAditya Rajendra Patil22-Aug-13 14:48 
AdminThanks! PinstaffKevin Priddle21-Aug-13 10:56 
GeneralRe: Thanks! PinprofessionalAditya Rajendra Patil21-Aug-13 15:30 
GeneralMy vote of 5 PinmemberChirag Rawal19-Aug-13 23:23 
GeneralRe: My vote of 5 PinprofessionalAditya Rajendra Patil20-Aug-13 3:01 
GeneralMy vote of 5 PinprofessionalAbhishek Nandy19-Aug-13 21:02 
GeneralRe: My vote of 5 PinprofessionalAditya Rajendra Patil19-Aug-13 21:58 
GeneralMy vote of 5 PinprofessionalNitin M. Patil19-Aug-13 20:41 
GeneralRe: My vote of 5 PinprofessionalAditya Rajendra Patil19-Aug-13 20:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140709.1 | Last Updated 4 Sep 2013
Article Copyright 2013 by Aditya Rajendra Patil
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid