摘" 要:針對(duì)服裝內(nèi)部輪廓線(xiàn)對(duì)比度低、提取特征點(diǎn)和完整輪廓困難,導(dǎo)致圖像內(nèi)部尺寸難以測(cè)量的問(wèn)題,提出一種基于SAM模型進(jìn)行部件分割提取內(nèi)部尺寸的方法。首先通過(guò)SAM模型分割西裝領(lǐng)部件,然后將西裝領(lǐng)部件近似多邊形并利用LSD算法修正多邊形,最后建立西裝領(lǐng)結(jié)構(gòu)模型并結(jié)合像素比例提取設(shè)計(jì)尺寸。結(jié)果表明:該方法可以從成衣圖像中提取西裝領(lǐng)款式結(jié)構(gòu)圖并輸出相關(guān)數(shù)據(jù),實(shí)驗(yàn)測(cè)量結(jié)果與測(cè)量軟件相比尺寸的絕對(duì)誤差在0.02~0.74 cm之間,角度的絕對(duì)誤差在0.02°~0.27°之間;與實(shí)物測(cè)量相比,尺寸的絕對(duì)誤差在0.05~1 cm之間,角度的絕對(duì)誤差在0.06°~0.68°之間。該方法提取的西裝領(lǐng)細(xì)部尺寸可為制版師提供數(shù)據(jù)參考。
關(guān)鍵詞:西裝領(lǐng);服裝部件分割;SAM模型;LSD算法;款式圖提?。怀叽鐪y(cè)量
中圖分類(lèi)號(hào):TS94.17
"文獻(xiàn)標(biāo)志碼:A
文章編號(hào):1009-265X(2024)12-0083-07
DOI: 10.19398j.att.202403005
收稿日期:20240305
網(wǎng)絡(luò)出版日期:20240620
基金項(xiàng)目:國(guó)家級(jí)大學(xué)生創(chuàng)新創(chuàng)業(yè)訓(xùn)練計(jì)劃項(xiàng)目(202210338032);浙江理工大學(xué)科研啟動(dòng)基金項(xiàng)目(23072078-Y)
作者簡(jiǎn)介:彭周艷(1998—),女,湖南常德人,碩士研究生,主要從事服裝數(shù)字化方面的研究。
通信作者:鄒奉元,E-mail:zfy166@zstu.edu.cn
西裝整體視覺(jué)效果受到多種因素影響,其中西裝領(lǐng)作為整體視覺(jué)的中心,是影響整體視覺(jué)效果最關(guān)鍵的因素[1]。而根據(jù)款式設(shè)計(jì)圖制作服裝樣板,對(duì)西裝領(lǐng)這樣的重要細(xì)部尺寸判斷,往往要依賴(lài)樣板師的經(jīng)驗(yàn)和多次試錯(cuò)。機(jī)器視覺(jué)具有圖像再現(xiàn)好、處理精度高、靈活性強(qiáng)等特點(diǎn)[2],因此采用機(jī)器視覺(jué)來(lái)幫助確定西裝領(lǐng)細(xì)部尺寸有重要意義。
服裝尺寸的測(cè)量通常是需要先檢測(cè)服裝特征點(diǎn),然后進(jìn)行特征點(diǎn)間的距離測(cè)量。Cao等[3]采用邊緣檢測(cè)算法和基于輪廓的Freeman鏈碼角點(diǎn)檢測(cè)進(jìn)行特征點(diǎn)檢測(cè),進(jìn)而測(cè)量尺寸;李鵬飛等[4]提出Harris算法和Susan算法相結(jié)合的角點(diǎn)檢測(cè)算法來(lái)提高特征點(diǎn)檢測(cè)的準(zhǔn)確性。但傳統(tǒng)的特征點(diǎn)檢測(cè)算法存在特征點(diǎn)漏檢、錯(cuò)檢、集簇的問(wèn)題,因此相關(guān)學(xué)者通過(guò)引入機(jī)器學(xué)習(xí)來(lái)檢測(cè)特征點(diǎn)。Serrat等[5]考慮全局輪廓采用概率圖形模型學(xué)習(xí)識(shí)別服裝近直線(xiàn)化輪廓部件進(jìn)而提取特征點(diǎn),然后通過(guò)Lasso回歸預(yù)測(cè)服裝外輪廓尺寸。鄧瑩潔[6]及Kim等[7]采用深度學(xué)習(xí)的方法從二維圖像中提取服裝尺寸測(cè)量點(diǎn);Paulauskaite-Taraseviciene等[8]提出基于U-Net分割模型,首先分割出服裝掩膜再通過(guò)深度學(xué)習(xí)檢測(cè)關(guān)鍵點(diǎn)完成服裝測(cè)量,這一方法大大提高了檢測(cè)精度。但上述研究只關(guān)注了服裝外輪廓尺寸,未探討內(nèi)輪廓尺寸。為解決這一問(wèn)題,王燕珍[9]采用定位法將服裝圖像映射到標(biāo)準(zhǔn)人體模型上,借助標(biāo)準(zhǔn)的參數(shù)網(wǎng)格利用比例關(guān)系獲得內(nèi)部尺寸;Li等[10]通過(guò)形狀匹配定位預(yù)設(shè)服裝模板內(nèi)外特征點(diǎn)的相對(duì)位置來(lái)計(jì)算內(nèi)部尺寸,其中預(yù)設(shè)的服裝內(nèi)部特征點(diǎn)為測(cè)量大量服裝后總結(jié)而來(lái),測(cè)量絕對(duì)誤差在0.36~2.03 cm。雖然上述方法實(shí)現(xiàn)了內(nèi)輪廓尺寸測(cè)量,但測(cè)量誤差還不夠理想。
由此,本文提出一種在控制尺寸下基于Segment Anything Model(SAM)[11]模型建立西裝領(lǐng)結(jié)構(gòu)模型并提取設(shè)計(jì)尺寸的方法。該方法首先通過(guò)SAM模型分割西裝領(lǐng)部件,先分割可減少周?chē)y理的影響,提高邊緣精度;然后將西裝領(lǐng)部件近似多邊形并利用Line Segment Dectctor(LSD)[12]算法修正,保留關(guān)鍵特征點(diǎn);最后建立西裝領(lǐng)結(jié)構(gòu)模型并結(jié)合像素比例提取設(shè)計(jì)尺寸。該方法可提取出西裝領(lǐng)設(shè)計(jì)尺寸,為制版師提供數(shù)據(jù)參考。
1" 實(shí)驗(yàn)
西裝領(lǐng)尺寸測(cè)量分為三步,第一步基于SAM模型對(duì)西裝領(lǐng)部件分割,得到西裝領(lǐng)各部件掩膜;第二步將西裝領(lǐng)部件輪廓多邊形化并調(diào)整建立西裝領(lǐng)結(jié)構(gòu)模型;第三步,測(cè)量西裝領(lǐng)設(shè)計(jì)尺寸。
1.1" 實(shí)驗(yàn)對(duì)象
西裝領(lǐng)型主要有平駁領(lǐng)、戧駁領(lǐng)、青果領(lǐng),由于青果領(lǐng)參數(shù)較為簡(jiǎn)單,暫不做討論。本文選擇平駁領(lǐng)、戧駁領(lǐng)作為實(shí)驗(yàn)對(duì)象進(jìn)行尺寸提取。西裝平鋪圖如圖1所示。
1.2" 西裝領(lǐng)部件分割
針對(duì)內(nèi)部輪廓提取有雜線(xiàn)、不連續(xù)的問(wèn)題,本文采用SAM模型對(duì)西裝領(lǐng)翻領(lǐng)、駁領(lǐng)、領(lǐng)座部件依次進(jìn)行交互式分割,從而更好地提取西裝領(lǐng)內(nèi)部輪廓線(xiàn)。SAM模型基于Transformer架構(gòu)搭建,具有較強(qiáng)零樣本泛化能力,由圖像編碼器、提示編碼器和一個(gè)輕量級(jí)的掩碼解碼器3部分組成,模型原理如圖2所示。
實(shí)驗(yàn)采用點(diǎn)框結(jié)合的方式,通過(guò)輸入提示框確定前景,輸入提示點(diǎn)確定背景,提示信息以位置編碼的形式輸入提示編碼器,然后圖像編碼器和提示編碼器將提取的信息結(jié)合到掩碼解碼器中,生成基于圖像嵌入、提示嵌入和輸出的西裝領(lǐng)部件分割結(jié)果,并選擇預(yù)測(cè)得分最高的分割掩膜進(jìn)行輸出,分割效果如圖3所示。
1.3" 西裝領(lǐng)模型建立
1.3.1" 西裝領(lǐng)部件輪廓多邊形化
將西裝領(lǐng)輪廓部件近似多邊形提取關(guān)鍵特征點(diǎn)。Douglas-Peucker(DP)[13]算法可以將輪廓以簡(jiǎn)單、高效的方式進(jìn)行近似處理,保留較少的關(guān)鍵點(diǎn),同時(shí)保持輪廓的形狀特征。因此采用DP算法對(duì)輪廓進(jìn)行近似處理,算法原理如下:
a)步驟1:在圖像輪廓中尋找最遠(yuǎn)距離點(diǎn),連接最遠(yuǎn)點(diǎn)P1P8(見(jiàn)圖4(b))。
b)步驟2:找到圖像輪廓上離直線(xiàn)段P1P8距離最遠(yuǎn)的點(diǎn)P3(見(jiàn)圖4(c)),計(jì)算其與直線(xiàn)段P1P8的距離d,比較距離d與預(yù)先設(shè)定閾值的大小,如果小于閾值,則該直線(xiàn)段作為曲線(xiàn)的近似,該段曲線(xiàn)處理完畢。
c)步驟3:如果距離大于閾值,則用P3將曲線(xiàn)分為兩段P1P3和P3P8,重復(fù)上述操作(見(jiàn)圖4(d)),直到滿(mǎn)足閾值要求。
由DP算法原理可知,圖像輪廓近似多邊形的效果與設(shè)定的閾值有關(guān),經(jīng)反復(fù)實(shí)驗(yàn),將輪廓周長(zhǎng)的0.02倍作為閾值時(shí)近似多邊形效果符合要求,可在保留較少關(guān)鍵點(diǎn)的同時(shí)保持輪廓形狀特征。圖5為西裝領(lǐng)部件多邊形化結(jié)果,圖5(a)—(d)分別為平駁領(lǐng)、戧駁領(lǐng)翻領(lǐng)部件和駁領(lǐng)部件多邊形化結(jié)果。
但是采用DP算法對(duì)戧駁領(lǐng)駁領(lǐng)部件近似多邊形時(shí)損失了關(guān)鍵頂點(diǎn),如圖6所示。根據(jù)DP算法原理,在對(duì)輪廓近似處理時(shí),首先連接圖像輪廓最遠(yuǎn)點(diǎn)P1、P2點(diǎn),結(jié)果如圖6(c)所示;接著在輪廓中尋找距離弦P1P2的最遠(yuǎn)點(diǎn),即點(diǎn)M,結(jié)果如圖6(d)所示;最后通過(guò)閾值約束得到了如圖6(b)所示近似結(jié)果,從圖6(a)中可以觀(guān)察到,戧駁領(lǐng)駁角呈現(xiàn)為有略微弧度的角,而以點(diǎn)M為駁角頂點(diǎn)并不能概括駁角形狀。
1.3.2" 輪廓多邊形調(diào)整
為了減少測(cè)量誤差,更正M點(diǎn)的坐標(biāo)來(lái)修正多邊形。具體的修正流程如圖7所示。
首先,利用LSD算法對(duì)掩膜圖像進(jìn)行直線(xiàn)段檢測(cè),LSD算法具有結(jié)果準(zhǔn)確,算法參數(shù)能夠自適應(yīng),且適合檢測(cè)短線(xiàn)段的優(yōu)點(diǎn)[14],因此采用LSD算法檢測(cè)輪廓直線(xiàn)段。得到直線(xiàn)檢測(cè)結(jié)果如圖8(a),過(guò)濾極短直線(xiàn)段后結(jié)果如圖8(b)所示。
接著,對(duì)過(guò)濾后的直線(xiàn)段集合進(jìn)行幾何約束篩選出目標(biāo)直線(xiàn)。第一步,對(duì)斜率進(jìn)行約束,以圖像左下角作為坐標(biāo)原點(diǎn),篩選出斜率為負(fù)的直線(xiàn);第二步,對(duì)距離進(jìn)行約束,篩選出與圖6(b)中N點(diǎn)距離最近的直線(xiàn)。幾何約束的公式為:
klt;0(1)
d=dmin=AxN+ByN+CA2+B2(2)
式中:k為直線(xiàn)斜率,d為點(diǎn)到直線(xiàn)的距離,A、B、C為直線(xiàn)參數(shù)。
在篩選出目標(biāo)直線(xiàn)后,需要確定新的多邊形頂點(diǎn)。沿著目標(biāo)直線(xiàn)的垂線(xiàn)方向?qū)ふ覉D像輪廓的外切線(xiàn),與目標(biāo)直線(xiàn)的交點(diǎn)為新的M點(diǎn),更新M點(diǎn),如圖8(c)所示,修正后的多邊形如8(d)所示。
1.3.3" 建立西裝領(lǐng)結(jié)構(gòu)模型
將西裝領(lǐng)領(lǐng)座、翻領(lǐng)、駁領(lǐng)組合起來(lái),構(gòu)造西裝領(lǐng)結(jié)構(gòu)模型。以戧駁領(lǐng)為例,首先在西裝圖像中標(biāo)定衣長(zhǎng),得到相應(yīng)控制點(diǎn)O、P,并以O(shè)點(diǎn)為坐標(biāo)原點(diǎn)建立直角坐標(biāo)系,接著定義翻領(lǐng)部件的關(guān)鍵點(diǎn)A、B、C、D1、E1,以及駁領(lǐng)部件的關(guān)鍵點(diǎn)D2、E2、F、G。由于分割或近似多邊形過(guò)程中產(chǎn)生的誤差導(dǎo)致共點(diǎn)的D1、D2,E1、E2坐標(biāo)值有略微差異,取D1、D2橫縱坐標(biāo)的平均值為D點(diǎn),E1、E2橫縱坐標(biāo)的平均值為E點(diǎn),標(biāo)記結(jié)果如圖9(a)所示。領(lǐng)座部分提取輪廓后計(jì)算與O點(diǎn)橫坐標(biāo)相同時(shí),與輪廓的另一交點(diǎn)為Q。依次連接A-B-C-D-E,E-D-F-G點(diǎn),各線(xiàn)段的直線(xiàn)表達(dá)式為:
y=yi-yjxi-xj(x-xi)+yj(3)
式中:i,j為A、B、C、D、E、F、G中的兩點(diǎn)。上下領(lǐng)座線(xiàn)可表示為開(kāi)口向上的拋物線(xiàn),已知上領(lǐng)座線(xiàn)頂點(diǎn)在原點(diǎn),由A點(diǎn)坐標(biāo)可求得上領(lǐng)座方程為:
y=yAxA2x2(4)
式中:xA為A點(diǎn)橫縱坐標(biāo);yA為A點(diǎn)縱坐標(biāo)。下領(lǐng)座線(xiàn)可表示為上領(lǐng)座線(xiàn)向下平移的拋物線(xiàn),平移單位為Q點(diǎn)縱坐標(biāo),則下領(lǐng)座線(xiàn)方程表示為:
y=yAxA2x2-yQ(5)
式中:yQ為Q點(diǎn)縱坐標(biāo)??傻梦餮b領(lǐng)關(guān)鍵結(jié)構(gòu)線(xiàn)的簡(jiǎn)化輪廓如圖9(b)所示。
1.4" 測(cè)量
已知衣長(zhǎng)的實(shí)際尺寸,將其作為控制尺寸來(lái)計(jì)算西裝領(lǐng)設(shè)計(jì)參數(shù)尺寸,通過(guò)計(jì)算OP的直線(xiàn)距離來(lái)計(jì)算相應(yīng)的像素距離,得到測(cè)量比K,以此換算出其余像素距離的實(shí)際尺寸,公式為:
LOP=(xO-xP)2+(yO-yP)2(6)
K=LROPLOP(7)
式中:LOP為像素距離, LROP為衣長(zhǎng)OP的實(shí)際距離。
參考文獻(xiàn)[1]和制版參數(shù)要求,對(duì)西裝領(lǐng)的設(shè)計(jì)尺寸進(jìn)行定義輸出,設(shè)計(jì)尺寸為影響西裝領(lǐng)外觀(guān)造型的尺寸,因此其他因素如領(lǐng)座寬、松量、面料等未考慮在內(nèi),主要從款式圖中讀取以下指標(biāo):西裝領(lǐng)翻折線(xiàn)角度、串口線(xiàn)與翻折線(xiàn)夾角、駁口與串口線(xiàn)夾角、翻駁夾角、串口線(xiàn)長(zhǎng)度、駁口寬、前領(lǐng)寬、駁止點(diǎn)到衣底邊垂直距離、串口線(xiàn)與翻折線(xiàn)的交點(diǎn)到駁止點(diǎn)的垂直距離、駁頭寬。測(cè)量示意圖如圖10所示,即分別求圖中角度∠EGH、∠DEG、∠EDF、∠CDF,距離DE、DF、CD,以及點(diǎn)G、P和點(diǎn)E、G在y軸方向的垂直距離,△FGE底邊為EG時(shí)的高。利用坐標(biāo)關(guān)系和三角函數(shù)可求得這些參數(shù)的像素距離和角度,駁頭寬則通過(guò)應(yīng)用海倫定理求解。
2" 驗(yàn)證
為了驗(yàn)證測(cè)量數(shù)據(jù)的準(zhǔn)確性,在能對(duì)圖像進(jìn)行精密測(cè)量的Digimizer軟件上進(jìn)行手工測(cè)量,并對(duì)西裝實(shí)物進(jìn)行測(cè)量。為減少人工誤差,測(cè)量結(jié)果均為測(cè)量3次后的平均值,結(jié)果如表1。
通過(guò)本方法測(cè)量的尺寸與測(cè)量軟件相比,絕對(duì)誤差在0.02~0.74 cm之間,相對(duì)誤差在0.50%~6.82%之間;角度測(cè)量絕對(duì)誤差在0.02°~0.27°之間,誤差較小;與實(shí)物測(cè)量相比,尺寸的絕對(duì)誤差在0.05~1 cm之間,相對(duì)誤差在0.96%~4.37%之間,角度的絕對(duì)誤差在0.06°~0.68°之間。實(shí)驗(yàn)誤差在1 cm內(nèi)滿(mǎn)足服裝測(cè)量的標(biāo)準(zhǔn)。其中誤差最大的兩個(gè)測(cè)量部位為駁止點(diǎn)到衣底邊的垂直距離和串口線(xiàn)與翻折線(xiàn)交點(diǎn)到駁止點(diǎn)的垂直距離,原因是靠近駁止點(diǎn)的駁領(lǐng)區(qū)域面積過(guò)小,算法無(wú)法完全捕捉到駁止點(diǎn)的邊界,從而產(chǎn)生了一定的誤差,導(dǎo)致駁止點(diǎn)到衣底邊的垂直距離測(cè)量值偏大,而串口線(xiàn)與翻折線(xiàn)交點(diǎn)到駁止點(diǎn)的垂直距離偏小。
3" 總結(jié)與展望
本文提出了一種從服裝實(shí)物圖中提取西裝領(lǐng)款式參數(shù)信息的方法,首先使用SAM模型分割出西裝領(lǐng)部件,然后對(duì)部件近似多邊形并通過(guò)LSD算法修正多邊形,建立西裝領(lǐng)結(jié)構(gòu)參數(shù)模型并提取了主要的設(shè)計(jì)尺寸,主要結(jié)論如下:
a)通過(guò)SAM模型對(duì)西裝領(lǐng)部件分割,得到了西裝領(lǐng)翻領(lǐng)、駁領(lǐng)和領(lǐng)座的掩膜。
b)利用LSD算法和幾何約束調(diào)整西裝領(lǐng)部件多邊形結(jié)果,通過(guò)一次函數(shù)和拋物線(xiàn)構(gòu)建了西裝領(lǐng)結(jié)構(gòu)參數(shù)模型。
c)對(duì)西裝領(lǐng)的主要設(shè)計(jì)尺寸進(jìn)行了測(cè)量,結(jié)果表明,與測(cè)量軟件相比,尺寸的絕對(duì)誤差在0.02~0.74 cm之間,角度的絕對(duì)誤差在0.02°~0.27°之間;與實(shí)物測(cè)量相比,尺寸的絕對(duì)誤差在0.05~1 cm之間,角度的絕對(duì)誤差在0.06°~0.68°之間,測(cè)量誤差滿(mǎn)足服裝測(cè)量的標(biāo)準(zhǔn)。
本文研究結(jié)果可為制版師提供西裝領(lǐng)的設(shè)計(jì)尺寸參考,提高款式到樣板的轉(zhuǎn)換效率。另外,由于SAM模型為零樣本泛化模型,本文思路可泛化應(yīng)用在其他部件或服裝的尺寸測(cè)量上。然而,本文所測(cè)得尺寸為平面尺寸,并不是服裝樣板實(shí)際尺寸,因此還需要在后期研究中探究?jī)烧咧g的映射關(guān)系,并進(jìn)行進(jìn)一步的修正調(diào)整。
參考文獻(xiàn):
[1]LIN K, LIU K. Research on parametric design of men's suit lapel based on knowledge[J]. International Journal of Clothing Science and Technology, 2023, 35(5): 698-714.
[2]周奕涵, 徐一諾, 李濤, 等. 基于PSO-LSSVM算法的臉型與男西裝領(lǐng)型適配性研究[J]. 絲綢, 2023,60(12):92-98.
ZHOU Yihan, XU Yinuo, LI Tao, et al. Research on the adaptation of face shapes and men's suit collar types based on PSO-LSSVM[J]. Journal of Silk, 2023,60(12):92-98.
[3]CAO L, JIANG Y, JIANG M. Automatic measurement of garment dimensions using machine vision[C]//Interna-tional Conference on Computer Application and System Modeling (ICCASM). Taiyuan, China. IEEE, 2010: 30-33.
[4]李鵬飛, 鄭明智, 景軍鋒. 圖像處理在衣服尺寸在線(xiàn)測(cè)量中的應(yīng)用[J]. 電子測(cè)量與儀器學(xué)報(bào), 2016, 30(8): 1214-1219.
LI Pengfei, ZHENG Mingzhi, JING Junfeng. Application of image processing in on-line clothes size measurement[J]. Journal of Electronic Measurement and Instrumentation, 2016, 30(8): 1214-1219.
[5]SERRAT J, LUMBRERAS F, RUIZ I. Learning to measure for preshipment garment sizing[J]. Measurement, 2018, 130: 327-339.
[6]鄧瑩潔,羅戎蕾.基于卷積神經(jīng)網(wǎng)絡(luò)的半身裙款式特征分類(lèi)識(shí)別[J]. 現(xiàn)代紡織技術(shù),2021,29(6):98-105.
DENG Yingjie, LUO Ronglei. Classification and recognition of bust skirt style and common features based on convolutional neural network[J]. Advanced Textile Technology,2021,29(6):98-105.
[7]KIM S, MOON H, OH J, et al. Automatic measurements of garment sizes using computer vision deep learning models and point cloud data[J]. Applied Sciences, 2022, 12(10): 5286.
[8]PAULAUSKAITE-TARASEVICIENE A, NOREIKA E, PURTOKAS R, et al. An intelligent solution for automatic garment measurement using image recognition technologies[J]. Applied Sciences, 2022, 12(9): 4470.
[9]王燕珍. 服裝款式識(shí)別數(shù)字化表現(xiàn)原則[J]. 紡織學(xué)報(bào), 2007, 28(12): 94-98.
WANG Yanzhen. Digital principles for identification of garment styles[J]. Journal of Textile Research, 2007, 28(12): 94-98.
[10]LI C, XU Y, XIAO Y, et al. Automatic measurement of garment sizes using image recognition[C]// Proceedings of the 1st International Conference on Graphics and Signal Processing. Singapore Singapore. ACM, 2017: 30-34.
[11]KIRILLOV A, MINTUN E, RAVI N, et al. Segment anything[C]//IEEE/CVF International Conference on Computer Vision (ICCV). Paris, France. IEEE, 2023: 3992-4003.
[12]XU C, DOU J, FENG Z. Positioning laser line detection algorithm of construction robot based on LSD and improved least squares method[C]//29th International Conference on Mechatronics and Machine Vision in Practice (M2VIP). Queenstown, New Zealand. IEEE, 2023: 1-6.
[13]HUANG S, WANG Y, XIAO Y, et al. Machine vision based transformer insulation pad identification detection[C]//8th International Conference on Intelligent Compu-ting and Signal Processing(ICSP). Xi′an, China. IEEE, 2023: 184-188.
[14]LIN X, ZHOU Y, LIU Y, et al. A comprehensive review of image line segment detection and description: Tax-onomies, comparisons, and challenges[J]. IEEE Transa-ctions on Pattern Analysis and Machine Intelligence, 2024, 99: 1-20.
A size measurement method for suit collar design based on a SAM model
PENG" Zhouyana," MA" Linga," SU" Huimina," PAN" Yitinga," ZOU" Fengyuana,b,c
(a.School of Fashion Design amp; Engineering; b.Key Laboratory of Silk Culture Heritage and Products
Design Digital Technology, Ministry of Culture and Tourism; c.Zhejiang Provincial Research Center
of Clothing Engineering Technology, Zhejiang Sci-Tech University, Hangzhou 310018, China)
Abstract:
As the center of the overall visual effect of a suit, the suit collar is the most crucial factor that affects the overall visual impression. In creating clothing patterns based on design sketches, the judgment of important detailed dimensions like the suit collar often relies on the experience of pattern makers and their repeated trials and errors. Therefore, using computer vision to assist in determining the detailed dimensions of the suit collar is of great significance. However, current research on clothing measurement mainly focuses on measuring the outer contour dimensions, with unsatisfactory results for measuring the internal contour dimensions.
Low contrast in the internal contour lines of clothing makes it difficult to extract feature points and complete contours and further results in the difficulty of measuring internal dimensions from images. To address this issue, a method based on the SAM model for segmenting components to extract internal dimensions was proposed. Firstly, the SAM model was used to segment the suit collar components to improve the edge accuracy. Next, the DP algorithm was used to approximate the suit collar components into polygons, and the LSD algorithm and geometric constraints were employed to correct the errors generated during the polygon approximation process. Finally, a structural model of the suit collar was established by incorporating pixel ratios to extract relevant data.
Three main conclusions are drawn. First, by segmenting the suit collar components with the SAM model, the masks of lapel, reverse collar and collar stand were obtained. Second, by using the LSD algorithm and geometric constraints to adjust the suit collar component polygon result, a suit collar structural parameter model through linear and parabolic functions was constructed. Third, the main design dimensions of the suit collar were measured, and the results showed that compared with the measurement software, the absolute error of dimensions ranged from 0.02 cm to 0.74 cm, and the absolute error of angles ranged from 0.02° to 0.27°. Compared with the physical measurement, the absolute error of dimensions ranged from 0.05 cm to 1 cm, and the absolute error of angles ranged from 0.06° to 0.68°. The measurement error met the standards for clothing measurement.
This method can provide pattern makers with reference dimensions for the suit collar, enhancing the efficiency of transitioning from design to sample. The dimensions obtained in this study are plan view sizes and not the actual dimensions of the clothing sample. In future studies, the mapping relationship between the two will be further explored to make corrections and adjustments.
Keywords:
suit collar; garment parts' segmentation; SAM model; LSD algorithm; style drawing extraction; size measurement