SlideShare ist ein Scribd-Unternehmen logo
1 von 22
DIGiTR - Digital image Trial Room
Adi Shankara Institute of Engineering Technology, Kalady
Department of Computer Science & Engg
Under
APJ Abdul Kalam Technological University
Name & Role of Project Members :
Akhila Asok (Backend Developer and OpenCV module)
Aparna A V (Frontend Developer and OpenCV module)
Reg no :
ASI17CS007
ASI17CS015
Guide Name : Asso. Prof T Sobha
TABLE OF CONTENTS
❑ Objective
❑ Problem Statement
❑ Design Diagrams
❑ Components [H/W & S/W]
❑ Methodology /Algorithm/Architecture of the project
❑ Features of the the Project
❑ Status of Project – Implementation
❑ Code Sample / Product Video / Screenshots
❑ Details Of Publication
02-06-2021
DIGiTR
2
● Initiative to help improve the conditions in the textile sector due to this Covid
pandemic and to boost sales in the sector.
● As the lockdown eased, most of the clothing stores opened with new practices
such as ‘no trial’ and ‘no exchange’.
● DIGiTR is a smart mirror that can help customers digitally try on a dress. It
lets the customers
● Views a 3D image of themselves to see which dress fits them better.
OBJECTIVE
02-06-2021
DIGiTR
3
The COVID-19 pandemic has affected our society very much in a lot of ways.
It has changed the way we do things, work, and the way we shop. And it has also
affected many businesses in problematic ways. One of the evident businesses that
were affected by this pandemic is the Textile businesses. Because of the current
scenario, it became indispensable to avoid direct contact with people and therefore
making it difficult to try on dresses and clothes to see if they are suited for you.
Recently there has been a lot of concerns surrounding catching Covid-19 in trial
rooms. Trial rooms in retail outlets are usually poorly ventilated. With the Covid
pandemic spreading wildly across the globe, shoppers are wary of entering stores
that can get crowded rapidly. And with social distancing rules, shops have also
been forced to seal off their trial rooms temporarily.
PROBLEM STATEMENT
02-06-2021
DIGiTR
4
DESIGN DIAGRAMS
Level 1
02-06-2021
DIGiTR
5
DESIGN DIAGRAMS
Level 2
02-06-2021 DIGiTR 6
DESIGN DIAGRAMS
Level 3
02-06-2021 DIGiTR 7
COMPONENTS [H/W & S/W]
Hardware Components :
● Raspberry Pi 4 Model B
● Camera
● Intel Neural Compute Stick 2
Software Components :
● Fast API:
● MongoDB
● Angular 2.9
● Open CV
● Numpy
● Uvicorn
02-06-2021 DIGiTR 8
The system includes very few hardware components which are Raspberry Pi 4, the brain
of the module, a 1080p Pi cam and a neural compute stick 2 by intel which handles image
processing functions with an improved capability. The majority of the project lies on its
software end, where one uses the computer vision fundamentals to bring this project to life.
OpenCV expanded as Open Source computer vision and machine learning software
library, including programming functions mainly aimed at solving real-time computer vision
problems. It is by using this library that we have developed our ML model that is used to
produce a "try-on" feature. The working of the project from the vantage point of the user can
be explained in a few simple steps:
Methodology /Algorithm/Architecture of the project
02-06-2021 DIGiTR 9
1. The product is designed to constitute a large plane 2-way mirror with a camera mounted on
top. The mirror constitutes a 20-inch display on the side, which the user can use to log into
the e-commerce application.
2. The customer selects a dress from an array of collections presented on the 2-way mirror .
3. On selecting their desired dress, the camera module is activated, which feeds the live
image of the customer.
4. The customer is then asked to step back to see themselves wearing the dress of their choice
on the screen of the 2-way mirror. The display even recommends the appropriate size of
the dress that fits the use.
The product also includes a retailer version of the app, which can be used by staff members
of shops to add more collections to their inventory.
Methodology /Algorithm/Architecture of the project
02-06-2021 DIGiTR 10
● Shopkeeper Login: This function helps shopkeepers to log in to the product
using the user id and password given when they register to the product.
● Adding Variable Products: This function helps staff to add new clothing to the
product.
● Removing Products: This function helps staff remove unwanted clothing from the
product.
● Selection of Desired Dresses: A random dress is displayed on the screen where
the customer can scan select their desired dress.
● Current Stock Updation: This function allows the user to see whether the
desired dresses they selected have been recently bought and are in stock or out
of stock.
● Customer Try on Function: This function helps the customer to try on virtually
the decided clothing whether by uploading photo or by video
● Add To Cart: This function lets the customer select the desired dress they
selected to buy.
❑ Features of the the Project
02-06-2021 DIGiTR 11
CURRENT STATUS OF PROJECT – IMPLEMENTATION
02-06-2021
DIGiTR
12
CODE SAMPLE / PRODUCT VIDEO / SCREEN SHOTS
02-06-2021 DIGiTR 13
CODE SAMPLE / PRODUCT VIDEO / SCREEN SHOTS
02-06-2021
DIGiTR
14
CODE SAMPLE / PRODUCT VIDEO / SCREEN SHOTS
02-06-2021 DIGiTR 15
CODE SAMPLE / PRODUCT VIDEO / SCREENSHOTS
02-06-2021 DIGiTR 16
CODE SAMPLE / PRODUCT VIDEO / SCREENSHOTS
02-06-2021 DIGiTR 17
CODE SAMPLE / PRODUCT VIDEO / SCREENSHOTS
02-06-2021 DIGiTR 18
import numpy as np
import cv2
def change_dress(cloth_path: str):
try:
frame = cv2.imread("server/images/tmp/temp.jpg")
hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
# define range of green color in HSV
lower_green = np.array([25, 52, 72])
upper_green = np.array([102, 255, 255])
# Threshold the HSV image to get only blue colors
mask_white = cv2.inRange(hsv,lower_green, upper_green)
mask_black = cv2.bitwise_not(mask_white)
#converting mask_black to 3 channels
W,L = mask_black.shape
mask_black_3CH = np.empty((W, L, 3), dtype=np.uint8)
mask_black_3CH[:, :, 0] = mask_black
mask_black_3CH[:, :, 1] = mask_black
mask_black_3CH[:, :, 2] = mask_black
Image Try on
CODE SAMPLE / PRODUCT VIDEO / SCREENSHOTS
02-06-2021 DIGiTR 19
# cv2.imshow('orignal',frame)
# cv2.imshow('mask_black',mask_black_3CH)
dst3 = cv2.bitwise_and(mask_black_3CH,frame)
# cv2.imshow('Pic+mask_inverse',dst3)
#///////
W,L = mask_white.shape
mask_white_3CH = np.empty((W, L, 3), dtype=np.uint8)
mask_white_3CH[:, :, 0] = mask_white
mask_white_3CH[:, :, 1] = mask_white
mask_white_3CH[:, :, 2] = mask_white
# cv2.imshow('Wh_mask',mask_white_3CH)
dst3_wh = cv2.bitwise_or(mask_white_3CH,dst3)
# cv2.imshow('Pic+mask_wh',dst3_wh)
CODE SAMPLE / PRODUCT VIDEO / SCREENSHOTS
02-06-2021 DIGiTR 20
#/////////////////
# changing for design
design = cv2.imread(cloth_path)
design = cv2.resize(design, mask_black.shape[1::-1])
# cv2.imshow('design resize',design)
design_mask_mixed = cv2.bitwise_or(mask_black_3CH,design)
# cv2.imshow('design_mask_mixed',design_mask_mixed)
final_mask_black_3CH = cv2.bitwise_and(design_mask_mixed,dst3_wh)
# cv2.imshow('final_out',final_mask_black_3CH)
cv2.imwrite("server/images/tmp/output.jpg", final_mask_black_3CH)
# cv2.waitKey()
except:
pass
CODE SAMPLE / PRODUCT VIDEO / SCREENSHOTS
02-06-2021 DIGiTR 21
Live Demo
DETAILS OF PUBLICATION
NIL
02-06-2021
DIGiTR
22

Weitere Àhnliche Inhalte

Ähnlich wie My College Project

ContentsTeam Work Schedule3Team Task Assignment3Project .docx
ContentsTeam Work Schedule3Team Task Assignment3Project .docxContentsTeam Work Schedule3Team Task Assignment3Project .docx
ContentsTeam Work Schedule3Team Task Assignment3Project .docx
bobbywlane695641
 
Mini_Project_Report_On_ONLINE_SHOPPING_S.pdf
Mini_Project_Report_On_ONLINE_SHOPPING_S.pdfMini_Project_Report_On_ONLINE_SHOPPING_S.pdf
Mini_Project_Report_On_ONLINE_SHOPPING_S.pdf
TharunRam9
 
1 s2.0-s2351978920320436-main
1 s2.0-s2351978920320436-main1 s2.0-s2351978920320436-main
1 s2.0-s2351978920320436-main
BelalKAIBA
 

Ähnlich wie My College Project (20)

Simat visage radar finastra
Simat visage radar finastraSimat visage radar finastra
Simat visage radar finastra
 
ContentsTeam Work Schedule3Team Task Assignment3Project .docx
ContentsTeam Work Schedule3Team Task Assignment3Project .docxContentsTeam Work Schedule3Team Task Assignment3Project .docx
ContentsTeam Work Schedule3Team Task Assignment3Project .docx
 
Portal Prosperity: An Overview Part I and Part II
Portal Prosperity: An Overview Part I and Part IIPortal Prosperity: An Overview Part I and Part II
Portal Prosperity: An Overview Part I and Part II
 
IRJET - Internet of Things based Smart Shopping Cart
IRJET - Internet of Things based Smart Shopping CartIRJET - Internet of Things based Smart Shopping Cart
IRJET - Internet of Things based Smart Shopping Cart
 
IRJET- Online Shopping System
IRJET-  	  Online Shopping SystemIRJET-  	  Online Shopping System
IRJET- Online Shopping System
 
IRJET- Smart Banner Advertisement using Dynamic Pricing
IRJET- Smart Banner Advertisement using Dynamic PricingIRJET- Smart Banner Advertisement using Dynamic Pricing
IRJET- Smart Banner Advertisement using Dynamic Pricing
 
IRJET- Smart Door Unit
IRJET- Smart Door UnitIRJET- Smart Door Unit
IRJET- Smart Door Unit
 
Innotech Vietnam Profile
Innotech Vietnam ProfileInnotech Vietnam Profile
Innotech Vietnam Profile
 
Smart Trolley in Mega Mall Using Zigbee
Smart Trolley in Mega Mall Using ZigbeeSmart Trolley in Mega Mall Using Zigbee
Smart Trolley in Mega Mall Using Zigbee
 
IRJET- Tour and Travels
IRJET- Tour and TravelsIRJET- Tour and Travels
IRJET- Tour and Travels
 
Preparing_for_PCA_Workbook.pptx
Preparing_for_PCA_Workbook.pptxPreparing_for_PCA_Workbook.pptx
Preparing_for_PCA_Workbook.pptx
 
Mini_Project_Report_On_ONLINE_SHOPPING_S.pdf
Mini_Project_Report_On_ONLINE_SHOPPING_S.pdfMini_Project_Report_On_ONLINE_SHOPPING_S.pdf
Mini_Project_Report_On_ONLINE_SHOPPING_S.pdf
 
Portal Prosperity: An Overview Part I, Part II and Part III
Portal Prosperity: An Overview Part I, Part II and Part IIIPortal Prosperity: An Overview Part I, Part II and Part III
Portal Prosperity: An Overview Part I, Part II and Part III
 
Mini Project- Automated Selection Machine
Mini Project- Automated Selection MachineMini Project- Automated Selection Machine
Mini Project- Automated Selection Machine
 
GARE du MIDIH Open Digital Platforms the adoption of a standards-based open...
GARE du MIDIH   Open Digital Platforms the adoption of a standards-based open...GARE du MIDIH   Open Digital Platforms the adoption of a standards-based open...
GARE du MIDIH Open Digital Platforms the adoption of a standards-based open...
 
2020 vision - the journey from research lab to real-world product
2020 vision - the journey from research lab to real-world product2020 vision - the journey from research lab to real-world product
2020 vision - the journey from research lab to real-world product
 
Aie module3 handout
Aie module3 handoutAie module3 handout
Aie module3 handout
 
mahima resume
mahima resumemahima resume
mahima resume
 
1 s2.0-s2351978920320436-main
1 s2.0-s2351978920320436-main1 s2.0-s2351978920320436-main
1 s2.0-s2351978920320436-main
 
IRJET- Smart Billing Cart
IRJET- Smart Billing CartIRJET- Smart Billing Cart
IRJET- Smart Billing Cart
 

KĂŒrzlich hochgeladen

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

KĂŒrzlich hochgeladen (20)

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

My College Project

  • 1. DIGiTR - Digital image Trial Room Adi Shankara Institute of Engineering Technology, Kalady Department of Computer Science & Engg Under APJ Abdul Kalam Technological University Name & Role of Project Members : Akhila Asok (Backend Developer and OpenCV module) Aparna A V (Frontend Developer and OpenCV module) Reg no : ASI17CS007 ASI17CS015 Guide Name : Asso. Prof T Sobha
  • 2. TABLE OF CONTENTS ❑ Objective ❑ Problem Statement ❑ Design Diagrams ❑ Components [H/W & S/W] ❑ Methodology /Algorithm/Architecture of the project ❑ Features of the the Project ❑ Status of Project – Implementation ❑ Code Sample / Product Video / Screenshots ❑ Details Of Publication 02-06-2021 DIGiTR 2
  • 3. ● Initiative to help improve the conditions in the textile sector due to this Covid pandemic and to boost sales in the sector. ● As the lockdown eased, most of the clothing stores opened with new practices such as ‘no trial’ and ‘no exchange’. ● DIGiTR is a smart mirror that can help customers digitally try on a dress. It lets the customers ● Views a 3D image of themselves to see which dress fits them better. OBJECTIVE 02-06-2021 DIGiTR 3
  • 4. The COVID-19 pandemic has affected our society very much in a lot of ways. It has changed the way we do things, work, and the way we shop. And it has also affected many businesses in problematic ways. One of the evident businesses that were affected by this pandemic is the Textile businesses. Because of the current scenario, it became indispensable to avoid direct contact with people and therefore making it difficult to try on dresses and clothes to see if they are suited for you. Recently there has been a lot of concerns surrounding catching Covid-19 in trial rooms. Trial rooms in retail outlets are usually poorly ventilated. With the Covid pandemic spreading wildly across the globe, shoppers are wary of entering stores that can get crowded rapidly. And with social distancing rules, shops have also been forced to seal off their trial rooms temporarily. PROBLEM STATEMENT 02-06-2021 DIGiTR 4
  • 8. COMPONENTS [H/W & S/W] Hardware Components : ● Raspberry Pi 4 Model B ● Camera ● Intel Neural Compute Stick 2 Software Components : ● Fast API: ● MongoDB ● Angular 2.9 ● Open CV ● Numpy ● Uvicorn 02-06-2021 DIGiTR 8
  • 9. The system includes very few hardware components which are Raspberry Pi 4, the brain of the module, a 1080p Pi cam and a neural compute stick 2 by intel which handles image processing functions with an improved capability. The majority of the project lies on its software end, where one uses the computer vision fundamentals to bring this project to life. OpenCV expanded as Open Source computer vision and machine learning software library, including programming functions mainly aimed at solving real-time computer vision problems. It is by using this library that we have developed our ML model that is used to produce a "try-on" feature. The working of the project from the vantage point of the user can be explained in a few simple steps: Methodology /Algorithm/Architecture of the project 02-06-2021 DIGiTR 9
  • 10. 1. The product is designed to constitute a large plane 2-way mirror with a camera mounted on top. The mirror constitutes a 20-inch display on the side, which the user can use to log into the e-commerce application. 2. The customer selects a dress from an array of collections presented on the 2-way mirror . 3. On selecting their desired dress, the camera module is activated, which feeds the live image of the customer. 4. The customer is then asked to step back to see themselves wearing the dress of their choice on the screen of the 2-way mirror. The display even recommends the appropriate size of the dress that fits the use. The product also includes a retailer version of the app, which can be used by staff members of shops to add more collections to their inventory. Methodology /Algorithm/Architecture of the project 02-06-2021 DIGiTR 10
  • 11. ● Shopkeeper Login: This function helps shopkeepers to log in to the product using the user id and password given when they register to the product. ● Adding Variable Products: This function helps staff to add new clothing to the product. ● Removing Products: This function helps staff remove unwanted clothing from the product. ● Selection of Desired Dresses: A random dress is displayed on the screen where the customer can scan select their desired dress. ● Current Stock Updation: This function allows the user to see whether the desired dresses they selected have been recently bought and are in stock or out of stock. ● Customer Try on Function: This function helps the customer to try on virtually the decided clothing whether by uploading photo or by video ● Add To Cart: This function lets the customer select the desired dress they selected to buy. ❑ Features of the the Project 02-06-2021 DIGiTR 11
  • 12. CURRENT STATUS OF PROJECT – IMPLEMENTATION 02-06-2021 DIGiTR 12
  • 13. CODE SAMPLE / PRODUCT VIDEO / SCREEN SHOTS 02-06-2021 DIGiTR 13
  • 14. CODE SAMPLE / PRODUCT VIDEO / SCREEN SHOTS 02-06-2021 DIGiTR 14
  • 15. CODE SAMPLE / PRODUCT VIDEO / SCREEN SHOTS 02-06-2021 DIGiTR 15
  • 16. CODE SAMPLE / PRODUCT VIDEO / SCREENSHOTS 02-06-2021 DIGiTR 16
  • 17. CODE SAMPLE / PRODUCT VIDEO / SCREENSHOTS 02-06-2021 DIGiTR 17
  • 18. CODE SAMPLE / PRODUCT VIDEO / SCREENSHOTS 02-06-2021 DIGiTR 18 import numpy as np import cv2 def change_dress(cloth_path: str): try: frame = cv2.imread("server/images/tmp/temp.jpg") hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) # define range of green color in HSV lower_green = np.array([25, 52, 72]) upper_green = np.array([102, 255, 255]) # Threshold the HSV image to get only blue colors mask_white = cv2.inRange(hsv,lower_green, upper_green) mask_black = cv2.bitwise_not(mask_white) #converting mask_black to 3 channels W,L = mask_black.shape mask_black_3CH = np.empty((W, L, 3), dtype=np.uint8) mask_black_3CH[:, :, 0] = mask_black mask_black_3CH[:, :, 1] = mask_black mask_black_3CH[:, :, 2] = mask_black Image Try on
  • 19. CODE SAMPLE / PRODUCT VIDEO / SCREENSHOTS 02-06-2021 DIGiTR 19 # cv2.imshow('orignal',frame) # cv2.imshow('mask_black',mask_black_3CH) dst3 = cv2.bitwise_and(mask_black_3CH,frame) # cv2.imshow('Pic+mask_inverse',dst3) #/////// W,L = mask_white.shape mask_white_3CH = np.empty((W, L, 3), dtype=np.uint8) mask_white_3CH[:, :, 0] = mask_white mask_white_3CH[:, :, 1] = mask_white mask_white_3CH[:, :, 2] = mask_white # cv2.imshow('Wh_mask',mask_white_3CH) dst3_wh = cv2.bitwise_or(mask_white_3CH,dst3) # cv2.imshow('Pic+mask_wh',dst3_wh)
  • 20. CODE SAMPLE / PRODUCT VIDEO / SCREENSHOTS 02-06-2021 DIGiTR 20 #///////////////// # changing for design design = cv2.imread(cloth_path) design = cv2.resize(design, mask_black.shape[1::-1]) # cv2.imshow('design resize',design) design_mask_mixed = cv2.bitwise_or(mask_black_3CH,design) # cv2.imshow('design_mask_mixed',design_mask_mixed) final_mask_black_3CH = cv2.bitwise_and(design_mask_mixed,dst3_wh) # cv2.imshow('final_out',final_mask_black_3CH) cv2.imwrite("server/images/tmp/output.jpg", final_mask_black_3CH) # cv2.waitKey() except: pass
  • 21. CODE SAMPLE / PRODUCT VIDEO / SCREENSHOTS 02-06-2021 DIGiTR 21 Live Demo