【问题标题】:I want to save the detected face as a jpg image in matalb我想在matlab中将检测到的人脸保存为jpeg图像
【发布时间】:2016-06-27 14:17:15
【问题描述】:

我已从图像中检测到人脸。现在我想将检测到的人脸作为 jpg 图像存储在 matlab 中。请有人指导我。

人脸检测代码为:

img = imread('C:\Users\Anmol\Desktop\face_recognition\Pgm\image1');

facedetector = vision.CascadeObjectDetector()
BBOX = step(facedetector,img)

B = insertObjectAnnotation(img,'rectangle',BBOX,'Face');

title('detected faces');

n = size(BBOX,1);

string = num2str(n);

str = strcat('no of face=',string);

disp(str);

非常感谢有人可以提供将检测到的人脸存储为 jpg 图像的代码

【问题讨论】:

标签: matlab image-processing matlab-cvst


【解决方案1】:

您可以使用imcrop 裁剪面部,然后使用imwrite 保存裁剪后的图像。

faceImage = imcrop(img, BBOX(1,:))
imwrite(img, 'face.jpg');

【讨论】:

    猜你喜欢
    • 2012-03-08
    • 2022-11-24
    • 2021-01-22
    • 2013-04-04
    • 2019-12-01
    • 2018-05-30
    • 2017-10-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多