facebox 介绍

FaceBox

FaceBox

Facebox is a jQuery-based, Facebook-style lightbox which can display images, divs, or entire remote pages.

It's simple to use and easy on the eyes. Download the tarball, view the examples, then start enjoying the curves.

FaceBox下载

下载 facebox-1.0.tar.gz

FaceBox预览

FaceBox FaceBox

FaceBox FaceBox

FaceBox 使用方法:

Images

<a href="/facebox/stairs.jpg" rel="facebox">text</a>

Divs

<a href="#info" rel="facebox">text</a>

Ajaxes

<a href="/facebox/remote.html" rel="facebox">text</a>

Load Dependencies

Make sure jQuery is loaded before Facebox.

<script src="jquery.js" type="text/javascript"></script>
<link href="/facebox/facebox.css" media="screen" rel="stylesheet" type="text/css"/>
<script src="/facebox/facebox.js" type="text/javascript"></script>

Attach It onLoad

While calling facebox() on any anchor tag will do the trick, it's easier to give your Faceboxy links a rel="facebox" and hit them all onLoad.

jQuery(document).ready(function($) {
  $('a[rel*=facebox]').facebox()
})

Extra Classes

You can give the facebox container an extra class (to fine-tune the display of reusable remote pages) with the facebox[.class] rel syntax.

Maybe your Terms and Conditions can be loaded standalone or via Facebox. When loaded in Facebox, you might want to tweak some styles -- like making the h1 positioned absolutely? We do this on FamSpam.

<a href="/facebox/remote.html" rel="facebox[.bolder]">text</a>

Controlling Facebox Programmatically

It's possible to attain a higher level control over Facebox by calling methods directly. The following will open the Facebox and insert the passed string into it:

Arbitrary Text

jQuery.facebox('something cool')

If you plan to fill the Facebox with the result of an Ajax call, you'll want the loading graphic displayed whilst your asynchronus task runs. This is the automatic behavior if the facebox() method is passed a function.

Loading Image Displayed

jQuery.facebox(function() {
  jQuery.get('code.js', function(data) {
    jQuery.facebox('<textarea>' + data + '</textarea>')
  })
})

<script type="text/javascript">SHARETHIS.addEntry({ title: "FaceBox", url: "http://www.21andy.com/blog/20080228/1018.html" });</script>ShareThis

人脸祛痘算法主要分为以下几个步骤: 1. 读取人脸图像,可以使用MATLAB自带的imread函数。 2. 利用Haar特征或其他人脸检测算法检测人脸区域。 3. 在人脸区域内进行痘痘检测。可以使用肤色分割算法,将人脸图像转换为HSV色彩空间,然后根据肤色的范围提取人脸区域,再进行痘痘检测。 4. 对检测到的痘痘区域进行去痘处理。可以使用图像修复算法,例如基于Patch的图像修复算法,对痘痘区域进行修复。 5. 最后将去痘后的人脸图像输出。 以下是一份简单的MATLAB代码示例,用于去除人脸图像中的痘痘: ```matlab % 读取人脸图像 im = imread('face.jpg'); % 使用Haar特征检测人脸区域 faceDetector = vision.CascadeObjectDetector; faceBox = step(faceDetector, im); % 将人脸图像转换为HSV色彩空间,并提取人脸区域 imHSV = rgb2hsv(im); faceRegion = imHSV(faceBox(2):faceBox(2)+faceBox(4), faceBox(1):faceBox(1)+faceBox(3), :); % 根据肤色范围提取人脸区域 skinMask = (faceRegion(:,:,1)>0.05) & (faceRegion(:,:,1)<0.2) & (faceRegion(:,:,2)>0.3) & (faceRegion(:,:,3)>0.05); faceSkin = bsxfun(@times, faceRegion, cast(skinMask, 'like', faceRegion)); % 使用二值形态学处理去除痘痘 se = strel('disk', 3); faceSkinMask = imclose(faceSkin(:,:,1), se); faceSkin(:,:,1) = imopen(faceSkinMask, se); % 将去痘后的人脸区域合并到原图像中 im(faceBox(2):faceBox(2)+faceBox(4), faceBox(1):faceBox(1)+faceBox(3), :) = hsv2rgb(faceSkin); % 显示去痘后的人脸图像 imshow(im); ``` 需要注意的是,这只是一个简单的示例代码,实际应用中可能需要根据具体情况进行调整和优化。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值