SlideShare a Scribd company logo
1 of 6
this is an active contour method in python 2.7 I need to adjust
just this program
import Tkinter
from Tkinter import *
import os
import sys
import ImageTk, Image
import PIL
from PIL import *
from array import array
from turtle import *
import math
from math import pi
#creating a window
window=Tkinter.Tk()
window.geometry("650x650")
window.title("Active Contour Implementation")
window.configure()
#function for open file
#function for new form
def OpenNew():
openNew=Tkinter.Tk()
openNew.title("Welcome")
openNew.geometry("500x500")
menubar = Menu(openNew)
filemenu = Menu(menubar, tearoff=0)
filemenu.add_command(label="New", command=OpenNew)
filemenu.add_command(label="Open", command=openFile)
filemenu.add_command(label="Save")
filemenu.add_command(label="Save as...",
command=saveAs)
filemenu.add_separator()
filemenu.add_command(label="Exit",
command=OpenNew.quit)
openNew.config(menu=menubar)
openNew.mainloop()
#Enter the value
entr=Entry(window)
entr.pack(fill=Y)
entr.delete(0, END)
entr.insert(0, " input the value")
#Active Contour Implementation
imgOpen="image3.jpg"
image1 = ImageTk.PhotoImage(Image.open(imgOpen))
w = image1.width()
h = image1.height()
x = 0
y = 0
window.geometry("%dx%d+%d+%d" % (w, h, x, y))
Lbl = Tkinter.Label(window, image=image1)
Lbl.pack(side='top', fill='both', expand='yes')
Lbl.image = image1
print w
print h
newX=w/2
newY=h/2
print 'newwwwww'
print newX
print newY
n=150
s_radius=250
LCV=array("i")
for i in range (n):
LCV.append(i)
L1X = array("i")
for i in range (n):
L1X.append(i)
L1Y = array("i")
for i in range (n):
L1Y.append(i)
L2X = array("i")
for i in range (n):
L2X.append(i)
L2Y = array("i")
for i in range (n):
L2Y.append(i)
BordersX = array("i")
for i in range (n):
BordersX.append(i)
BordersY = array("i")
for i in range (n):
BordersY.append(i)
xFill=[BordersX, -1]
yFill=[BordersY, -1]
#Set=color('red')
step_size=15
jump_threshold=25
#setWidth?
radius=s_radius
radius>10
radius=radius-step_size
if radius==s_radius:
i=0
while i
x_0=radius * cos ( i * (2*pi)/n)
y_0=radius * sin ( i * (2*pi)/n)
x_0 = x_0 + newX
y_0 = y_0 + newY
BordersX[i]= x_0
BordersY[i]= y_0
LCV[i] = -1
i+=1
pnt_cnt=0
j=0
while j
if LCV[j]== -1:
x_0=radius * cos( i * (2*pi)/n) + newX
y_0=radius * sin ( i * (2*pi)/n) + newY
x_1=((radius - step_size) * cos( i * (2*pi)/n) ) + newX
y_1=((radius - step_size) * sin ( i * (2*pi)/n) ) + newY
v_0 = getPixel(x_0, y_0)
v_1 = getPixel(x_1, y_1)
if gVal(v_0) - gVal(v_1) > jump_threshold:
LCV[i]=1
else:
BordersX[i]= x_1
BordersY[i]= y_1
Pol=Tkinter.Canvas(window)
Pol.pack()
Pol.create_line(BordersX, BordersY)
wait(20)
pnt_cnt=pnt_cnt + 1
i+=1
def gVal(v):
red = (v>>16)&0xff
green = (v>>8)&0xff
blue = v&0xff
return (00.56 * red + 0.33*green + 0.11 * blue)
# Menu Option
#File menu
menubar=Menu(window)
filemenu=Menu(menubar, tearoff=0)
filemenu.add_command(label="New",command=OpenNew)
filemenu.add_command(label="Open", command=openFile)
filemenu.add_command(label="Save")
filemenu.add_command(label="Save As",command=saveAs)
filemenu.add_separator()
filemenu.add_command(label="Exit",command= window.quit)
menubar.add_cascade(label="File", menu=filemenu)
#Edit menu
editmenu=Menu(menubar, tearoff=0)
editmenu.add_command(label="Cut")
editmenu.add_command(label="Copy")
editmenu.add_command(label="Paste")
editmenu.add_command(label="Delete")
editmenu.add_command(label="Select All")
menubar.add_cascade(label="Edit",menu=editmenu)
#Help menu
helpmenu=Menu(menubar, tearoff=0)
helpmenu.add_command(label="About", command=help)
helpmenu.add_command(label="Help", command=help)
menubar.add_cascade(label="Help", menu=helpmenu)
window.config(menu=menubar)
window.mainloop()

More Related Content

Similar to this is an active contour method in python 2.7 I need to adjust just.docx

The Ring programming language version 1.3 book - Part 43 of 88
The Ring programming language version 1.3 book - Part 43 of 88The Ring programming language version 1.3 book - Part 43 of 88
The Ring programming language version 1.3 book - Part 43 of 88Mahmoud Samir Fayed
 
The Ring programming language version 1.5.1 book - Part 12 of 180
The Ring programming language version 1.5.1 book - Part 12 of 180The Ring programming language version 1.5.1 book - Part 12 of 180
The Ring programming language version 1.5.1 book - Part 12 of 180Mahmoud Samir Fayed
 
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...Edureka!
 
The Ring programming language version 1.10 book - Part 78 of 212
The Ring programming language version 1.10 book - Part 78 of 212The Ring programming language version 1.10 book - Part 78 of 212
The Ring programming language version 1.10 book - Part 78 of 212Mahmoud Samir Fayed
 
Tkinter_GUI_Programming_in_Python.pdf
Tkinter_GUI_Programming_in_Python.pdfTkinter_GUI_Programming_in_Python.pdf
Tkinter_GUI_Programming_in_Python.pdfArielManzano3
 
In Class AssignmetzCST280W13a-1.pdfCST 280 In-Class Pract.docx
In Class AssignmetzCST280W13a-1.pdfCST 280 In-Class Pract.docxIn Class AssignmetzCST280W13a-1.pdfCST 280 In-Class Pract.docx
In Class AssignmetzCST280W13a-1.pdfCST 280 In-Class Pract.docxbradburgess22840
 
Google App Engine Developer - Day3
Google App Engine Developer - Day3Google App Engine Developer - Day3
Google App Engine Developer - Day3Simon Su
 
Modules in Python.docx
Modules in Python.docxModules in Python.docx
Modules in Python.docxmanohar25689
 
Revision of the basics of python1 (1).pdf
Revision of the basics of python1 (1).pdfRevision of the basics of python1 (1).pdf
Revision of the basics of python1 (1).pdfoptimusnotch44
 
The Ring programming language version 1.3 book - Part 49 of 88
The Ring programming language version 1.3 book - Part 49 of 88The Ring programming language version 1.3 book - Part 49 of 88
The Ring programming language version 1.3 book - Part 49 of 88Mahmoud Samir Fayed
 
Introduction to python programming 2
Introduction to python programming   2Introduction to python programming   2
Introduction to python programming 2Giovanni Della Lunga
 
The Ring programming language version 1.5.3 book - Part 81 of 184
The Ring programming language version 1.5.3 book - Part 81 of 184The Ring programming language version 1.5.3 book - Part 81 of 184
The Ring programming language version 1.5.3 book - Part 81 of 184Mahmoud Samir Fayed
 
Chapter 1 Class 12 Computer Science Unit 1
Chapter 1 Class 12 Computer Science Unit 1Chapter 1 Class 12 Computer Science Unit 1
Chapter 1 Class 12 Computer Science Unit 1ssusera7a08a
 
The Ring programming language version 1.9 book - Part 82 of 210
The Ring programming language version 1.9 book - Part 82 of 210The Ring programming language version 1.9 book - Part 82 of 210
The Ring programming language version 1.9 book - Part 82 of 210Mahmoud Samir Fayed
 
Python Functions Tutorial | Working With Functions In Python | Python Trainin...
Python Functions Tutorial | Working With Functions In Python | Python Trainin...Python Functions Tutorial | Working With Functions In Python | Python Trainin...
Python Functions Tutorial | Working With Functions In Python | Python Trainin...Edureka!
 

Similar to this is an active contour method in python 2.7 I need to adjust just.docx (20)

The Ring programming language version 1.3 book - Part 43 of 88
The Ring programming language version 1.3 book - Part 43 of 88The Ring programming language version 1.3 book - Part 43 of 88
The Ring programming language version 1.3 book - Part 43 of 88
 
w10 (1).ppt
w10 (1).pptw10 (1).ppt
w10 (1).ppt
 
The Ring programming language version 1.5.1 book - Part 12 of 180
The Ring programming language version 1.5.1 book - Part 12 of 180The Ring programming language version 1.5.1 book - Part 12 of 180
The Ring programming language version 1.5.1 book - Part 12 of 180
 
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
 
The Ring programming language version 1.10 book - Part 78 of 212
The Ring programming language version 1.10 book - Part 78 of 212The Ring programming language version 1.10 book - Part 78 of 212
The Ring programming language version 1.10 book - Part 78 of 212
 
CORE JAVA-2
CORE JAVA-2CORE JAVA-2
CORE JAVA-2
 
Tkinter_GUI_Programming_in_Python.pdf
Tkinter_GUI_Programming_in_Python.pdfTkinter_GUI_Programming_in_Python.pdf
Tkinter_GUI_Programming_in_Python.pdf
 
In Class AssignmetzCST280W13a-1.pdfCST 280 In-Class Pract.docx
In Class AssignmetzCST280W13a-1.pdfCST 280 In-Class Pract.docxIn Class AssignmetzCST280W13a-1.pdfCST 280 In-Class Pract.docx
In Class AssignmetzCST280W13a-1.pdfCST 280 In-Class Pract.docx
 
Google App Engine Developer - Day3
Google App Engine Developer - Day3Google App Engine Developer - Day3
Google App Engine Developer - Day3
 
Modules in Python.docx
Modules in Python.docxModules in Python.docx
Modules in Python.docx
 
Revision of the basics of python1 (1).pdf
Revision of the basics of python1 (1).pdfRevision of the basics of python1 (1).pdf
Revision of the basics of python1 (1).pdf
 
The Ring programming language version 1.3 book - Part 49 of 88
The Ring programming language version 1.3 book - Part 49 of 88The Ring programming language version 1.3 book - Part 49 of 88
The Ring programming language version 1.3 book - Part 49 of 88
 
python modules1522.pdf
python modules1522.pdfpython modules1522.pdf
python modules1522.pdf
 
Introduction to python programming 2
Introduction to python programming   2Introduction to python programming   2
Introduction to python programming 2
 
The Ring programming language version 1.5.3 book - Part 81 of 184
The Ring programming language version 1.5.3 book - Part 81 of 184The Ring programming language version 1.5.3 book - Part 81 of 184
The Ring programming language version 1.5.3 book - Part 81 of 184
 
Chapter 1 Class 12 Computer Science Unit 1
Chapter 1 Class 12 Computer Science Unit 1Chapter 1 Class 12 Computer Science Unit 1
Chapter 1 Class 12 Computer Science Unit 1
 
The Ring programming language version 1.9 book - Part 82 of 210
The Ring programming language version 1.9 book - Part 82 of 210The Ring programming language version 1.9 book - Part 82 of 210
The Ring programming language version 1.9 book - Part 82 of 210
 
Notification android
Notification androidNotification android
Notification android
 
Python Functions Tutorial | Working With Functions In Python | Python Trainin...
Python Functions Tutorial | Working With Functions In Python | Python Trainin...Python Functions Tutorial | Working With Functions In Python | Python Trainin...
Python Functions Tutorial | Working With Functions In Python | Python Trainin...
 
Managing Mocks
Managing MocksManaging Mocks
Managing Mocks
 

More from candycemidgley

Week 2 DiscussionPlease respond to one of the following questi.docx
Week 2 DiscussionPlease respond to one of the following questi.docxWeek 2 DiscussionPlease respond to one of the following questi.docx
Week 2 DiscussionPlease respond to one of the following questi.docxcandycemidgley
 
Week 2 Discussion 1- 51415Social Versus Human CapitalThis we.docx
Week 2 Discussion 1- 51415Social Versus Human CapitalThis we.docxWeek 2 Discussion 1- 51415Social Versus Human CapitalThis we.docx
Week 2 Discussion 1- 51415Social Versus Human CapitalThis we.docxcandycemidgley
 
Week 2 discussion topic1) Computer security is essential to .docx
Week 2 discussion topic1) Computer security is essential to .docxWeek 2 discussion topic1) Computer security is essential to .docx
Week 2 discussion topic1) Computer security is essential to .docxcandycemidgley
 
Week 2 Discussion - Best Places to WorkLooking at the top three (3.docx
Week 2 Discussion - Best Places to WorkLooking at the top three (3.docxWeek 2 Discussion - Best Places to WorkLooking at the top three (3.docx
Week 2 Discussion - Best Places to WorkLooking at the top three (3.docxcandycemidgley
 
Week 2 Argument Paper Outline TemplateENG200 Version 2 1.docx
Week 2 Argument Paper Outline TemplateENG200 Version 2 1.docxWeek 2 Argument Paper Outline TemplateENG200 Version 2 1.docx
Week 2 Argument Paper Outline TemplateENG200 Version 2 1.docxcandycemidgley
 
Week 2 Assignment 1Challenges of Transitioning in a Professional E.docx
Week 2 Assignment 1Challenges of Transitioning in a Professional E.docxWeek 2 Assignment 1Challenges of Transitioning in a Professional E.docx
Week 2 Assignment 1Challenges of Transitioning in a Professional E.docxcandycemidgley
 
Week 2 IPWeekly tasks or assignments (Individual or Group Projec.docx
Week 2 IPWeekly tasks or assignments (Individual or Group Projec.docxWeek 2 IPWeekly tasks or assignments (Individual or Group Projec.docx
Week 2 IPWeekly tasks or assignments (Individual or Group Projec.docxcandycemidgley
 
Week 2Testing means - T-testsIn qu.docx
Week 2Testing means - T-testsIn qu.docxWeek 2Testing means - T-testsIn qu.docx
Week 2Testing means - T-testsIn qu.docxcandycemidgley
 
Week 11a.Analyze the need for unbiased financial repor.docx
Week 11a.Analyze the need for unbiased financial repor.docxWeek 11a.Analyze the need for unbiased financial repor.docx
Week 11a.Analyze the need for unbiased financial repor.docxcandycemidgley
 
Week 2 What is driving the need for this transformational change (.docx
Week 2 What is driving the need for this transformational change (.docxWeek 2 What is driving the need for this transformational change (.docx
Week 2 What is driving the need for this transformational change (.docxcandycemidgley
 
This is for a case study on Jeffery Dahmer.I needBiological Fa.docx
This is for a case study on Jeffery Dahmer.I needBiological Fa.docxThis is for a case study on Jeffery Dahmer.I needBiological Fa.docx
This is for a case study on Jeffery Dahmer.I needBiological Fa.docxcandycemidgley
 
This is due in 24 hoursThere are 4 big questions in total. The a.docx
This is due in 24 hoursThere are 4 big questions in total. The a.docxThis is due in 24 hoursThere are 4 big questions in total. The a.docx
This is due in 24 hoursThere are 4 big questions in total. The a.docxcandycemidgley
 
this is first questionDo you feel that the TCPIP model is more or.docx
this is first questionDo you feel that the TCPIP model is more or.docxthis is first questionDo you feel that the TCPIP model is more or.docx
this is first questionDo you feel that the TCPIP model is more or.docxcandycemidgley
 
This is due by 2000 tonight EST.  It must be 300+ words, MLA, and a.docx
This is due by 2000 tonight EST.  It must be 300+ words, MLA, and a.docxThis is due by 2000 tonight EST.  It must be 300+ words, MLA, and a.docx
This is due by 2000 tonight EST.  It must be 300+ words, MLA, and a.docxcandycemidgley
 
This is assignment is due tomorrow.Reread the discussion board res.docx
This is assignment is due tomorrow.Reread the discussion board res.docxThis is assignment is due tomorrow.Reread the discussion board res.docx
This is assignment is due tomorrow.Reread the discussion board res.docxcandycemidgley
 
This is basic college admissions essay.There are many interest.docx
This is basic college admissions essay.There are many interest.docxThis is basic college admissions essay.There are many interest.docx
This is basic college admissions essay.There are many interest.docxcandycemidgley
 
This is an open-book essay exam. Please answer both questions in.docx
This is an open-book essay exam. Please answer both questions in.docxThis is an open-book essay exam. Please answer both questions in.docx
This is an open-book essay exam. Please answer both questions in.docxcandycemidgley
 
This is for a discussion post! Need to have one resource!!!To .docx
This is for a discussion post! Need to have one resource!!!To .docxThis is for a discussion post! Need to have one resource!!!To .docx
This is for a discussion post! Need to have one resource!!!To .docxcandycemidgley
 
This is for kristine tutor  Make sure I do not want to get a.docx
This is for  kristine tutor  Make sure I do not want to get a.docxThis is for  kristine tutor  Make sure I do not want to get a.docx
This is for kristine tutor  Make sure I do not want to get a.docxcandycemidgley
 
This is an extra credit assignment. You are to write an essay on one.docx
This is an extra credit assignment. You are to write an essay on one.docxThis is an extra credit assignment. You are to write an essay on one.docx
This is an extra credit assignment. You are to write an essay on one.docxcandycemidgley
 

More from candycemidgley (20)

Week 2 DiscussionPlease respond to one of the following questi.docx
Week 2 DiscussionPlease respond to one of the following questi.docxWeek 2 DiscussionPlease respond to one of the following questi.docx
Week 2 DiscussionPlease respond to one of the following questi.docx
 
Week 2 Discussion 1- 51415Social Versus Human CapitalThis we.docx
Week 2 Discussion 1- 51415Social Versus Human CapitalThis we.docxWeek 2 Discussion 1- 51415Social Versus Human CapitalThis we.docx
Week 2 Discussion 1- 51415Social Versus Human CapitalThis we.docx
 
Week 2 discussion topic1) Computer security is essential to .docx
Week 2 discussion topic1) Computer security is essential to .docxWeek 2 discussion topic1) Computer security is essential to .docx
Week 2 discussion topic1) Computer security is essential to .docx
 
Week 2 Discussion - Best Places to WorkLooking at the top three (3.docx
Week 2 Discussion - Best Places to WorkLooking at the top three (3.docxWeek 2 Discussion - Best Places to WorkLooking at the top three (3.docx
Week 2 Discussion - Best Places to WorkLooking at the top three (3.docx
 
Week 2 Argument Paper Outline TemplateENG200 Version 2 1.docx
Week 2 Argument Paper Outline TemplateENG200 Version 2 1.docxWeek 2 Argument Paper Outline TemplateENG200 Version 2 1.docx
Week 2 Argument Paper Outline TemplateENG200 Version 2 1.docx
 
Week 2 Assignment 1Challenges of Transitioning in a Professional E.docx
Week 2 Assignment 1Challenges of Transitioning in a Professional E.docxWeek 2 Assignment 1Challenges of Transitioning in a Professional E.docx
Week 2 Assignment 1Challenges of Transitioning in a Professional E.docx
 
Week 2 IPWeekly tasks or assignments (Individual or Group Projec.docx
Week 2 IPWeekly tasks or assignments (Individual or Group Projec.docxWeek 2 IPWeekly tasks or assignments (Individual or Group Projec.docx
Week 2 IPWeekly tasks or assignments (Individual or Group Projec.docx
 
Week 2Testing means - T-testsIn qu.docx
Week 2Testing means - T-testsIn qu.docxWeek 2Testing means - T-testsIn qu.docx
Week 2Testing means - T-testsIn qu.docx
 
Week 11a.Analyze the need for unbiased financial repor.docx
Week 11a.Analyze the need for unbiased financial repor.docxWeek 11a.Analyze the need for unbiased financial repor.docx
Week 11a.Analyze the need for unbiased financial repor.docx
 
Week 2 What is driving the need for this transformational change (.docx
Week 2 What is driving the need for this transformational change (.docxWeek 2 What is driving the need for this transformational change (.docx
Week 2 What is driving the need for this transformational change (.docx
 
This is for a case study on Jeffery Dahmer.I needBiological Fa.docx
This is for a case study on Jeffery Dahmer.I needBiological Fa.docxThis is for a case study on Jeffery Dahmer.I needBiological Fa.docx
This is for a case study on Jeffery Dahmer.I needBiological Fa.docx
 
This is due in 24 hoursThere are 4 big questions in total. The a.docx
This is due in 24 hoursThere are 4 big questions in total. The a.docxThis is due in 24 hoursThere are 4 big questions in total. The a.docx
This is due in 24 hoursThere are 4 big questions in total. The a.docx
 
this is first questionDo you feel that the TCPIP model is more or.docx
this is first questionDo you feel that the TCPIP model is more or.docxthis is first questionDo you feel that the TCPIP model is more or.docx
this is first questionDo you feel that the TCPIP model is more or.docx
 
This is due by 2000 tonight EST.  It must be 300+ words, MLA, and a.docx
This is due by 2000 tonight EST.  It must be 300+ words, MLA, and a.docxThis is due by 2000 tonight EST.  It must be 300+ words, MLA, and a.docx
This is due by 2000 tonight EST.  It must be 300+ words, MLA, and a.docx
 
This is assignment is due tomorrow.Reread the discussion board res.docx
This is assignment is due tomorrow.Reread the discussion board res.docxThis is assignment is due tomorrow.Reread the discussion board res.docx
This is assignment is due tomorrow.Reread the discussion board res.docx
 
This is basic college admissions essay.There are many interest.docx
This is basic college admissions essay.There are many interest.docxThis is basic college admissions essay.There are many interest.docx
This is basic college admissions essay.There are many interest.docx
 
This is an open-book essay exam. Please answer both questions in.docx
This is an open-book essay exam. Please answer both questions in.docxThis is an open-book essay exam. Please answer both questions in.docx
This is an open-book essay exam. Please answer both questions in.docx
 
This is for a discussion post! Need to have one resource!!!To .docx
This is for a discussion post! Need to have one resource!!!To .docxThis is for a discussion post! Need to have one resource!!!To .docx
This is for a discussion post! Need to have one resource!!!To .docx
 
This is for kristine tutor  Make sure I do not want to get a.docx
This is for  kristine tutor  Make sure I do not want to get a.docxThis is for  kristine tutor  Make sure I do not want to get a.docx
This is for kristine tutor  Make sure I do not want to get a.docx
 
This is an extra credit assignment. You are to write an essay on one.docx
This is an extra credit assignment. You are to write an essay on one.docxThis is an extra credit assignment. You are to write an essay on one.docx
This is an extra credit assignment. You are to write an essay on one.docx
 

Recently uploaded

mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 

Recently uploaded (20)

mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 

this is an active contour method in python 2.7 I need to adjust just.docx

  • 1. this is an active contour method in python 2.7 I need to adjust just this program import Tkinter from Tkinter import * import os import sys import ImageTk, Image import PIL from PIL import * from array import array from turtle import * import math from math import pi #creating a window window=Tkinter.Tk() window.geometry("650x650") window.title("Active Contour Implementation") window.configure() #function for open file #function for new form def OpenNew(): openNew=Tkinter.Tk() openNew.title("Welcome") openNew.geometry("500x500") menubar = Menu(openNew) filemenu = Menu(menubar, tearoff=0) filemenu.add_command(label="New", command=OpenNew) filemenu.add_command(label="Open", command=openFile) filemenu.add_command(label="Save")
  • 2. filemenu.add_command(label="Save as...", command=saveAs) filemenu.add_separator() filemenu.add_command(label="Exit", command=OpenNew.quit) openNew.config(menu=menubar) openNew.mainloop() #Enter the value entr=Entry(window) entr.pack(fill=Y) entr.delete(0, END) entr.insert(0, " input the value") #Active Contour Implementation imgOpen="image3.jpg" image1 = ImageTk.PhotoImage(Image.open(imgOpen)) w = image1.width() h = image1.height() x = 0 y = 0 window.geometry("%dx%d+%d+%d" % (w, h, x, y)) Lbl = Tkinter.Label(window, image=image1) Lbl.pack(side='top', fill='both', expand='yes') Lbl.image = image1 print w print h newX=w/2
  • 3. newY=h/2 print 'newwwwww' print newX print newY n=150 s_radius=250 LCV=array("i") for i in range (n): LCV.append(i) L1X = array("i") for i in range (n): L1X.append(i) L1Y = array("i") for i in range (n): L1Y.append(i) L2X = array("i") for i in range (n): L2X.append(i) L2Y = array("i") for i in range (n): L2Y.append(i) BordersX = array("i") for i in range (n): BordersX.append(i) BordersY = array("i")
  • 4. for i in range (n): BordersY.append(i) xFill=[BordersX, -1] yFill=[BordersY, -1] #Set=color('red') step_size=15 jump_threshold=25 #setWidth? radius=s_radius radius>10 radius=radius-step_size if radius==s_radius: i=0 while i x_0=radius * cos ( i * (2*pi)/n) y_0=radius * sin ( i * (2*pi)/n) x_0 = x_0 + newX y_0 = y_0 + newY BordersX[i]= x_0 BordersY[i]= y_0 LCV[i] = -1 i+=1 pnt_cnt=0 j=0 while j if LCV[j]== -1: x_0=radius * cos( i * (2*pi)/n) + newX y_0=radius * sin ( i * (2*pi)/n) + newY
  • 5. x_1=((radius - step_size) * cos( i * (2*pi)/n) ) + newX y_1=((radius - step_size) * sin ( i * (2*pi)/n) ) + newY v_0 = getPixel(x_0, y_0) v_1 = getPixel(x_1, y_1) if gVal(v_0) - gVal(v_1) > jump_threshold: LCV[i]=1 else: BordersX[i]= x_1 BordersY[i]= y_1 Pol=Tkinter.Canvas(window) Pol.pack() Pol.create_line(BordersX, BordersY) wait(20) pnt_cnt=pnt_cnt + 1 i+=1 def gVal(v): red = (v>>16)&0xff green = (v>>8)&0xff blue = v&0xff return (00.56 * red + 0.33*green + 0.11 * blue) # Menu Option #File menu menubar=Menu(window) filemenu=Menu(menubar, tearoff=0) filemenu.add_command(label="New",command=OpenNew) filemenu.add_command(label="Open", command=openFile) filemenu.add_command(label="Save") filemenu.add_command(label="Save As",command=saveAs) filemenu.add_separator() filemenu.add_command(label="Exit",command= window.quit) menubar.add_cascade(label="File", menu=filemenu)
  • 6. #Edit menu editmenu=Menu(menubar, tearoff=0) editmenu.add_command(label="Cut") editmenu.add_command(label="Copy") editmenu.add_command(label="Paste") editmenu.add_command(label="Delete") editmenu.add_command(label="Select All") menubar.add_cascade(label="Edit",menu=editmenu) #Help menu helpmenu=Menu(menubar, tearoff=0) helpmenu.add_command(label="About", command=help) helpmenu.add_command(label="Help", command=help) menubar.add_cascade(label="Help", menu=helpmenu) window.config(menu=menubar) window.mainloop()