Source Code Metode Transformasi Wavelet Haar dengan PHP |
<?php
set_time_limit(0);
class metodeWaveletHaar{
public $fid = null;
public $jenisCitra = null;
public $imageCari = null;
public $folder = null;
public $img = null;
public $imgX = null;
public $imgY = null;
public $pixelCitraRedDiambil = null;
public $pixelCitraGreenDiambil = null;
public $pixelCitraBlueDiambil = null;
public $pixelCitraGrayDiambil = null;
public $pixelCitraGanjil = null;
public $pixelCitraGenap = null;
public $jenisPixelCitraGenap = null;
public $totalImg = 0;
public $tampilkanPerhitungan = false;
public function setFolder($dir){
return $this->folder = $dir;
}
public function openFileOrFolder($dir,$typeImg,$tampil,$jenis,$imageCari){
$this->jenisCitra = $jenis;
$this->imageCari = $imageCari;
$this->tampilkanPerhitungan = $tampil;
if(empty($typeImg)){
$this->setFolder($dir); /*Mendefinisikan Lokasi Folder*/
foreach(glob($this->folder.'*.*') as $img){
$this->img = $dir;
$this->ambilPexelCitra($typeImg);
$this->totalImg++;
}
}else{
$this->img = $dir;
$this->ambilPexelCitra($typeImg);
}
}
public function total(){
return $this->totalImg; /*Banyaknya Citra pada Folder*/
}
public function ambilPexelCitra($typeImg){
switch($typeImg){
case "png" : $imgPixel = imagecreatefrompng($this->img); break;
default : $imgPixel = imagecreatefromjpeg($this->img); break;
}
$this->imgX = imagesx($imgPixel);
$this->imgY = imagesy($imgPixel);
for($x=0;$x<$this->imgX;$x++){ /*Lebar Citra*/
for($y=0;$y<$this->imgY;$y++){
$index = imagecolorat($imgPixel, $x, $y);
$rgb = imagecolorsforindex($imgPixel, $index);
$pixelCitraRed[] = $rgb['red'];
$pixelCitraGreen[] = $rgb['green'];
$pixelCitraBlue[] = $rgb['blue'];
$pixelCitraGray[] = round((array_sum($rgb)/3),4);
}
$this->pixelCitraGrayDiambil = implode(",",$pixelCitraGray);
}
}
public function tampilPexelCitra($pixelCitraDiambil){
$pixelBarisCitra = explode(",",$pixelCitraDiambil);
$p = 0; $n=-1;
for($i=0;$i<$this->imgY;$i++){
$p = $p+$this->imgX;
if($i<$this->imgY){
for($j=$p;$j<$p+$this->imgX;$j++){
$n++;
if($this->tampilkanPerhitungan==true){
echo "
<td>
{$pixelBarisCitra[$j-$this->imgX]}
</td>
";
}
if($n%2==0){
$this->pixelCitraGenap[] = $pixelBarisCitra[$j-$this->imgX];
}else{
$this->pixelCitraGanjil[] = $pixelBarisCitra[$j-$this->imgX];
}
}
}
}
echo "
</table>
";
$this->rataRataDanSelisihCitra(implode(",",$this->pixelCitraGanjil),implode(",",$this->pixelCitraGenap),$arahBaris=true,null,null);
}
public function rataRataDanSelisihCitra($pixelCitraGanjil,$pixelCitraGenap,$arahBaris,$hasilPixelKolomCitraGanjilselisihCitra,$hasilPixelKolomCitraGenapselisihCitra){
$pixelBarisGanjilCitra = explode(",",$pixelCitraGanjil);
$pixelBarisGenapCitra = explode(",",$pixelCitraGenap);
if($hasilPixelKolomCitraGanjilselisihCitra!=null AND $arahBaris!=true){
$hasilPixelKolomCitraGanjilselisihCitra = explode(",",$hasilPixelKolomCitraGanjilselisihCitra);
$hasilPixelKolomCitraGenapselisihCitra = explode(",",$hasilPixelKolomCitraGenapselisihCitra);
for($i=0;$i<COUNT($hasilPixelKolomCitraGanjilselisihCitra);$i++){
$rataRataKolomCitra[] = round(($hasilPixelKolomCitraGanjilselisihCitra[$i]+$hasilPixelKolomCitraGenapselisihCitra[$i])/sqrt(2),4);
$selisihKolomCitra[] = round(($hasilPixelKolomCitraGenapselisihCitra[$i]-$hasilPixelKolomCitraGanjilselisihCitra[$i])/sqrt(2),4);
}
$rataRataKolomCitra = implode(",",$rataRataKolomCitra);
$selisihKolomCitra = implode(",",$selisihKolomCitra);
}
for($i=0;$i<COUNT($pixelBarisGanjilCitra);$i++){
$rataRataCitra[] = round(($pixelBarisGanjilCitra[$i]+$pixelBarisGenapCitra[$i])/sqrt(2),4);
$selisihCitra[] = round(($pixelBarisGenapCitra[$i]-$pixelBarisGanjilCitra[$i])/sqrt(2),4);
}
$pixelrataRataCitra = implode(",",$rataRataCitra);
$pixelSelisihCitra = implode(",",$selisihCitra);
if($arahBaris==true){
$this->dekomposisiArahBarisCitra($pixelrataRataCitra,$pixelSelisihCitra);
}else{
$this->hasilDekomposisiCitra($pixelrataRataCitra,$pixelSelisihCitra,$rataRataKolomCitra,$selisihKolomCitra);
}
}
public function dekomposisiArahBarisCitra($rataRataCitra,$selisihCitra){
$rataRataCitra = explode(",",$rataRataCitra);
$selisihCitra = explode(",",$selisihCitra);
$p = 0; $setengahBaris = $this->imgX/2;
for($i=0;$i<$this->imgY;$i++){
$p = $p+$setengahBaris;
if($i<$this->imgY){
for($j=$p;$j<$p+$setengahBaris;$j++){
$hasilRataRataCitra[] = $rataRataCitra[$j-$setengahBaris];
}
for($j=$p;$j<$p+$setengahBaris;$j++){
$hasilSelisihCitra[] = $selisihCitra[$j-$setengahBaris];
}
}
}
$this->dekomposisiCitraArahKolom(implode(",",$hasilRataRataCitra),implode(",",$hasilSelisihCitra));
}
public function dekomposisiCitraArahKolom($hasilRataRataCitra,$hasilSelisihCitra){
$rataRataCitra = explode(",",$hasilRataRataCitra);
$selisihCitra = explode(",",$hasilSelisihCitra);
$n = 0; $setengahBaris = $this->imgX/2;
for($j=0;$j<$setengahBaris;$j+=1){
if($j<$setengahBaris){
for($i=0;$i<COUNT($rataRataCitra);$i+=$setengahBaris){
if($n%2==0){
$pixelKolomCitraGenap[] = $rataRataCitra[$i+$j];
$pixelKolomCitraGenapSelisih[] = $selisihCitra[$i+$j];
}else{
@$pixelKolomCitraGanjil[] = $rataRataCitra[$i+$j];
@$pixelKolomCitraGanjilSelisih[] = $selisihCitra[$i+$j];
}
$n++;
}
$hasilPixelKolomCitraGenap = implode(",",$pixelKolomCitraGenap);
$hasilPixelKolomCitraGanjil = implode(",",$pixelKolomCitraGanjil);
$hasilPixelKolomCitraGenapselisihCitra = implode(",",$pixelKolomCitraGenapSelisih);
$hasilPixelKolomCitraGanjilselisihCitra = implode(",",$pixelKolomCitraGanjilSelisih);
}
}
}
public function hitungEnergiCitra($energiCitra1,$energiCitra2,$energiCitra3,$energiCitra4){
$ciriCitra1 = 0;
$ciriCitra2 = 0;
$ciriCitra3 = 0;
$ciriCitra4 = 0;
$pecahEnergi1 = explode(",",$energiCitra1);
$pecahEnergi2 = explode(",",$energiCitra2);
$pecahEnergi3 = explode(",",$energiCitra3);
$pecahEnergi4 = explode(",",$energiCitra4);
for($i=0;$i<COUNT($pecahEnergi1);$i++){
$ciriCitra1 = $ciriCitra1+$pecahEnergi1[$i];
$ciriCitra2 = $ciriCitra2+$pecahEnergi2[$i];
$ciriCitra3 = $ciriCitra3+$pecahEnergi3[$i];
$ciriCitra4 = $ciriCitra4+$pecahEnergi4[$i];
}
}
}
?>
37 comments
nice and perfect
Replyterima kasih infonya gan
ReplyThe wordpress developers for hire is available now where they can use their web programming in a great way. This is amazing program to understand.
Replyamazing blog.
ReplySEO Training in Bhopal
Digital Marketing Training in Bhopal
Thanks for share great information
ReplySEO Institute in Uttam Nagar
Web Designing Course in Janakpuri
PHP Course in Dwarka
Shahni Digital Media provides complete digital marketing solutions to your business. e.g. ppc, social media marketing, web designing & development. Hire us to grow up your business high.
ReplyDigital Marketing Company Bhopal
Website Designing Company Bhopal
SEO Company in Bhopal
ORM Company India
PHP sources is quite helpful, still it's helps the website to be modernize and some of the companies use templates that are already build to customize the website. I also would have assumed these PHP code to be referring to some domestic site.
ReplyWell, there's a lot changed now as like a catchy title attracts readers, but how do you keep them on the page? Use the headings. headings, structure your content and guide readers in the text. For example check this Chiropractic management software article here and you can see how well, structured the new and creative article. Also include fonts size the right font and the right font size can make your content easier to read and visually more interesting, thus increasing engagement. Moreover, bold and italic content makes our blog looks pretty attractive.
One of the great chiropractic websites main specialties in creative and stunning website and they build website without use of any templates. https://optimized360.com/blogs/top-5-things-you-need-on-your-chiropractic-website/ I would strongly recommend that.
As you grow, you will realize that arguing right and wrong more(so sánh gạch nung và gạch không nung) than losing to others is ( tìm hiểu tam san be tong sieu nhe) sometimes not important anymore. Most importantly, just want peace.
ReplyBig Data Hadoop Training in Bhopal
ReplyFullStack Training in Bhopal
PHP Training in Bhopal
Python Training in Bhopal
Machine Learning Training in Bhopal
Digital Marketing Training in Bhopal
.I have gone through your blog post, nice blog it’s very helpful and I really thankful for you.
Replywe provide best services in smart classes field in bhopal as well as we provide service like projector sell & Buy,
projector repairing also done by us.
autocad in bhopal
3ds max classes in bhopal
CPCT Coaching in Bhopal
java coaching in bhopal
Autocad classes in bhopal
Catia coaching in bhopal
Thanks for sharing excellent information.If you Are looking Best smart autocad classes in india,
Replyprovide best service for us.
autocad in bhopal
3ds max classes in bhopal
CPCT Coaching in Bhopal
java coaching in bhopal
Autocad classes in bhopal
I beyond question welcome the way wherein you keep posting such astonishing and significant articles and keep invigorating your blog with latest bearing. Keep up this goliath work. Continue forming.
Replyhttps://myseokhazana.com/
Thanks for posting this amazing source code method for transformasi wavelet.
ReplyFind here best Free Link Building Sites List
If you want to improve your business and looking for affordable, professional, reliable SEO, SMO, SEO Company Near me , look nowhere, as our team is capable of providing you sufficient target traffic from the location, where you have potential customers.
ReplySEO Company Near me
Gramblr Alternative
Indian Review Site
Best Night club in Goa
Thanks for providing this kind of information share with us.
Replyfacebook marketing services
facebook marketing agency
best ORM services
website designing services
youtube marketing services
social media marketing services
I really enjoyed your blog Thanks for sharing such an informative post.
Replyhttps://www.login4ites.com/
https://myseokhazana.com/
ReplyFind trendy technology stock photos in HD and tens of millions of different royalty-loose stock photographs, illustrations and vectors within the Shutterstock series.
Random Email Generator
Black light app
Temp mail
Terrarium TV App
tik tok
ERP software
SEO Training in Bhopal
ReplyDigital Marketing Training in Bhopal
SEO Company in Bhopal
Digital Marketing Company in Bhopal
Here is a list of the most popular seo group buy tools provider · Flikover · SupremSEO · ToolsZap · Pitorr
Reply918kiss Malaysia APK Store Download 2021 Available devices: Android and IOS iPhone & Pc Computer. Free Installer and Maintenance Service.
ReplySEO Malaysia - Suitable for Retail, Lead Generation. Online Education, Gyms, AdWords Partner. Certified GA Partner. Services: Data Segmentation, Statistical Analysis, CRM Methodologies, Dynamic Remarketing, Online Media Buying, Search Engine Marketing.
ReplyGet everything you need for you, friends & family - day & night, active & night wear, party supplies & gifts at the comfort of your home … in short … “Socho aur Lailoo”.
ReplyYou can also add your desire items by sending message in your wish list if you are unable to find in our store,Our professionals get it for you at the best rates.
We believe in feminine and graceful outfits. RJ’s is unique for its fresh take on cuts both modern western and traditional eastern with excellent detailing be it evening wear, casual line or Rj’s Exclusive wear.
ReplyHey, this site was recommended from the site that i just browsed earlier thats why i got curious and so far i am impress of what i`ve seen here. Here`s the goodluck for the progress of your site.Find online thesis helpat affordable price. Thanks
ReplyShiksha Education Consultancy is offering list of top MBBS colleges for medical students so if you are looking for best colleges in this niche so please get the details below.
ReplyDanylo Halytsky Lviv National Medical University
Bogomolets National Medical University
Vinnytsia National Pirogov Medical University
Asian medical Institute, Kyrgyzstan
Kyrgyz State Medical Academy
International Higher School of Medicine, Kyrgyzstan
Jalal-Abad State University
Medical Institute, Osh State University
Medical College for Women and Hospital,Bangladesh
Kazakh National Medical University
Find Your bank IFSC Code and other details like Address, IFSC Code and Phone numbers
Replyicici bank ifsc code in noida sector 48
icici bank ifsc code in noida sector 132
icici bank ifsc code in noida sector 27
icici bank ifsc code in noida sector 18
icici bank ifsc code in noida sector 63
icici bank ifsc code in noida sector 62
icici bank ifsc code in noida sector 110
icici bank uttamnagar new delhi delhi address and ifsc code
icici bank gandhi nagar delhi address and ifsc code
icici bank dilshad colony delhi address and ifsc code
We are offering following python courses.
ReplyPython Training institute in Delhi
Python Training institute in Noida
Python Training institute in Ghaziabad
Python Free Course
Thank You for publishing such a wonderfull details.We are also offering offering trainig please read the following detailsof our organization.
ReplyTrainingIcon is the most expert and known WordPress Training Institute in Delhi. This Institute has been leading WordPress training institute in Delhi for recent years. TrainingIcon has made various of the understudies and given arrangements into the top IT organizations. After the culmination of WordPress preparing now they are taking care of their responsibilities in the most famous IT firms.
Picking different sources online for amazing web architecture and improvement will lead you towards that load of highlights that you consider in a viable way. With the accessibility of php preparing in delhi for reasonable bundles, it is feasible to investigate a definitive advancement guidelines in a precise design that you anticipate. Different scope of php courses are accessible for the fans on account of which outstanding web architectures could be acknowledged in a genuine style.
PHP Training in Delhi
Today I was surfing on the internet & found this article I read it & it is really amazing articles on the internet on this topic thanks for sharing such an amazing article.
ReplySEO Company in Bhopal
thanks a lot for sharing, this really helped in my workhttps://cruznnkh45556.wizzardsblog.com/6214083/all-about-satta-king
ReplyPerfect blog to read in free time to gain knowladge.http://tysonolkg45555.mdkblog.com/8702480/all-about-satta-king
ReplyWell explained article, loved to read this blog post and bookmarking this blog for future.http://maple.linppt.cc/home.php?mod=space&uid=1922824
ReplyI'm grateful for the opportunity to learn from your expertise through your blog. Color Blindness TestIt helps individuals understand their color perception limitations.
ReplyI'm grateful for the effort you put into researching and presenting this content.I've been using this Best auto clicker to speed up mundane tasks, and it's been a game-changer.
ReplyYour writing style is both eloquent and approachable.This Dice roller online
ReplyI'm constantly in awe of the depth and breadth of your writing.Escape the daily grind with canuckle game and immerse yourself in a relaxing vocabulary challenge.
ReplyThank you for providing information on the wavelet transformation method and source code! It's a valuable resource for those interested in image processing and signal analysis. Do you have any additional resources or tips for beginners looking to understand the basics of wavelet transformations before diving into the code? Looking forward to more technical insights from your blog!
ReplyEpicforce Tech
Post a Comment