コード例 #1
0
colony_number = 10
detect_range = 90
area_of_interest_list = []

################################################################

for i in area_of_interest:
    area_of_interest_split = i.split(',')
    cordxlist.append(area_of_interest_split[0])
    cordylist.append(area_of_interest_split[1])

#군집 n개 만들기
colonylist = []

for i in range(0, colony_number):
    test = []
    for j in range(sensornumber):
        k = mc.make_coord(test, cordxlist, cordylist)

    colonylist.append(k)

sc.split_coord1(area_of_interest, area_of_interest_list)
spa = sp.start(area_of_interest_list, colonylist[0], detect_range)

for i in range(0, 10):
    spa = sp.start(area_of_interest_list, colonylist[i], detect_range)

    #globals()['sp'.format(i)] = sp.start(area_of_interest_list, colonylist[i], detect_range)

#sp.start()
コード例 #2
0
import convert_png as cp
import split_area as sa
import make_sensor as ma
import save_png as sp
import split_coordinate as sc

#변하지 않는 값
area_of_interest_list = []
sc.split_coord1(input("관심영역의 좌표를 입력하시오.").split(' '),
                area_of_interest_list)  #관심영역 좌표 리스트
#입력 예시 지금은 정삼각형만 입력해야함 (200,200) (600,200) (400,540)           // (286,39) (515,408) (58,410)
detect_range = int(input("센서의 탐지범위를 입력하시오.\n"))  #센서 탐지범위

basic_png = sp.start(area_of_interest_list, [], detect_range)
basic_png.save_png()
total_pixel_of_interest = cp.convert_return_count("image_test0.png")

#변수
sensor_number = 6  #센서 갯수 -> 추후 변경
max_coverage_percent = 0  #가장 큰 커버율 -> 이 커버율이 100퍼센트가 되면 종료
max_coverage_percent_section = 0  #센서 배치 함수 개수 section의 커버율

area_of_interest_center_coordinate = sa.getCenter(
    "image_test0.png")  #무게중심 x,y 리스트 반환환
area_of_interest_getContour = sa.getContour(
    sensor_number, "image_test0.png")  #윤곽선에 sensor_number만큼의 점을 뽑는거
area_of_interest_spliced_list = sa.splitList(
    area_of_interest_getContour, area_of_interest_list,
    area_of_interest_center_coordinate, sensor_number)

#print(area_of_interest_spliced_list)